Repository navigation
feat: add the manage automations toggle, tool rendering and CODAGT-1217 tests - #30219
Conversation
Adds a "Manage automations" item to the composer's More options menu. It shows when the chat-automations experiment is on, for new chats and for root chats the viewer owns. Existing chats update through an optimistic PATCH with rollback and an error toast; new chats send manage_automations_enabled only when the toggle is on. The manage_automations tool now renders with a friendly label and icon, and successful write actions invalidate the automation queries (run_now also refreshes chat lists). "Plan first" and the new item share a small checkbox menu item component.
…ations toggle on new chats The new-chat composer gates the Manage automations toggle on the chat-automations experiment, but only the enabled path had a test.
…tions toggle - Always send manage_automations_enabled on create; the form gates the value on the chat-automations experiment. - Make isError, disabled and manageAutomationsEnabled props required. - Read tool call args through a useEffectEvent accessor. - Share the optimistic single-field chat update between plan mode and manage automations. - Inline single-use values, merge the label helper into its component, and drop comments that restate names.
…-1212c-automations-tool-toggle
…ations toggle as is The toggle is only reachable while the chat-automations experiment is on and starts off, so the extra experiment check on submit could not change the sent value.
|
@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: cd4c7cd856
ℹ️ 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".
…manage_automations action from the durable tool call The server persists the assistant tool-call message before its tools run and the live stream state resets, so a streamed manage_automations result usually has no live call. Fall back to the durable message to find the action, so automation and chat list invalidations still run.
|
Head is now ddd2741 (fix for the Codex r1 P2: read the manage_automations action from the durable tool call). Full pre-push hook passed. CI dispatched on the exact head: https://github.com/coder/coder/actions/runs/36800736193 (headSha ddd2741). |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…n owner Adds the remaining CODAGT-1217 acceptance tests: an input queued while the chat was busy still runs after the owner's experiment is turned off, a refused event creates no messages, queued inputs or chats, and a refused delivery leaves a single-use webhook unused, so the same secret delivers once after the experiment is back on.
|
Head is now c217ed6: adds the remaining CODAGT-1217 acceptance tests (tests only, see the PR description). Full pre-push hook passed. CI dispatched on the exact head: https://github.com/coder/coder/actions/runs/36803364859 (headSha c217ed6). |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c217ed6392
ℹ️ 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".
…s action like the server The server trims the action before running it, so an action with surrounding whitespace is still a write. Trim it before classifying the result and before picking the label.
|
Head is now 206fc30 (fix for the Codex r3 P2: trim the manage_automations action like the server). Full pre-push hook passed. CI dispatched on the exact head: https://github.com/coder/coder/actions/runs/36804131763 (headSha 206fc30). |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 206fc307c7
ℹ️ 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".
…e the experiment turns off The experiments query refetches while the create form stays mounted, so the chat-automations experiment can turn off after the user enabled the toggle; the server then rejects the create request. Restore the experiment check on submit and make the test cover that case.
|
Head is now 6801a1e (Codex r4: restored the experiment check on the create request; the other thread is answered as out of scope). Full pre-push hook passed. CI dispatched on the exact head: https://github.com/coder/coder/actions/runs/36805119781 (headSha 6801a1e). |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
sync with main 35abc22: merged #30217 to pick up 64cc207 (test-only); main not merged this pass
Generated with |
…codagt-1212c-automations-tool-toggle 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 #30217
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.
Durable-call lookup, action trimming and the mounted-create experiment gate remain fixed after the restack. New findings: Standards 2, Spec 1, Frontend 2, overlapping into two inline findings: a P2 label-rendering crash and a P3 shared-fixture violation. Accepted menu/rollback and experiment-off scope remains unchanged, with no duplicate prior comments. Fresh validation passed two toggle-mutation unit tests, actual API/Axios transport controls and selected queued-input/webhook Go tests. The actual current label renderer reproduced nine failures with passing own-property controls. Full frontend/typecheck passes remain previous-pin evidence; browser, Pixel and UAT were not rerun.
| isError, | ||
| }) => { | ||
| const parsed = parseArgs(args); | ||
| const labels = manageAutomationsLabels[asString(parsed?.action).trim()]; |
There was a problem hiding this comment.
[P2] Restrict action-label lookup to own properties
Standards reviewer: "The normal object lookup accepts inherited keys." Here constructor, toString or __proto__ yields a truthy non-tuple, so line 95 throws TypeError: labels is not iterable, including for a failed or durable JSON call. Actual CURRENT React rendering reproduces all nine cases while ordinary unknown actions fall back correctly: the UI cannot show the rejected call or its promised fallback. Guard with Object.hasOwn or use a Map before destructuring, and add a prototype-action renderer regression.
There was a problem hiding this comment.
Fixed in ec194bf: the label lookup now uses Object.hasOwn, so inherited keys fall back to "Manage automations" like any unknown action. A new Tool.test.tsx case renders constructor, toString, __proto__ and hasOwnProperty (plus a plain unknown action) as failed calls; without the fix the four prototype cases throw labels is not iterable.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
| const { toolResults } = createStreamState("manage_automations"); | ||
|
|
||
| await act(async () => { | ||
| store.upsertDurableMessage({ |
There was a problem hiding this comment.
[P3] Reuse the shared message fixture
Standards reviewer: "This new full literal duplicates the defaults outside their shared owner; updates to that fixture cannot reach this case." FE9 requires shared entity fixtures (FRONTEND_PATTERNS.md:248-250), and testHelpers/chatEntities.ts:121-127 already owns MockChatMessage with these ID/chat/timestamp defaults. Spread it and override role and content, preserving the valuable no-live-call regression without separately maintained entity defaults.
…codagt-1212c-automations-tool-toggle 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 #30217
Generated with |
…tomations-tool-toggle
…anage_automations calls The tool label looked up the model-supplied action on a plain object, so an action such as "constructor" or "__proto__" returned an inherited value and destructuring it threw "labels is not iterable", crashing the row. The lookup now accepts only own keys, so these actions fall back to the generic "Manage automations" label like any other unknown action. A Tool test renders prototype-named actions and fails without the fix. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
… message from MockChatMessage The durable tool-call test now spreads the shared MockChatMessage fixture and overrides only role and content, instead of repeating its ID, chat and timestamp defaults. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
merged #30217; review fixes: manage_automations labels ignore inherited keys such as constructor/proto (with a Tool regression test), and the durable tool-call test reuses MockChatMessage (Mike's P2 and P3)
Generated with |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
ibetitsmike
left a comment
There was a problem hiding this comment.
Xum validated this PR and approved it on behalf of @ibetitsmike.
Verified at 447c892ff6d01715a4ff04eb312c96ad1d798168: own-property lookup prevents inherited action keys from becoming label tuples; the authored five-case Tool regression is present; and the durable invalidation test now reuses MockChatMessage while preserving its no-live-call case. Bounded affected frontend/Standards/Spec checks reconcile with the complete prior audit; accepted menu, rollback, parser, extraction and hidden-toggle deferrals remain unchanged. This is not whole-stack approval.
Validation: 52 tests across four existing files passed; targeted Biome check/lint, Oxlint and TypeScript passed. The maintained regression fails four prototype cases with the exact old-source overlay and passes all five on current source. An independent actual-production renderer probe converts nine old TypeErrors into nine generic fallbacks while preserving known-action and ordinary-unknown controls. No browser/full-chat, Pixel, Go, full local suite or remote UAT claim. Current-head required CI and all observed checks were green at posting.
…codagt-1212c-automations-tool-toggle 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 |
…codagt-1212c-automations-tool-toggle 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 |
…codagt-1212c-automations-tool-toggle No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
merged #30217
Generated with |
…codagt-1212c-automations-tool-toggle No conflicts. Pointed the useAutomationsEnabled imports this layer adds in AgentChatPage.tsx and AgentCreateForm.tsx at automationsFlag.ts, where #30171 moved the hook. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
Merged #30217; pointed this layer's useAutomationsEnabled imports at automationsFlag.ts.
Generated with |
…tomations-tool-toggle
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: 302 maintained unit cases, 219 actual Chromium Storybook cases, persisted switch and queued-input-after-experiment-off contracts, 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.
…tomations-tool-toggle
…tomations-tool-toggle
…tomations-tool-toggle
…tomations-tool-toggle Brings main ff158c0 into this layer. No conflicts. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Adds the "Manage automations" toggle to the composer's tools menu, so the interim
manage_automations_enabledswitch can be set from the UI, and gives themanage_automationstool a readable rendering.Closes CODAGT-1212 (slice 12c of 3). Part of CODAGT-1135.
What changes
chat-automationsexperiment is on for the viewer. Existing chats update through an optimistic PATCH (updateChatManageAutomations) with rollback and an error toast; new chats sendmanage_automations_enabledin the create request. The optimistic single-field update is shared withupdateChatPlanMode.manage_automationscalls get a label and icon that name the action (for example "Created automation ..."), with the generic fallback for unknown actions.run_nowalso refreshes chat lists.CODAGT-1217 acceptance tests
Adds the remaining CODAGT-1217 acceptance tests (tests only; no bug found):
TestAutomationQueuedInputRunsAfterExperimentOff(chatd): a webhook input queued into a busy chat still runs after a stored rule turns the experiment off for the owner (no restart); new inputs are refused.TestChatAutomationEvents/ExperimentOffForOwnernow also asserts that refused events for an existing-chat and a new-chat webhook create no messages, queued inputs or chats.TestChatAutomationEvents/SingleUseExperimentOff: with the owner's experiment off, a single-use webhook delivery is refused (404) andwebhook_consumed_atstays NULL; after the rule is back to inherit, the same secret delivers once and then gets 409.Validation
make pre-pushpassed before push.coder-frontend-review(8 roles) and the projectfrontend-review(FE1 to FE10) ran before this PR; all blocking and should-fix findings were fixed. A secondcoder-frontend-reviewpass (8 roles) on the final slice, after the Codex fixes, raised comment, type and readability items; the should-fix ones were fixed in c6e503a. Still open, with reasons: SD7/RO4 as above; SA6 as above; DF6 (the optimistic helper restores the whole entity snapshot on error, like every other chat mutation inchats.ts); RO3 (the manage_automations action names appear in both the invalidation hook and the label table; a shared parser is a follow-up refactor). Remaining, with reasons: SA6 (the + menu'smenuitemcheckboxitems sit in a popover without menu semantics; this follows the existing "Plan first" item), CD2 (story banner matches the file's convention), RO4/SD7 (thecanToggleManageAutomationsutil stays so the owner, sub-agent and experiment rule keeps a unit test;AgentChatPagehas no test harness), RP6 (splitting the chat-settings mutations out ofAgentChatPageis a separate refactor).375048cdfe(before the self-review fixes, which changed no user-visible behavior except that the create request now always carries the field): turning the toggle on for a new chat creates it with the switch on and the tool in use; toggling an existing chat off and on changes whether the tool is offered; the toggle is hidden for non-owners, sub-agent chats, and with the experiment off; a PATCH failure shows a toast and rolls back.Stack
On top of slice 12b (write actions). Last PR of CODAGT-1212.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high