Repository navigation
fix(training-agent): emit completion webhooks on framework dispatch - #2868
Merged
Merged
Conversation
…loses #2843) Framework dispatch's `adapt()` wrapper called the handler but never fired a completion webhook when the buyer supplied `push_notification_config.url`, breaking three `webhook_emission` storyboard invariants under `TRAINING_AGENT_USE_FRAMEWORK=1`: payload/idempotency_key presence, retry dedupe, and RFC 9421 signature verification. Legacy dispatch emitted inline. Extract emission into `maybeEmitCompletionWebhook` in `webhooks.ts` and call it from both paths so framework and legacy emit byte-identical envelopes. `adapt()` now takes the tool name so the shared helper can look up `TOOL_TO_TASK_TYPE`. - webhook_emission storyboard: 4P/3F → 7P/0F under framework - framework clean count: 26/56 → 27/56 storyboards - legacy path unchanged (45/56 on both before and after) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Apr 22, 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
webhook_emissionstoryboard invariants that fail underTRAINING_AGENT_USE_FRAMEWORK=1: payload/idempotency_keypresence, retry dedupe, and RFC 9421 signature verification (webhook_emission storyboard: 9421 signature + retry dedupe + payload shape failing (framework) #2843).adapt()wrapper called the handler but never emitted the completion webhook when the buyer suppliedpush_notification_config.url. Legacy dispatch did this inline intask-handlers.ts.maybeEmitCompletionWebhookinwebhooks.tsand calls it from both paths so framework and legacy emit byte-identical envelopes.adapt()now takes the tool name so the shared helper can look upTOOL_TO_TASK_TYPE.Results
webhook_emissionstoryboard (framework): 4P/3F → 7P/0FTest plan
webhook_emissionpasses underTRAINING_AGENT_USE_FRAMEWORK=1webhook_emissionstill passes on legacy dispatchnpm run typecheckcleannpm run test:unitclean (631 passed)Follow-up
Pre-existing spec-compliance bug surfaced during review but scoped out of this fix: the webhook envelope emits
protocol: 'mcp'(a transport value) wherecore/mcp-webhook-payload.json$refsenums/adcp-protocol.json(domain values:media-buy,signals,governance, etc.). Legacy dispatch has always had this. Worth a separate issue if the schema validator starts enforcing it.🤖 Generated with Claude Code