fix: Remove fake media_buy_id from pending/async responses #658
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
Fixed mock adapter to not return fake
media_buy_idvalues for pending/async operations. When a media buy doesn't exist yet, we should returnmedia_buy_id=None, not confusing fake IDs like"pending_xyz".Problem
The mock adapter was returning fake IDs for async/pending operations:
"pending_question_{id}"for question-asking scenarios"pending_{step_id}"for async modeThis is wrong because:
Solution
Per AdCP protocol envelope design:
media_buy_id=None(doesn't exist yet)packages=[](not created yet)status="working"or"input-required"task_id(workflow_step_id) for trackingClients use
task_idto poll or wait for webhook, NOT a fake media_buy_id.Changes
media_buy_id=None,packages=[]media_buy_id=None,packages=[]Example Responses
Before (wrong):
{ "status": "working", "task_id": "workflow_abc", "payload": { "media_buy_id": "pending_workflow_abc", // Fake ID! "packages": [] } }After (correct):
{ "status": "working", "task_id": "workflow_abc", "payload": { "media_buy_id": null, // No media buy yet "packages": [] } }Testing
Notes
This PR replaces #655 which accidentally included schema file changes.
🤖 Generated with Claude Code