Repository navigation
Conversation
…ilter GET /api/v2/chats accepts an automation_id query parameter. It returns the chats the automation created (chats.automation_id) and the chats it sent messages to (chat_messages.automation_id). Chat authorization is unchanged. The chat list is not experiment-gated, so the parameter is ignored unless the chat-automations experiment is on for the caller. codersdk.ListChatsOptions gains AutomationID. /agents/automations lists the automations of the organization selected in the Agents organization picker: name, the creating chat for agent-created automations, trigger and cadence, target chat (a missing or archived target is marked), the server's next run, an enabled switch, Run now, and a dialog with the automation's chats. Run now failures such as 409 and 429 show the server message in an alert. The page and its sidebar entry are hidden unless the chat-automations experiment is on for the viewer.
…picker The org-selection test only proved the page reads the stored Agents picker choice. Extend it to switch the picker and assert that the page refetches automations for the new organization and writes the choice back to the shared localStorage key the create form reads.
- Evaluate the experiment only when the chat list has an automation_id filter, and ignore a malformed id when the experiment is off. - Do not count deleted automation messages as writing to a chat. - Offer Run now only to the owner, and disable it for a missing target. - Fix the empty-state copy and the Run now success toast.
- Look up the target chat in the row, so an archived or deleted target also disables Run now, and show a deleted creating chat as such. - Use queryOptions for the automation chats query and name the props types of the new components. - Prefix story and test fixtures with mock, wire story queries inline, add a chats dialog story, and drop comments that restate the code.
|
@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. |
…labels' into tk/codagt-1213-automations-list-page
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f2ee30d8f
ℹ️ 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".
- Reject the nil UUID as an automation_id filter; the query uses it as "no filter". - Page the View chats dialog with Load more instead of a fixed 25. - Look up chat titles only for the viewer's own automations, which bounds the requests and avoids a false missing target for other owners. - Keep the enabled switch off for non-owners of a disabled automation, and disable every Run now while a run request is pending. - Refetch the list every minute so the next run stays current, and refresh the chat lists after a run. - Show the page full width on mobile with a back link, like settings.
…labels' into tk/codagt-1213-automations-list-page
|
@codex review |
|
CI note: the The previous head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43fa1a5f23
ℹ️ 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".
- Offer View chats only for the viewer's own automations, since the chat list is scoped to the viewer's chats by default. - Keep the loaded table when a background refetch fails, and keep loaded chats and Load more when a later page fails. - Name the Run now and View chats buttons after their automation.
|
@codex review |
|
CI note: the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a307cbc190
ℹ️ 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".
- Add a mobile header link to Automations, since the sidebar nav is hidden on mobile, with a mobile story. - Show a chat title lookup failure instead of an Untitled link. - Assert the Run now request in the 409 and 429 tests.
|
@codex review |
|
CI note: the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b37e9d99d0
ℹ️ 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".
|
Readiness record for head
|
|
CI on the current head: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 991f9691fc
ℹ️ 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".
| API.experimental.getChats( | ||
| { | ||
| automation_id: automationId, | ||
| limit: automationChatsPageSize, | ||
| offset: pageParam, | ||
| }, |
There was a problem hiding this comment.
Include archived chats in automation history
When a chat created by or written to by an automation is later archived, this request silently omits it because it supplies no q override and searchquery.Chats defaults Archived to false. The dialog describes itself as the automation's chat history and archived chats remain openable, so archiving a chat currently makes that history entry disappear. Make this history query include both active and archived matches, or explicitly expose an active-only filter.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 356447f. The chat search syntax only had archived:true and archived:false, so the dialog could not ask for both. searchquery.Chats now accepts archived:any, which leaves the archived filter null so archived and active chats both match. The automation history query sends q: "archived:any". Omitting the term still hides archived chats, and the owner scope is unchanged.
Tests: TestSearchChats and TestSearchChatsFrontendEmitted cover the new value, TestListChats/AutomationFilter checks that an archived automation chat is returned with archived:any and archived:true and hidden by default, and the AgentAutomationsPage request assertions include q=archived%3Aany (they fail without the frontend change).
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
The automation chats dialog listed only active chats, because the chat list hides archived chats unless the query sets archived. A chat the automation created or wrote to dropped out of its history once archived. The chat search query now accepts archived:any, which matches archived and active chats. archived:true and archived:false still filter to one side, and omitting the term still hides archived chats. The automation history query sends archived:any. The owner scope is unchanged. Addresses Codex review on #30171. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
Fixed the Codex P2 on automation chat history: the chat search query accepts archived:any (archived and active chats), and the automation chats dialog requests it. Go tests cover parsing and the API returning archived automation chats; the Vitest request assertions fail without the frontend change.
Generated with |
|
@codex review |
Documentation CheckUpdates Needed
Automated review via Coder Agents |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
…review nits Return focus to the View chats button when the automation chats dialog closes, since it has no DialogTrigger, with a keyboard test. Move AUTOMATIONS_PATH and useAutomationsEnabled into automationsFlag.ts, let AutomationsList read useDashboard itself, and reuse ChatTitleLink in the dialog. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
archived:any matches archived and active conversations; omitting the term still hides archived ones. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…d focus test Describe automationsFlag.ts as holding both the page route and the experiment flag, and let the focus-return test wait only for the focus it asserts. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…odagt-1213-automations-list-page No conflicts. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…agt-1214-automations-editor Resolved the conflict in AgentAutomationsPage.tsx: kept this layer's AutomationEditorDialog import and EditorState type, and took #30171's automationsFlag import and the useDashboard call inside AutomationsList (no threaded organization props). --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…-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`_
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
…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`_
|
Review fixes: the automation chats dialog returns focus to the View chats button on close (with a test); AutomationsList calls useDashboard itself; AUTOMATIONS_PATH and useAutomationsEnabled moved to automationsFlag.ts; the dialog reuses ChatTitleLink; chat-search-syntax.md documents archived:any. Merged #30167.
Generated with |
|
Review follow-ups in head 4b2a0af:
Generated with |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b2a0afffc
ℹ️ 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".
| </TableCell> | ||
| <TableCell> | ||
| <Switch | ||
| checked={automation.enabled} |
There was a problem hiding this comment.
Do not show consumed webhooks as enabled
After a single-use webhook succeeds, ConsumeChatAutomationWebhookByID sets only webhook_consumed_at and leaves enabled true, while checkAutomationInput rejects every subsequent delivery with ErrAutomationWebhookConsumed. This switch therefore remains checked under Enabled for a permanently spent automation, and after turning it off the owner can turn it back on without making it usable. Treat webhook_consumed_at as a terminal unavailable state in this control rather than reflecting enabled alone.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2b91eb8: a used single-use webhook (webhook_consumed_at set) now renders the enabled switch as off and disabled, so it can no longer be toggled back on. The existing "Used" label stays. Test: AgentAutomationsPage.test.tsx "shows a used single-use webhook as off and locks its switch" (fails without the fix).
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
A single-use webhook that has been used rejects every later delivery, but the list's enabled switch kept reflecting only the enabled flag. The switch now shows such automations as off and cannot be changed. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
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 original View chats focus-restoration finding is fixed and validated by the unchanged maintained keyboard test, including a scratch production-wiring removal that reproduces focus loss. One new own-layer test-contract finding remains below. Inherited #30167 findings are not new findings against this layer. No approval is given while the new finding remains.
| const toggle = await screen.findByRole("switch", { | ||
| name: `Enable ${mockAutomation.name}`, | ||
| }); | ||
| expect(toggle).not.toBeChecked(); |
There was a problem hiding this comment.
P3: Consumed-switch test asserts only rendered state (FE1, TS2, TS5)
This new test only locates the switch and asserts not.toBeChecked() and toBeDisabled(). It never drives an interaction or checks a callback/API outcome. The frontend contract assigns rendered switch state to Storybook/Pixel and requires Vitest behavior tests to assert the non-visual outcome.
Keep the consumed-webhook story for the off/disabled appearance. If a behavior regression test is needed, attempt the switch interaction and assert that no PATCH request is sent; otherwise remove this state-only unit test.
There was a problem hiding this comment.
Fixed in 52959fb. The render-only test is replaced by a behavior test, "does not update a used single-use webhook from its switch". It clicks the used webhook's switch, then a second row's switch, waits for the second row's PATCH, and asserts that only the second row was updated. The second row's request is sent after the first click, so its arrival bounds any update the first click could have sent. With the AutomationRow fix reverted, the test fails (both rows get a PATCH). The consumed-webhook story still covers the off and disabled appearance.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
…no update The consumed-webhook test asserted only the rendered switch state, which the Storybook story already covers. It now clicks the used webhook's switch, then another row's, and checks that only the second row is updated. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
ibetitsmike
left a comment
There was a problem hiding this comment.
Xum validated this PR and approved it on behalf of @ibetitsmike.
Approved at 52959fbe12b862e300eee851256dd154ee0aff58 after independent Sol-high Standards and Spec review, complete frontend checkpoint adjudication, and fresh exact-head validation. Accepted deferrals remain unchanged.
The consumed-webhook test finding is fixed: real switch interactions now assert PATCH request IDs instead of checked/disabled DOM state. The maintained test passes, fails with the extra consumed-row PATCH when only the production consumed-switch disable guard is removed, and passes after restoration. Fixtures, assertions and effective-off mapping remain unchanged.
Validation: 9 maintained page unit cases, 74 Chromium story cases, two uncached Go groups covering automation and association-history HTTP/parser contracts, Biome, Oxlint and TypeScript all passed. The fresh unit run includes actual-opener Enter/Escape focus restoration; the earlier production-wiring negative control carries through identical relevant source.
Exact head, base, PR body, GitHub diff, all observed CI checks and review state were checked immediately before this review. Lower #30167's separate test-contract hold and #30220's documentation wording hold remain outstanding. No full-suite, Pixel or remote-UAT clearance is claimed.
…mations-list-page
…mations-list-page
…mations-list-page Brings main ff158c0 into this layer. No conflicts. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…mations-list-page 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-1213. Part of CODAGT-1135 (Automations for Coder Agents, RFC step 7).
Adds an Automations list to the Agents UI and an
automation_idfilter on the chat list, so users can see their automations and find the chats an automation created or wrote to.Changes
GET /api/v2/chats?automation_id=<uuid>returns root chats whosechats.automation_idmatches (chats the automation created) and chats with a non-deleted message whosechat_messages.automation_idmatches (chats it wrote to). The nil UUID is rejected, because the query uses it as "no filter". It is honored only when thechat-automationsexperiment is on for the caller; otherwise it is ignored, as the RFC says, and the evaluator runs only when the parameter is present. Chat authorization is unchanged. Swagger documents the parameter, andcodersdk.ListChatsOptionsgainsAutomationID. The existing partial indexes back the filter./agents/automations, with an Automations sidebar entry. Both are hidden when the experiment is off for the viewer (per-user experiment list). The page lists the automations of the organization selected in the Agents organization picker; it shares the stored selection with the new-chat form and has its own picker. Columns: name (with the creating chat for agent-created automations), trigger (cron and time zone, or webhook single or multi use), target (chat link, "New chat each run", or a Missing target badge for a deleted or archived target), next run from the server'snext_run_times, an enabled switch (PATCH; a non-owner cannot re-enable), Run now (owner only, schedules only, disabled for a missing target and while another run is pending), and View chats (owner only; a paged dialog backed by the new filter). Chat titles are looked up only for the viewer's own automations. The list refetches every minute so the next run stays current. On mobile, the chats header links to the page, which opens full width with a back link. A Run now failure, such as409for a busy chat with skip or429for a full queue or share, shows the server message in an alert above the table.manage_automationstool is not in this stack yet.Validation
TestListChats/AutomationFiltercovers:400), and the nil UUID (400);AgentAutomationsPage.test.tsx), all asserting requests:PATCH {enabled:false};409or429;?automation_id=, and Load more requests the next page;WithAutomations,OtherOwner,Empty,MissingTarget,RunNowError,ChatsDialog,ChatsDialogLoadMoreError,Loading,RefetchError,ListError, andChatsSidebar/MobileWithAutomations.fa60a15767) and round 2 on the current headb37e9d99d0. Round 2 repeated every criterion and verified the review fixes. Screenshots are in the comments below.coder-frontend-reviewself-review: every role passes after fixes on each update, except two items:cirun 36703512580, started with workflow_dispatch, is green on the current headb37e9d99d0. Pushes to existing stacked PRs did not start the pull_requestcirun (noted in the comments). The earlier head8f2ee30d8fwas green through a normal pull_request run.Size: about 1,370 hand-written lines (about 560 of them tests and stories), plus generated code. This is over the 1,000-line guideline, mostly from review fixes.
Stack
Stacked on #30085, #30096, #30112, #30117, #30127, #30134, #30160, #30166 and #30167 (CODAGT-1215). Base:
tk/codagt-1215-automations-chat-labels, merged in (not rebased). Follow-ups: CODAGT-1244, CODAGT-1246.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high