ORCA-902: regenerate the webhook schema to 2026-09-06 - #62
Merged
Conversation
Brings in what 2026-09-02 and 2026-09-06 added: workspaceFiles on the discussion.message_created message, the two tool call approval events, and agentStatus on the shared discussion shape. The new fields all sit on shapes with additionalProperties: true, so a fixture that merely carries them passes against the old schema. The two new tests are negative for that reason. Recomputes the HMAC signatures in verify-plain-webhook.test.ts: bumping the version string in the thread-created fixture changes the bytes they sign.
JacobCutts13
approved these changes
Sep 7, 2026
presmihaylov
deleted the
orca-902-regenerate-webhooks-schema-2026-09-06
branch
September 7, 2026 06:48
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.
Closes ORCA-902.
Why. The package still bundles the
2026-08-31schema. Two versions have shipped since, so a customer whose webhook target is on either one getsPlainWebhookVersionMismatchErrorinstead of a parsed payload.How.
parse-webhook.test.ts. Every shape the new fields sit on hasadditionalProperties: true, so a fixture that merely carriesagentStatusorworkspaceFilesalso passes on the old schema. The checks with teeth are negative, and I confirmed both fail there.webhookTargetVersionis aconst, so the package holds one version at a time. This is a regen to the latest, not two side by side; two changesets record2026-09-02and2026-09-06, as 1.8.0 did.verify-plain-webhook.test.tssignatures are recomputed: the version bump in thethread-createdfixture changes the bytes they sign.What. Two new events, plus
agentStatuson the discussion every discussion event already reports.{ "type": "discussion.tool_call_approval_resolved", "payload": { "eventType": "discussion.tool_call_approval_resolved", "discussion": { "id": "thd_01HD44FHDPG82VQ4QNHDR4N2T1", "type": "AGENT_SESSION", "status": "OPEN", "agentStatus": "IN_PROGRESS", "threadId": "th_01HD44FHDPG82VQ4QNHDR4N2T2", "agent": { "id": "mu_01HD44FHDPG82VQ4QNHDR4N2T3", "publicName": "Support Agent" } }, "approvalId": "agentAppr_01HD44FHDPG82VQ4QNHDR4N2T7", "toolCallId": "call_abc123", "status": "APPROVED", "justification": "Refunding an invoice moves money, so a human should confirm it.", "reviewerNote": null, "resolvedBy": { "actorType": "user", "userId": "u_01HD44FHDPG82VQ4QNHDR4N2T5" }, "resolvedAt": "2026-09-06T12:05:00.000Z" } }Note
Medium Risk
Schema version is a hard gate—customers on older webhook targets break until they align SDK and target. New approval events and agent status semantics need correct handler behavior for custom-agent workflows.
Overview
Bumps
@team-plain/webhooksfrom2026-08-31to2026-09-06. The package only accepts payloads whosewebhookMetadata.webhookTargetVersionmatches that constant, so integrators must upgrade the SDK and move their webhook target forward together orparsePlainWebhookreturnsPlainWebhookVersionMismatchError.Discussion / agent updates:
discussion.message_createdcan include optionalworkspaceFileson the message (file metadata per entry).agentStatusis added onDiscussionfor all discussion events (including the new ones). Optional fields are not defaulted by the parser—handlers should usemessage.workspaceFiles ?? []and treat missingagentStatusasUNKNOWN.New webhook types:
discussion.tool_call_approval_requestedanddiscussion.tool_call_approval_resolved, with exported payload types and JSON schema definitions. The resolved event always includesreviewerNote(nullable); on resolved events,discussion.agentStatusreflects state after the decision (e.g.IN_PROGRESSafter approval).Tests add fixtures for the new events, negative cases that enforce
agentStatusandworkspaceFilesshape, and updated HMAC expectations in verify tests after the version bump in fixtures.Reviewed by Cursor Bugbot for commit 6fbae91. Bugbot is set up for automated code reviews on this repo. Configure here.