Skip to content

Conversation

@bokelley
Copy link
Contributor

Summary

Fixed mock adapter to not return fake media_buy_id values for pending/async operations. When a media buy doesn't exist yet, we should return media_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 mode

This is wrong because:

  1. Media buy doesn't exist yet - it's being processed
  2. Fake IDs confuse clients - they look queryable but aren't
  3. Violates A2A protocol - pending operations should have minimal domain data

Solution

Per AdCP protocol envelope design:

  • Domain response returns media_buy_id=None (doesn't exist yet)
  • Domain response returns packages=[] (not created yet)
  • Protocol envelope provides status="working" or "input-required"
  • Protocol envelope provides task_id (workflow_step_id) for tracking

Clients use task_id to poll or wait for webhook, NOT a fake media_buy_id.

Changes

  • Mock adapter question-asking: Returns media_buy_id=None, packages=[]
  • Mock adapter async mode: Returns 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

  • Pre-commit hooks pass
  • Only mock adapter changes (no schema files)
  • Clean rebase on latest main

Notes

This PR replaces #655 which accidentally included schema file changes.

🤖 Generated with Claude Code

…apter

For pending/async operations, the media buy doesn't exist yet, so we shouldn't
return a fake media_buy_id like 'pending_xyz'. This confuses clients who might
try to query or reference non-existent media buys.

Per AdCP protocol envelope design:
- Domain response returns media_buy_id=None (doesn't exist yet)
- Domain response returns packages=[] (not created yet)
- Protocol envelope provides status='working' or 'input-required'
- Protocol envelope provides task_id (workflow_step_id) for tracking

Clients use task_id to poll or wait for webhook, not a fake media_buy_id.

Changes:
- Mock adapter question-asking scenario: Returns media_buy_id=None, packages=[]
- Mock adapter async mode: Returns media_buy_id=None, packages=[]

This aligns with A2A protocol where incomplete operations return minimal
domain data with protocol envelope indicating status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit dc2a2ba into main Oct 28, 2025
9 checks passed
EmmaLouise2018 pushed a commit that referenced this pull request Oct 29, 2025
…apter (#658)

For pending/async operations, the media buy doesn't exist yet, so we shouldn't
return a fake media_buy_id like 'pending_xyz'. This confuses clients who might
try to query or reference non-existent media buys.

Per AdCP protocol envelope design:
- Domain response returns media_buy_id=None (doesn't exist yet)
- Domain response returns packages=[] (not created yet)
- Protocol envelope provides status='working' or 'input-required'
- Protocol envelope provides task_id (workflow_step_id) for tracking

Clients use task_id to poll or wait for webhook, not a fake media_buy_id.

Changes:
- Mock adapter question-asking scenario: Returns media_buy_id=None, packages=[]
- Mock adapter async mode: Returns media_buy_id=None, packages=[]

This aligns with A2A protocol where incomplete operations return minimal
domain data with protocol envelope indicating status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…apter (adcontextprotocol#658)

For pending/async operations, the media buy doesn't exist yet, so we shouldn't
return a fake media_buy_id like 'pending_xyz'. This confuses clients who might
try to query or reference non-existent media buys.

Per AdCP protocol envelope design:
- Domain response returns media_buy_id=None (doesn't exist yet)
- Domain response returns packages=[] (not created yet)
- Protocol envelope provides status='working' or 'input-required'
- Protocol envelope provides task_id (workflow_step_id) for tracking

Clients use task_id to poll or wait for webhook, not a fake media_buy_id.

Changes:
- Mock adapter question-asking scenario: Returns media_buy_id=None, packages=[]
- Mock adapter async mode: Returns media_buy_id=None, packages=[]

This aligns with A2A protocol where incomplete operations return minimal
domain data with protocol envelope indicating status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants