Repository navigation
Conversation
The automation editor now creates webhook automations next to schedules. On create, a Trigger radio picks Schedule or Webhook, and a Use radio picks single or multi use. A webhook create sends kind, webhook_use and the target fields and never the schedule fields; switching the trigger moves the when_busy default between skip (schedule) and queue (webhook). Editing a webhook shows the use, when a single-use webhook was used, the publish endpoint with a copy button, and a Rotate secret button that asks for confirmation first. Rotation errors, such as the owner-only 403, show the server message in the editor. After a webhook create or a rotation, a dialog shows the endpoint, the secret and a curl example once. The page holds the secret only in component state and clears it on close. The create and rotate mutations use gcTime 0 and are reset after success, so the secret never stays in a React Query cache or browser storage.
- Keep a user-picked When busy value when the Trigger changes. - Skip blur validation in the editor so a blur error cannot shift the Trigger radios mid-click and swallow the click. - Hide Rotate secret on a consumed single-use webhook. - Keep the secret dialog open on outside clicks, focus Done on open, return focus to the New automation or Rotate secret button on close, and give each copy button a distinct label (new optional CodeExample copyLabel prop). - Show the rotate error next to the Rotate secret button, and clear the save or rotate error when the other action starts so 403 alerts do not stack. Save and Rotate stay enabled for non-owners; the server decides and its 403 is shown.
…r' into tk/codagt-1214b-automations-webhook-editor # Conflicts: # site/src/pages/AgentsPage/AgentAutomationsPage.test.tsx # site/src/pages/AgentsPage/components/Automations/AutomationEditorDialog.tsx
Capture a rotated webhook secret in the mutation-level onSuccess and keep the editor open while a rotation runs, so a reset or close no longer drops the secret. Extract AutomationWebhookFields and RadioOption, move webhookPublishEndpoint next to the query factories, and trim comments. Keep the secret out of the secret dialog's accessible description. Merge and extend the webhook editor tests. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…k editor Capture the created webhook secret in a mutation-level onSuccess like rotate, reset rotate unconditionally when the editor opens, and add a RotatingSecret story. Build the webhook fixture from MockChatAutomation, tighten names, copy and comments, and trim the edit test table. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…r' into tk/codagt-1214b-automations-webhook-editor # Conflicts: # site/src/pages/AgentsPage/AgentAutomationsPage.test.tsx
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13718678c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Hand webhook secrets to the page from inside mutationFn and return a scrubbed result, so no mutation cache event ever carries the secret. Treat schedule and webhook validations as stale once the trigger changes, and keep Rotate secret focusable while a rotation runs so focus does not fall to the body. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
CI note: this push got no |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e517eda64
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Build webhook endpoints from the configured dashboard URL. - Warn before leaving while a webhook create or rotation is in flight, since the one-time secret arrives in that response.
…r' into tk/codagt-1214b-automations-webhook-editor # Conflicts: # site/src/pages/AgentsPage/components/Automations/AutomationEditorDialog.tsx
… fixes - Offer Stay on the leave prompt, like the other unsaved-changes prompts. - Reset a blocked navigation once the reason for the prompt is gone. - Cover the dashboard URL endpoint and the webhook-only leave warning.
|
CI note: this push got no |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b735c29ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
CI note: this push got no |
|
@codex review |
Dogfood UAT evidence (remote Coder Agents UAT, dev deployment with
|
…-1214b-automations-webhook-editor No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
sync with main d11809f: merged #30187
Generated with |
ibetitsmike
left a comment
There was a problem hiding this comment.
Xum re-reviewed this PR on behalf of @ibetitsmike using GPT-6.1 Sol (high) Exec subagents.
The prior clipboard, secret-cache and consumed-webhook fixes remain present, while the acknowledged displayed-secret guard, refetch duration and create-focus gaps stay deferred. New-to-GitHub counts: Standards 1, Spec 0, Frontend 2, with overlap leaving two P3 inline findings and no newly introduced delta finding. The clipboard thread is still GitHub-open but fixed in code. At this head, 34 page tests, TypeScript, 15 Chromium story setups, narrow rotation service/HTTP tests and controlled production-module jsdom probes passed; Pixel snapshots were not compared and the frozen Pixel review remains pending.
|
|
||
| await confirmRotate(user, dialog, "Rotate secret"); | ||
|
|
||
| expect((await within(dialog).findByRole("alert")).textContent).toBe( |
There was a problem hiding this comment.
P3: Keep rotation-alert rendering at the visual boundary
The Standards reviewer noted: "a behavior-preserving change that separates the title and detail with whitespace breaks this exact concatenated DOM-text assertion."
The current 403/409 table still compares alert.textContent with message + detail, although AutomationWebhookFields renders separate title/detail nodes. This couples a request test to markup rather than rotation behavior, contrary to FE1 and TS5. Keep the POST-count and no-secret outcomes, remove this exact rendered-copy assertion, and cover the 409 title/detail state beside the existing RotateSecretForbidden story.
There was a problem hiding this comment.
| automation: { | ||
| ...mockWebhookAutomation, | ||
| webhook_use: "single", | ||
| webhook_consumed_at: "2026-09-30T10:15:00Z", |
There was a problem hiding this comment.
P3: Pin the Used-on date for this visual fixture
The tests-and-stories reviewer noted: "The existing resolvedOptions spy would not control toLocaleDateString's implicit zone."
This timestamp fixes the instant, not the displayed zone. The current production AutomationWebhookFields renderer produces Sep 30, 2026, 10:15:00 AM UTC in UTC and Sep 30, 2026, 03:15:00 AM PDT in Los Angeles, even when resolvedOptions() reports New York. The same fixture therefore changes its visual baseline across hosts without a source change. Pin consumed-date formatting in story setup or a formatter context, keeping production local-zone display unchanged. This is visual-fixture determinism, not a product timezone-default gap or literal TS1 play misuse.
There was a problem hiding this comment.
Fixed in df5f55d: EditUsedSingleUseWebhook now pins toLocaleDateString to the story zone (America/New_York) when the caller passes no timeZone, so the "Used on" time renders the same on every host. Production formatting is unchanged.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
…-1214b-automations-webhook-editor No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
sync with main a328bee: merged #30187
Generated with |
…ons-webhook-editor
…rt in a story The rotate-secret failure test now checks only behavior: an alert appears, one rotate request was sent, and no secret dialog opens. The 409 title and detail moved to a RotateSecretConflict story next to RotateSecretForbidden, so the rendered copy is checked visually instead of through concatenated DOM text. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…date story formatDate renders in the browser's zone, which the resolvedOptions spy does not control, so EditUsedSingleUseWebhook rendered a different "Used on" time on each host. The story now pins toLocaleDateString to the story zone when the caller passes none. Production formatting is unchanged. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
merged #30187; review fixes: the rotate-secret failure test keeps behavior checks and the 409 copy moved to a RotateSecretConflict story; EditUsedSingleUseWebhook pins the used-on date's display zone (Mike's P3s)
Generated with |
…-use webhook Only a single-use webhook can return the "already used" 409, so the RotateSecretConflict story now uses one, modelling an editor that still shows the webhook as unused after the server consumed it. The date pin moved into the only story that uses it. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
self-review follow-up: RotateSecretConflict uses a single-use webhook; the date pin moved into its only story
Generated with |
ibetitsmike
left a comment
There was a problem hiding this comment.
Xum validated this PR and approved it on behalf of @ibetitsmike.
Verified at b642d10d48642eb14260b6e5c25cb0778ad16ebc: exact alert-copy equality is removed while request-count/no-secret outcomes remain; the 409 story now uses a single-use webhook, and the actual native date formatter is pinned only in the consumed story. The original ten-lane review and bounded CD/TN/RP/TS follow-up leave no new own-layer finding. Prior accepted deferrals, policy disagreements, and the inherited #30171 focus issue remain on their existing records. This is not whole-stack approval.
Validation: 34 page tests and 16 actual Chromium story setup tests passed; targeted Biome check/lint, Oxlint, and TypeScript passed. Three actual-story/production-date controls passed in each of UTC and Los Angeles, preserving explicit caller zones and native production formatting. Latest conflict and Used-on screenshots were inspected. Cross-zone proof uses native Intl/jsdom, not two browser timezone captures. No Pixel approval, full local suite, Go rerun, or remote UAT is claimed. Current-head required CI and all observed checks were green at the posting gate.
…-1214b-automations-webhook-editor No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Generated with |
…-1214b-automations-webhook-editor No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Generated with |
…-1214b-automations-webhook-editor No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
merged #30187
Generated with |
…-1214b-automations-webhook-editor Resolved the import conflict in AgentAutomationsPage.tsx: kept this layer's AutomationWebhookSecretDialog import and took #30171's automationsFlag import, and read buildInfo from the same useDashboard call that #30171 moved into AutomationsList. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
Merged #30187; resolved AgentAutomationsPage.tsx imports and read buildInfo from the same useDashboard call.
Generated with |
…ons-webhook-editor
ibetitsmike
left a comment
There was a problem hiding this comment.
Xum validated this PR and approved it on behalf of @ibetitsmike.
Re-reviewed the exact introducing-layer source and inherited changes against the original Standards/Spec/frontend records and accepted deferrals.
Validation: 36 maintained unit cases, 16 actual Chromium Storybook cases, HTTP/publication contracts and consumed-rotation service guards, authored Biome/Oxlint and whole TypeScript.
This approval covers this PR's own scope, not whole-stack merge readiness. #30167 and #30171 test-contract findings and #30220 documentation wording remain held at their introducing layers. No fresh Pixel, remote UAT or full-suite run is claimed.
…ons-webhook-editor
…ons-webhook-editor
…ons-webhook-editor
…ons-webhook-editor Brings main ff158c0 into this layer. No conflicts. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…ons-webhook-editor Brings the new_chat automation title source fix from #30134. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_







Closes CODAGT-1214
Part of CODAGT-1135
Adds webhook automations to the Agents automation editor. This finishes the webhook half of CODAGT-1214; the schedule half is #30187.
What changes
kind: "webhook",webhook_use, and the shared and target fields, and never schedule fields. When busy defaults to Queue for webhooks and Skip for schedules, unless the user picked a value.curlexample, with "You will not see this secret again." The secret lives only in page component state while the dialog is open. The mutation functions hand the secret to page state and return the response without it, so it never reaches a React Query cache, the mutation cache, browser storage, the URL, or logs. Outside clicks do not close the dialog; Done and Escape do.RotateAutomationSecretin chatd now refuses it inside its locked transaction with the existingErrAutomationWebhookConsumed, and the rotate endpoint returns 409 ("This single-use webhook was already used."). The editor shows that error and no secret. No SQL, migration, or dbauthz changes; the swagger failure codes for the rotate endpoint are regenerated.Not in this release (per the RFC): the Workspace field, the Tools list, target locking. The client never evaluates cron.
Implementation notes
rotateChatAutomationSecretAPI method and mutation factory. The create and rotate factories take anonWebhookSecretcallback and stripwebhook_secretfrom the result.webhookPublishEndpointbuilds{origin}/api/experimental/chat-automations/{id}/eventsfrom the configured dashboard URL.useUnsavedChangesPrompt(browser prompt on reload, Leave/Stay dialog on in-app navigation). The hook now also clears a blocked navigation once its reason is gone.AutomationWebhookFields,AutomationWebhookSecretDialog, and a smallRadioOptionshared by the three radio groups in the editor.CodeExamplegains an optionalcopyLabelso the copy buttons have distinct names.validateOnBlur: falsein the editor: dogfood found that a blur error shifted the Trigger radios between pointerdown and pointerup, which swallowed the click.Validation
TestRotateAutomationSecret(unused single-use and multi-use rotate; a used one returns the error with the hash and version unchanged and no plaintext; a consume holding the row lock makes a concurrent rotate fail after commit) and the handler's 409 case.AgentAutomationsPage.test.tsx): webhook create body shape and default use, the secret gone from the document, every query cache entry, and local/session storage after the dialog closes; rotate confirm, cancel (no request), 403 message, and no close mid-rotation; trigger switch body shape and When busy default; webhook edit body.tsc,pnpm lint, Biome, and the pre-commit hook pass. Frontend self-review (coder-frontend-review, 8 roles, plus FE1 to FE10) ran twice; blocking and should-fix findings are fixed.curlwith the secret gets 202 and a wrong token 401; rotate shows a new secret once, the old one gets 401 and the new one 202; a single-use webhook accepts one event (second delivery 409) and shows Used; an org admin rotating the owner's webhook sees the 403; endpoints use the configured dashboard URL; leaving mid-request is guarded; the editor scrolls at 1280x720.Known deviations
AutomationEditorDialog; have the open editor read the automation from the list query so "Used" and Rotate follow refetches; the otheruseUnsavedChangesPromptforms share the prompt's focus gap; Tab wrapping from Save to Name does not scroll the form back up (11a form, found in UAT round 3).Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high