Skip to content

feat(a2a): upgrade to a2a-sdk 1.4.0 with dual-stack v0.3/v1.0 support - #1244

Open
wujiaming-ai wants to merge 8 commits into
mainfrom
feat/a2a-sdk-1.4-upgrade
Open

wujiaming-ai wants to merge 8 commits into
mainfrom
feat/a2a-sdk-1.4-upgrade

Conversation

@wujiaming-ai

@wujiaming-ai wujiaming-ai commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Upgrade veadk-python to a2a-sdk 1.4.0 with a default dual-stack (v0.3 + v1.0) compatibility layer, so existing v0.3 peers keep working without configuration changes.

This PR also completes the FaaS public-URL injection flow and fixes three issues found during real cloud smoke testing.

Changes

  • Depend on a2a-sdk[http-server]>=1.4.0,<1.5.0 and agentkit-sdk-python>=0.9.3.
  • Advertise both 0.3 and 1.0 JSON-RPC interfaces and serve both card paths from VeA2AServer, init_app and to_a2a.
  • Keep v0.3 JSON-RPC compatibility via enable_v0_3_compat=True.
  • Add CloudMessage/CloudPart so CloudApp.message_send keeps the historical parts[0].root.text access while supporting a2a 1.x flat parts.
  • Fix the shared httpx client lifecycle in CloudApp and add aclose / close / async with.
  • Migrate TaskStore, executor, identity auth processor, hub client, RemoteVeAgent and the remote Skill transport to a2a 1.x APIs.
  • Require VEADK_A2A_PUBLIC_URL in the FaaS template and use the fastmcp 3.x enable(tags=..., only=True) API.
  • Inject the public URL after deploy, seed a placeholder before the first release, and make repeated deploys idempotent.
  • Fix the code-update path for already-rendered src projects.
  • Keep Runner.run_async introspectable for ADK 2.14.x's A2A executor.
  • Update uv.lock: a2a-sdk 1.4.0, agentkit-sdk-python 0.9.3 from PyPI (no local path).
  • Align the agentkit baseline assertions to >=0.9.3 in the runtime-dependency, Studio TOS and sidecar-wheel metadata tests.

Testing

  • Changed-line coverage: 327/327 = 100% (13 changed modules, base main@ea78f82b).
  • Relevant suite with published agentkit-sdk-python 0.9.3 + a2a-sdk 1.4.0: 131 passed, 16 deselected (14 network upload cases + 2 pre-existing 403 cases).
  • ADK matrix: 2.7.0 / 2.11.0 / 2.14.1, A2A tests 48 passed on each version.
  • Real VeFaaS cloud smoke: first deploy, public URL injection, code update, repeated deploy idempotency, 0.3.26 and 1.4.0 clients (non-streaming + streaming), CloudApp default/card modes, RemoteVeAgent, skill.py, MCP, and A2AHubClient all passed.
  • pre-commit passed (ruff, format, secret scanning, dependency policy).

Compatibility notes

  • Public Python signatures are preserved.
  • CloudApp.message_send returns a CloudMessage wrapper that supports both parts[0].root.text and parts[0].text.
  • New FaaS projects must set VEADK_A2A_PUBLIC_URL; existing generated projects need to sync the new src/app.py and deploy.py before redeploying.
  • The template starts with a placeholder public URL for the first release, then the real URL is injected and the function is released again.
  • agentkit 0.9.3 keeps AgentkitA2aApp compatible with both a2a 0.3.x and 1.x.

Remaining before release

  • Full regression, performance baseline and Python 3.10 install matrix (full regression runs in this PR's CI).
  • Existing FaaS projects need the template sync described above.

Links

- depend on a2a-sdk[http-server]>=1.4.0,<1.5.0 and agentkit-sdk-python>=0.9.3
- advertise both 0.3 and 1.0 JSON-RPC interfaces and serve both card paths
  from VeA2AServer, init_app and to_a2a
- keep v0.3 JSON-RPC compatibility via enable_v0_3_compat
- add CloudMessage/CloudPart so CloudApp.message_send keeps the historical
  parts[0].root.text access while supporting a2a 1.x flat parts
- fix CloudApp httpx client lifecycle and add aclose/close/context manager
- migrate TaskStore, executor, identity auth processor, hub client and
  remote agents to a2a 1.x APIs
- require VEADK_A2A_PUBLIC_URL in the FaaS template and enable MCP routes
  with the fastmcp 3.x API
- add tests/a2a/test_a2a_sdk_14.py covering the migration contract
- add VeFaaS.merge_function_envs_and_release, which preserves the
  function's existing env vars and is idempotent
- inject the public URL after a new deploy and after a code update so the
  AgentCard advertises a reachable endpoint instead of 0.0.0.0
- cover merge, skip and platform-env preservation with unit tests
The template validates VEADK_A2A_PUBLIC_URL at import time, but the real
public URL is only known after the first release. Seed a placeholder env on
function creation so the first release can boot, then replace it with the
real URL and release again. This closes the chicken-and-egg gap in the
two-phase FaaS deploy.
ADK 2.14.x's A2A executor calls inspect.signature on the bound
runner.run_async. The interceptor wrapper exposes keyword-only parameters,
which Python rejects for a bound method with 'invalid method signature'.
Wrap the interceptor with a positional *args/**kwargs function so the
signature is introspectable while preserving the interceptor contract.
CloudAgentEngine.update_function_code is called with the rendered `src`
directory by the template's deploy.py, but _update_function_code assumed a
project root and nested it under src/<name>. That broke relative
requirements paths such as local wheels. Detect the rendered src layout and
copy it over the template src directory instead.
The runtime, studio TOS and sidecar wheel metadata tests still asserted the
historical agentkit-sdk-python>=0.8.5 floor. veadk now requires >=0.9.3 so
that a2a-sdk 1.4.0 resolves, so the assertions are updated to the new floor
while still proving the TOS-capable lower bound is preserved.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant