fix(a2a): outbound text Parts use kind not type + envelope/auth_env regression gates #2285
Reference in New Issue
Block a user
Delete Branch "harden/regression-coverage-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Real outbound-A2A bug + its regression coverage (goal: every found issue gated in CI).
Bug: core EMITS A2A text Parts as
{"type":"text"}on the OUTBOUND send path —mcp_tools.go:195buildA2AMessageParts(feeds delegate_task + delegate_task_async) anddelegation.go:182(inline sync-delegation envelope). a2a-sdk v0.3 useskindas the Part discriminator and silently drops atype-keyed part → the send-side twin of #2251. #2255 fixed only the INBOUND normalizeA2APayload; this outbound path was unfixed. (The file-attachment Part already correctly usedkind.) Fixed both text Parts to{"kind":"text"}.Regression coverage (gating):
a2a_outbound_envelope_test.go—TestBuildA2AMessageParts_TextPartUsesKindNotType,TestDelegationOutboundEnvelope_RoleAndKind(both red against the shippedtypeshape, green after fix — proven),TestBuildA2AMessageParts_FilePartUsesKind(pins the already-correct file part). A re-introducedtype-keyed part fails CI.providers_test.go::TestPlatformProvider_AuthEnvIsUsageTokenOnly— exact-equality gate on theplatformprovider'sauth_env(#2250). core's providers.yaml is already clean (vendor key is in the separateauth_token_env); this locks the invariant against future drift onto the SSOT.go build/vet/test green. NOTE: the actual #2250 drift ships in the codex TEMPLATE repo (config.yaml platform auth_env carries ANTHROPIC_API_KEY) — fixed there in a separate PR.
Reviewed: real outbound A2A bug — core emitted type-keyed Parts (mcp_tools.go:195, delegation.go:182) that v0.3 peers silently drop; #2255 only fixed inbound. Fix=kind. Envelope tests proven red→green + #2250 auth_env exact-equality gate. Verified diff. Approve.
REQUEST_CHANGES: direct Gitea verification does not support approval at head
8a5c6cf771.Source-of-truth combined CI is failure across 30 contexts at the current head. I cannot post a counting approval while the PR is red/pending, even with an existing CEO Assistant approval. Please re-request CR2 review after CI is success on the current head; I will re-run the normal 5-axis review then.
APPROVED after re-review using branch-protection required contexts rather than combined status.
Required-context check: present required context(s) are green at head 8a5c6cf7718d; absent required contexts are path-filter absent for this PR. 5-axis review found no blocking issue.
Summary: Outbound A2A message parts use v0.3 kind discriminator and add envelope/auth regression gates.
Correctness/robustness: change adds targeted regression coverage or fail-closed behavior for the reported bug class. Security: no new secret exposure or auth broadening found. Performance: no concerning runtime cost. Readability: comments/tests are explicit about the incident class and gate semantics.