Skip to content

fix(server): mirror a raised AdcpError into the payload errors array - #1592

Merged
bokelley merged 1 commit into
mainfrom
bokelley/adcp-error-fills-errors
Oct 24, 2026
Merged

bokelley merged 1 commit into
mainfrom
bokelley/adcp-error-fills-errors

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Fixes #1558, reported by @austinwiltshire.

A raised AdcpError produced structuredContent = {"adcp_error": {...}} on MCP, and the same single key on the A2A failed-task DataPart. AdCP's L3 error-handling guidance (3.1.27, 3.2.x, main) says a fatal task failure SHOULD populate both layers: payload errors[] and envelope adcp_error. Storyboards read both. media_buy_seller/product_signal_targeting checks errors[0].field, so a seller that raised AdcpError as the docs recommend failed that step.

Change: both transports now emit "errors": [<copy of adcp_error>] alongside adcp_error. The context echo and response enhancer still run after, unchanged. Adopters using the response_enhancer workaround from the issue keep working; it no-ops once errors is present.

Tests: new MCP tests (the mirror, with a separate object) and an A2A test, all failing without the fix. 17,021 pass. The 6 failures in tests/test_reporting_production_public.py are the known sandbox ones (no adcp-reporting-storage install) and pass in CI.

🤖 Generated with Claude Code

build_mcp_error_result and the A2A failed-task payload carried only the
adcp_error envelope. AdCP's L3 error handling says a fatal failure
SHOULD populate both layers, and storyboards such as
media_buy_seller/product_signal_targeting read errors[0].field, so a
seller raising AdcpError as documented failed those steps. Add
errors: [adcp_error] on both transports.

Fixes #1558

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean fix for #1558 with no blocking or medium findings.

Checked:

  • Mirrors the adcp_error envelope into a payload errors[] array on both transports (MCP translate.py:263, A2A a2a_server.py:842) so a fatal failure populates both L3 layers per spec.
  • Mirrored keys (code/message/recovery/field/suggestion/retry_after/details) are all valid Error model fields — no spec drift.
  • Shape change is strictly additive and non-breaking; fix(server): semver signal is correct (no public-API removal/rename/type change, no required→optional flip).
  • Client-side extractors guard on is_error before the len(sc)==1 heuristic, so adding errors introduces no new client break.
  • details sanitization runs before the mirror.
  • New MCP and A2A tests fail without the fix.

Decision table: no critical/high/medium findings; gated_paths is false; high_risk is true only via (modified) entries but with no medium-or-higher finding (rows 4/5 do not fire); no deleted paths; no author-team gate; no prior decision. Falls through to row 9 → approve. Note: review_decision is REVIEW_REQUIRED, but with gated_paths: false row 2 does not apply.

@bokelley
bokelley merged commit cd0319b into main Oct 24, 2026
47 checks passed
@bokelley
bokelley deleted the bokelley/adcp-error-fills-errors branch October 24, 2026 23:44
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.

Raised AdcpError only fills adcp_error, so storyboards that read errors[0] fail

1 participant