Repository navigation
feat(a2a): upgrade to a2a-sdk 1.4.0 with dual-stack v0.3/v1.0 support - #1244
Merged
Merged
Conversation
- 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.
VeA2AServer serves message/stream for both the 0.3 and 1.0 JSON-RPC bindings, but its AgentCard advertised streaming=false. A 1.0 client that honours the card could therefore downgrade to non-streaming message/send. Advertise the capability that the server actually has. CloudApp's default mode built a v0.3-only synthetic card, so it could not reach a 1.0-only peer. Default to auto card resolution instead: try /.well-known/agent-card.json, then the legacy /.well-known/agent.json, and let the SDK pick the best interface. If neither path publishes a card, fall back to the historical v0.3-only card so existing deployments keep working. use_agent_card=False preserves the old no-fetch behavior; True requires a card. A successful resolution is cached per instance. Verified against real servers: dual-stack veadk (1.0), 1.0-only (1.0), 0.3-only with the legacy card path (0.3), and a no-card endpoint (0.3).
Introduce A2AServerConfig with opt-in knobs for the 1.x capabilities and an AgentCard signer supporting local JWK/PEM keys and Volcano Engine KMS asymmetric keys. The signer produces a detached JWS over the JCS-canonicalised card and can publish the matching JWKS to TOS. Signed-off-by: Codex <codex@openai.com>
Add a bearer-token middleware that validates JWTs against an OIDC issuer/JWKS, a tenant transport decorator for clients, and task/event/push stores that scope data by caller and tenant. In-memory mode keeps the historical single-process behaviour while enforcing per-owner isolation; database mode uses the SDK's versioned SQLAlchemy stores for multi-replica deployments. Signed-off-by: Codex <codex@openai.com>
Add a push sender with the SDK's SSRF screen, a store wrapper that applies a server-wide default webhook while honouring per-task overrides, and the OpenTelemetry plugin manager. All are opt-in through A2AServerConfig. Signed-off-by: Codex <codex@openai.com>
Wire REST, OpenTelemetry, input-mode and required-extension validation, extended card, signing, security schemes, OIDC auth, cluster stores, push delivery and tenant routing into VeA2AServer. Everything is opt-in and the default configuration keeps the dual-stack v0.3 + v1.0 behaviour, so existing callers and VeFaaS deployments are unchanged. Also attach the tenant to CloudApp and RemoteVeAgent so client-side routing works with the same server configuration. Signed-off-by: Codex <codex@openai.com>
wujiaming-ai
force-pushed
the
feat/a2a-sdk-1.4-upgrade
branch
4 times, most recently
from
December 3, 2026 09:23
a28e6ef to
3ad9a55
Compare
Add unit and HTTP contract tests for the config surface, REST transport, OpenTelemetry spans, input-mode and extension validation, extended card, signing, tenant scoping, owner isolation and push delivery (default webhook, SSRF rejection and per-task override). Signed-off-by: Codex <codex@openai.com>
Cover multi-replica task visibility and cross-replica streaming on AIDAP Serverless PostgreSQL, database-backed push delivery, OIDC client-credentials auth with the real Identity Service JWKS, tenant isolation, and AgentCard signature verification against a TOS-hosted JWKS. The KMS path is included but skipped until the account activates the KMS service. Signed-off-by: Codex <codex@openai.com>
wujiaming-ai
force-pushed
the
feat/a2a-sdk-1.4-upgrade
branch
from
December 3, 2026 09:27
3ad9a55 to
dbb1b5c
Compare
Volcano Engine KMS returns ASN.1 DER SEQUENCE(r, s) for ECDSA, while JWS ES256 requires the fixed-width r||s concatenation. Convert the signature before base64url encoding so KMS-signed cards verify with standard JWKS. Extend the unit test to assert the request shape and the 64-byte raw signature, and make the real-cloud KMS test fetch the public key and verify both a valid and a tampered card. Signed-off-by: Codex <codex@openai.com>
- Forward initialize() in DefaultingPushNotificationConfigStore so a server with both database_url and push_webhook_url starts instead of raising AttributeError during lifespan startup. - Apply the RemoteVeAgent tenant inside _ensure_resolved, after the ADK client exists, instead of in __init__ where _a2a_client is still None. - Unwrap TenantTransportDecorator before auth-header injection so TIP and bearer credentials are still applied when tenant routing is enabled. - Pass the tenant-aware owner resolver into InMemoryTaskStore so tasks are filtered before pagination, not after. - Seed the placeholder VEADK_A2A_PUBLIC_URL before releasing an updated code bundle, so apps created before the env existed can boot the new template. All five findings are covered by unit tests; the DB+push startup path was also verified against a real AIDAP workspace. Signed-off-by: Codex <codex@openai.com>
Collaborator
Author
补充验证(2026-12-04)新增两个提交:
真实云端验证(cn-shanghai):
测试报告:https://bytedance.larkoffice.com/docx/Vd7xdo6A5o15NCxuxbyc6t3rnCn(第 13 章) |
This was referenced Dec 4, 2026
Collaborator
Author
依赖更新agentkit-sdk-python 0.9.5 已发版(包含 A2A Center card 修复)。本分支已将依赖从 验证:
关联:
|
Collaborator
Author
|
CI 已全绿:26 success / 4 skipped / 0 failure。 依赖基线测试已同步到 agentkit-sdk-python 0.9.5(
|
Collaborator
Author
to_a2a 双路径 card 同步修复新增提交
验证:
测试报告(第 13.12 节):https://bytedance.larkoffice.com/docx/Vd7xdo6A5o15NCxuxbyc6t3rnCn |
yaozheng-fang
approved these changes
Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade
veadk-pythonto 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
a2a-sdk[http-server]>=1.4.0,<1.5.0andagentkit-sdk-python>=0.9.3.0.3and1.0JSON-RPC interfaces and serve both card paths fromVeA2AServer,init_appandto_a2a.enable_v0_3_compat=True.CloudMessage/CloudPartsoCloudApp.message_sendkeeps the historicalparts[0].root.textaccess while supporting a2a 1.x flat parts.httpxclient lifecycle inCloudAppand addaclose/close/async with.TaskStore, executor, identity auth processor, hub client,RemoteVeAgentand the remote Skill transport to a2a 1.x APIs.VEADK_A2A_PUBLIC_URLin the FaaS template and use the fastmcp 3.xenable(tags=..., only=True)API.srcprojects.Runner.run_asyncintrospectable for ADK 2.14.x's A2A executor.uv.lock:a2a-sdk 1.4.0,agentkit-sdk-python 0.9.3from PyPI (no local path).>=0.9.3in the runtime-dependency, Studio TOS and sidecar-wheel metadata tests.streaming=trueonVeA2AServer's AgentCard (the server servesmessage/streamfor both 0.3 and 1.0).CloudAppdefault mode auto-resolve the card from both well-known paths, preferring 1.0, with a v0.3-only fallback when no card is published.Testing
main@ea78f82b).agentkit-sdk-python 0.9.3+a2a-sdk 1.4.0: 131 passed, 16 deselected (14 network upload cases + 2 pre-existing 403 cases).CloudAppdefault/card modes,RemoteVeAgent,skill.py, MCP, andA2AHubClientall passed.pre-commitpassed (ruff, format, secret scanning, dependency policy).Compatibility notes
CloudApp.message_sendreturns aCloudMessagewrapper that supports bothparts[0].root.textandparts[0].text.VEADK_A2A_PUBLIC_URL; existing generated projects need to sync the newsrc/app.pyanddeploy.pybefore redeploying.AgentkitA2aAppcompatible with both a2a 0.3.x and 1.x.Remaining before release
Links