Skip to content

Conversation

@bokelley
Copy link
Contributor

Problem

  • Delivery simulator uses daemon threads that don't survive server restarts
  • When Fly.io restarts the app, all active simulations are lost
  • Media buys created before restart never send webhooks
  • This was causing the fast-callback-test product to stop sending webhooks

Solution

  • Added restart_active_simulations() method to DeliverySimulator
  • Queries database for active media buys with webhook configs on startup
  • Restarts simulations for mock adapter products automatically
  • Called from initialize_application() during server startup
  • Updated AdCP schemas to latest from registry

Testing

  • All unit and integration tests passing
  • Webhooks will resume after server restarts
  • Mock adapter simulations persist across deployments

Impact

  • Fixes webhook delivery for test agent integration
  • Ensures fast-callback-test products continue sending webhooks after Fly.io restarts
  • No breaking changes

Problem:
- Delivery simulator uses daemon threads that don't survive server restarts
- When Fly.io restarts the app, all active simulations are lost
- Media buys created before restart never send webhooks

Solution:
- Added restart_active_simulations() method to DeliverySimulator
- Queries database for active media buys with webhook configs
- Restarts simulations for mock adapter products on server startup
- Called from initialize_application() during startup
- Updated AdCP schemas to latest from registry

This ensures webhooks resume after server restarts, fixing the issue
where fast-callback-test products stop sending webhooks.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit 6c4ef08 into main Oct 12, 2025
1 check passed
bokelley added a commit that referenced this pull request Oct 24, 2025
Problem:
- delivery_simulator.py was checking product.adapter_type on line 98
- Products don't have adapter_type - adapters are configured at tenant level
- This caused AttributeError on server startup, breaking deployment
- Bug introduced in PR #347 (commit 6c4ef08)

Solution:
- Query tenant instead of checking non-existent product.adapter_type
- Check tenant.adapter_type (the correct field)
- Add Tenant to imports

This fixes the production deployment hang.

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

Co-Authored-By: Claude <noreply@anthropic.com>
bokelley added a commit that referenced this pull request Oct 24, 2025
Problem:
- delivery_simulator.py was checking product.adapter_type on line 98
- Products don't have adapter_type - adapters are configured at tenant level
- This caused AttributeError on server startup, breaking deployment
- Bug introduced in PR #347 (commit 6c4ef08)

Solution:
- Query tenant instead of checking non-existent product.adapter_type
- Check tenant.adapter_type (the correct field)
- Add Tenant to imports

This fixes the production deployment hang.

🤖 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
…tprotocol#347)

Problem:
- Delivery simulator uses daemon threads that don't survive server restarts
- When Fly.io restarts the app, all active simulations are lost
- Media buys created before restart never send webhooks

Solution:
- Added restart_active_simulations() method to DeliverySimulator
- Queries database for active media buys with webhook configs
- Restarts simulations for mock adapter products on server startup
- Called from initialize_application() during startup
- Updated AdCP schemas to latest from registry

This ensures webhooks resume after server restarts, fixing the issue
where fast-callback-test products stop sending webhooks.

🤖 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
…contextprotocol#595)

Problem:
- delivery_simulator.py was checking product.adapter_type on line 98
- Products don't have adapter_type - adapters are configured at tenant level
- This caused AttributeError on server startup, breaking deployment
- Bug introduced in PR adcontextprotocol#347 (commit 6c4ef08)

Solution:
- Query tenant instead of checking non-existent product.adapter_type
- Check tenant.adapter_type (the correct field)
- Add Tenant to imports

This fixes the production deployment hang.

🤖 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