Commit 37d2cda
fix(webhooks): reject unknown AdCP status in create_a2a_webhook_payload (#605)
The builder previously fell back to ``TASK_STATE_UNSPECIFIED`` when the
caller's status didn't match the AdCP→A2A mapping table. The wire
normalizer then rewrote that to the literal string ``"unspecified"``,
which is not a valid A2A v0.3 ``TaskState`` (the spec enum is submitted
| working | input-required | completed | canceled | failed | rejected
| auth-required | unknown). Buyer receivers validating against the
schema reject the webhook — silent wire-level breakage.
Raise ``ValueError`` at the builder boundary instead. The AdCP→A2A
mapping is closed, so an unknown value is always a caller bug; failing
loud beats producing a payload buyers will reject mid-delivery.
Closes #603.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6a06e88 commit 37d2cda
2 files changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
578 | 589 | | |
579 | 590 | | |
580 | 591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
0 commit comments