fix: guard against top-level setup in media buy responses#556
Merged
Conversation
IO-signing setup URL belongs inside `account.setup` (a field on `Account`), not on the media buy itself. The strict handler types would catch this, but `DomainHandler` accepts `Record<string, unknown>` for handler DX, so the mistake slipped through to runtime with no feedback. `mediaBuyResponse`, `updateMediaBuyResponse`, and `getMediaBuysResponse` now throw a descriptive error pointing the builder to the correct location. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 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
Response builders (
mediaBuyResponse,updateMediaBuyResponse,getMediaBuysResponse) now throw a descriptive error whensetupappears at the top level of a media buy instead of nested insideaccount.setup.Why
The IO-signing setup URL belongs on
Account.setup, not on the media buy itself. Nothing in the schema has top-levelsetuponMediaBuy/CreateMediaBuySuccess/UpdateMediaBuySuccess, butDomainHandleracceptsRecord<string, unknown>(DX fix from #548), so TypeScript stops catching the mistake. Storyboard "expected" narrative usessetup.urlshorthand, which agent builders were mirroring as a top-level field.Error
Related
setup.url→account.setup.url) to be filed as a separate issue onadcontextprotocol/adcp.Test plan
test/server-responses.test.js(throws for each builder, accepts nested case)🤖 Generated with Claude Code