Repository navigation
chore: merge upstream coder/coder 99fb0da864 - #124
Conversation
These are the default behaviour across Tailwind (and well, CSS). It is probably over verbose.
…tion avatar in project details (coder#31872) Shows avatars next to the names in the **Project owner** and **Organization** rows of a project's Details panel, and switches the Details values (owner, created date, organization, skills) from mono to the standard sans font. Fixes DES-22249 - `ProjectDetailsPanelView` takes a new `organizationIconUrl` prop and renders `Avatar size="xs"` before the name. An empty icon falls back to the name's initial. When the organization can't be found (the "Unknown" case), no avatar is shown. - The owner's avatar comes from the current user ("You") or the ACL owner, and falls back to their initials. No avatar is shown while the owner loads or when it's unknown. Both rows share one small `AvatarValue` component. - Long owner and organization names stay on one line with an ellipsis, and the full name shows on hover (`title`). The ellipsis is applied to the text itself, not the whole value cell, so the focus rings on the Created and Skills buttons don't get clipped. - Stories: `WithOrganization` and `LongNames` now include an icon, and `WithOrganizationNoIcon` covers the fallback. The owner stories pass `ownerAvatar` (a photo for "You", initials for other owners, none for unknown or loading). <details> <summary>Verification</summary> - `biome check`, `tsc --noEmit`, and `ProjectDetailsPanel.test.tsx` (21 tests) pass. - Checked in Storybook with DOM measurements: every row is a single 24px line, long names truncate, and the 18px avatar is vertically centered, and the font is Geist. - Ran the `frontend-deep-review` checkpoints. The only finding was a restating story comment, which is removed. </details> > Generated by Coder Agents on behalf of @tracyjohnsonux.
…0073) Queued chat messages now store a delivery mode. Later in this stack, `steer` messages go in before the next model call instead of at turn end, so chatd needs to know which queued rows are steer rows. The migration adds the enum `chat_busy_behavior` (`queue`, `steer`) and the column `chat_queued_messages.busy_behavior`. It's `NOT NULL DEFAULT 'queue'`, so existing rows get `queue`, and chatstate still passes `queue` on every insert for now, so this doesn't change behaviour. The old `InsertChatQueuedMessage` query doesn't set the column and just gets the default, but only tests use it. There's no `interrupt` value on purpose. An interrupt isn't a delivery mode, it's something that happens to the chat, and coder#31174 stops the API accepting it as a busy behaviour. This supersedes coder#29783. Part of CODAGT-1140
…der#31153) `FinishTurn`, `FinishInterruption` and a send to an errored chat with a queue each had their own code for moving a queued message into history. They now share `deliverQueuedRows`, which takes a list of queued rows, so the next PR can deliver the whole steer lane at once instead of just the queue head. Delivery still only takes the queue head here, so this doesn't change behaviour. `PromotedMessages` on the turn and interruption results is now a slice to match. "Send now" on an errored chat, or one waiting on tool results, still has its own copy of that code in `PromoteQueuedMessage` for now. coder#31156 replaces it with a move into the steer lane, which then goes through `deliverQueuedRows` like everything else. I've also deleted `GetChatQueuedMessagesByPosition` and `GetChatQueuedMessageHead`, as `GetChatQueuedMessages` already returns the queue in delivery order. Part of CODAGT-1140
As suggested on coder#30074, steer messages are now their own lane, rather than queue rows that jump ahead with a lower position. chatstate uses a queued message's `busy_behavior` as its lane, and the steer lane always goes first. `GetChatQueuedMessages` lists the steer lane first, so the queue is shown in the order it'll actually be delivered. At turn end, when an interruption finishes, and on a send to an errored chat, the whole steer lane goes in. If there aren't any steer messages, the queue head goes in like it does today. So with a queue of `Q1 S1 Q2 S2`, turn end delivers `S1 S2`, and `Q1` waits for the next turn end. chatstate accepts `steer` here, but nothing sends it yet, so users won't see a change. Until later in the stack, a few things still ignore the steer lane: - An interrupt send goes to the head of the queue lane, so it waits behind any steer messages. coder#31155 moves it to the end of the steer lane. - "Send now" on a running or interrupting chat only moves the message to the head of its own lane, so when the interruption finishes, the steer lane goes in instead of it. - "Send now" on an errored chat, or one waiting on tool results, puts the message into history straight away, ahead of any queued steer messages. coder#31156 fixes both "Send now" cases by making it steer. None of these can happen yet, as there are no steer messages to get in the way. I've added a "Queued message lanes" section to the chatd architecture doc. Most of the diff is new cases in the transition matrix tests. Since the first review, lane rule 3 in the architecture doc also says that delivery stops at a message under edit, and which model and reasoning effort a batch of delivered messages uses. Part of CODAGT-1140
…oder#30074) This is where the steer lane gets delivered mid-turn. Before each assistant model call, the generation task now runs `DeliverSteerMessages`. If there are steer messages queued, they go into history and the task returns without calling the model, and the history change starts a new generation task that sends them to the model. It never cancels anything, it just waits for the in-flight call and that step's tool calls to finish. Queue messages still wait for turn end, and compaction calls don't deliver steer messages, as they don't answer the user. A delivered steer message is a new prompt, so tracing treats it like any other newer prompt: a new `chat_turn` span starts at it, and the span before it ends as `abandoned`. `chatd.SendMessage` now accepts `steer`, but the HTTP handler and `message_agent` still only pass `queue` or `interrupt`, so the API doesn't change in this PR. coder#31174 makes `steer` the API default. Outside of tests, nothing creates steer messages until coder#31155 stores interrupt sends in the steer lane, so this PR doesn't change behaviour for users on its own. I've split the earlier version of this PR up, so some of the review comments are now addressed elsewhere in the stack. coder#31153 moves queue delivery into one helper, coder#31154 adds the two lanes, coder#31155 stores interrupt sends in the steer lane, and coder#31156 makes "Send now" steer, which also fixes two presses being delivered in reverse order. This supersedes coder#29784. Since the first review, a steer message delivered before a model call also records `queue_wait`, like the other delivery points. Part of CODAGT-1140
An interrupt send to a running or interrupting chat now goes to the end of the steer lane, and the whole steer lane goes in once the interruption finishes. Before, it went to the head of the queue lane if it started the interruption, or the tail if the chat was already interrupting, and only the head went in. So if you sent two messages with interrupt whilst the agent was stopping, the second one went to the back of the queue. Now both go in once it stops, in the order you sent them. Interrupt is still a send option here, it just means "interrupt, then steer" now. coder#31174 removes it from the API and coder#31175 from `message_agent`, so you call the interrupt endpoint first, then send. There's one gap until coder#31156. "Send now" still only moves a message to the head of its own lane, so if you send with interrupt and then press "Send now" on a queued message before the agent stops, only the steer lane goes in when it stops, and the "Send now" message waits for the next turn end. coder#31156 makes "Send now" steer too, so both go in. The `codersdk` change is just the doc comment on `ChatBusyBehaviorInterrupt`. Part of CODAGT-1140
"Send now" on a queued message (`POST
/api/v2/chats/{chat}/queue/{queuedMessage}/promote`) now just moves it
to the end of the steer lane. It never interrupts the chat, so it can't
cancel the step that would have answered it. The endpoint's request
doesn't change. Before, it moved the message to the head of the queue
with `MIN(position) - 1`, so if you pressed "Send now" on two messages,
the second one went first. With a queue of `Q1 Q2 Q3 S4`, "Send now" on
`Q1` then `Q3` now delivers `S4 Q1 Q3`, and `Q2` keeps waiting.
If the chat has errored or is paused, the steer lane goes in straight
away, like a send. Otherwise it goes in at the next delivery point:
before the next model call, when the turn ends, or when an interrupt
finishes. Stop is the only thing that interrupts.
"Send now" and "Remove" on a message that's already been delivered now
return a 404 instead of a 409, the same as editing one, and "Remove" on
an archived chat returns a 400.
In chatstate, `SteerQueuedMessage` replaces `PromoteQueuedMessage`. It
moves the message to the end of the steer lane, and on an errored or
paused chat it also delivers the steer lane and resumes the chat, like a
send does. The `SteerChatQueuedMessage` query sets `position =
nextval(...)` and replaces `ReorderChatQueuedMessageToHead`. Most of the
diff is tests.
coder#31174 then makes `steer` the API default and removes `interrupt` as a
busy behaviour, coder#31175 makes `message_agent` always steer, and coder#31173
updates the site.
Part of CODAGT-1140
…ehavior (coder#31174) Breaking API Change for changelog: > `POST /api/v2/chats/{chat}/messages` now steers by default. If the chat is busy, the message is delivered before the agent's next model call, instead of after the turn ends. `busy_behavior` accepts `steer` or `queue`, and `interrupt` now returns a 400. To redirect the agent, just send a message, and only call `POST /api/v2/chats/{chat}/interrupt` to stop it. Queued messages now include their `busy_behavior`. This is where steering becomes the default for API clients. A send without a `busy_behavior` used to wait for the turn to end, and now it goes in the steer lane, so the agent sees it before its next model call and keeps going. `queue` still waits for the turn to end. Interrupt isn't a busy behaviour any more. Since coder#31155 it just meant "interrupt, then steer", so the API now returns a 400 for it, and `codersdk.ChatBusyBehaviorInterrupt` is gone. `coder_send_chat_message` in the MCP server gets the same default and enum. A steer message already corrects a busy agent, and combining it with an interrupt goes wrong in either order, so the docs and the MCP tool descriptions now say to send a message to redirect the agent, and to interrupt only to stop it. Queued messages now report their `busy_behavior`, and the queue lists the steer lane first, so clients can show which messages go in at the next step and which wait for the turn to end. A message moved with Send now reports `steer`. The site doesn't send a `busy_behavior`, so its sends start steering with this PR, but its queue UI doesn't know about the steer lane until coder#31173. chatd still accepts `interrupt` internally, as `message_agent` uses it, and coder#31175 removes both. Part of CODAGT-1140
`message_agent` no longer takes an `interrupt` flag, and always steers. If the child is busy, it gets the message before its next model call and keeps working. To correct or redirect a busy child, the parent just calls `message_agent`, and `interrupt_agent` only stops it, which is the same split the API has after coder#31174. The tool result also drops `interrupted`, as it was just whether the child was running before the send. That was the last caller of the interrupt busy behaviour, so chatd and chatstate drop it too. `SendMessage` never interrupts now. On a busy chat it only ever adds the message to a lane, so the sends that moved a running chat to interrupting, or a `requires_action` chat back to running, are gone, along with the send's inline interruption finish for chats with no worker. Most of the diff is deleted tests. A steer send to a paused chat, or to an errored chat whose next message is being edited, no longer fails with a 429 at the queue limit when it's delivered straight away, which is whenever the message being edited is a queue message. Part of CODAGT-1140
The site has never sent a `busy_behavior`, so since coder#31174 a message sent whilst the agent is working already steers. This catches the UI up. The send button now just says "Send" whilst the agent is busy, instead of "Queue", and the queued messages list groups rows by lane, "Next step" for steer messages and "After turn" for queue messages, in the order they'll be delivered. Queue messages can still come from the API or MCP, there's just no way to make one from the site. "Send now" moves a row to the end of the "Next step" group instead of hiding it, and the row leaves the list once the server delivers it. That gets rid of the separate set of hidden "Send now" rows in the chat store. When a send delivers queued messages, e.g. on an errored chat, reconciliation now removes the rows named by `queued_message_id` on the inserted messages, instead of assuming it was the queue head. The store also compares queued rows by ID and lane, so a row that only moves to the other lane still re-renders. Removing a queued message now ignores a 404, as the message may have been delivered or removed in the meantime. Since coder#31156, "Send now" doesn't interrupt, so on a running chat it no longer clears the live stream or sets the status. Whilst the agent is working, a "Next step" row already goes in before the next model call, so we hide its "Send now", and Enter on an empty composer doesn't send a steer head either. The docs now describe the two groups and "Send now". Part of CODAGT-1140
Whilst a steer message is under edit, every steer message now waits, not just the one under edit and the ones behind it. Say Next step holds A, B and C, and you edit B. Before this, A went to the agent at the next model call whilst B and C waited. Now nothing goes out until the edit ends, then A, B and C go in together. If the turn ends whilst a steer message is under edit, the chat pauses, the same as it already does for a queue message. `GetChatQueuedMessageHead` now returns a steer message under edit first, so the paused check still finds it when it isn't the first row. Queue messages are unchanged: editing one holds it and the messages behind it. On the site, every other row shows "Waiting" whilst a steer message is under edit, and Enter on an empty composer won't send the first held message whilst it's waiting on an edit. The docs are updated to match. The first version of this PR refused edits on steer messages instead, following [Mathias's review of coder#30074](coder#30074 (review)). Mathias has since suggested holding the whole steer lane, so the agent never starts working on part of what you sent. Part of CODAGT-1140
…r#31774) Since coder#31174 made steer the default, there's been no way to send a queue message from the site, i.e. one that waits for the current turn to end. This adds that back in two ways. Whilst the agent is working, Cmd/Ctrl+Enter now sends the message under "After turn" (`busy_behavior: "queue"`), and Enter still steers. If you've turned on "Require Cmd/Ctrl+Enter to send agent messages", or you're on a touch device where Enter is a newline, Cmd/Ctrl+Enter already sends, so Option/Alt+Enter sends after the turn instead. The send button tooltip lists both shortcuts, as "Send during turn" and "Send after turn". A shortcut isn't very discoverable, and there isn't one on a phone, so right-clicking the send button, or long pressing it on a touch screen, opens a small menu with "Send during turn" and "Send after turn". The menu only opens whilst the agent is busy and there's something to send, as otherwise there's no turn to wait for. Editing a sent message doesn't get the option either, since an edit has no lane to pick. The docs now describe both. Part of CODAGT-1140
…c-2026-11-10-99fb0da864 # Conflicts: # coderd/database/querier.go # coderd/database/queries.sql.go # coderd/database/queries/chats.sql # coderd/x/chatd/ARCHITECTURE.md # coderd/x/chatd/chat_mutations.go # coderd/x/chatd/chatd.go # coderd/x/chatd/chatd_test.go # coderd/x/chatd/chatstate/editing_test.go # coderd/x/chatd/chatstate/interrupt_unowned_test.go # coderd/x/chatd/chatstate/transition.go # coderd/x/chatd/chatstate/transitions.go # coderd/x/chatd/chatstate/transitions_matrix_editing_test.go # coderd/x/chatd/chatstate/transitions_matrix_test.go # coderd/x/chatd/chatstate/transitions_test.go # coderd/x/chatd/chatstate_bridge.go # coderd/x/chatd/hooks_test.go # coderd/x/chatd/subagent_operations.go # codersdk/chats.go # docs/coder-agents/architecture.md # docs/coder-agents/index.md # site/src/pages/AgentsPage/AgentChatPage/AgentChatPage.tsx # site/src/pages/AgentsPage/components/ChatConversation/chatQueueReconciliation.test.ts # site/src/pages/AgentsPage/components/ChatConversation/chatQueueReconciliation.ts # site/src/pages/AgentsPage/components/ChatConversation/chatStore.ts
The queued-message steer semantics from the upstream merge changed how an out-of-plan-mode ask_user_question answer is delivered: the web UI sends it without a busy_behavior, so it lands in the steer lane and the agent reads it before its next model call, not at the end of the turn's queue. Update the user-facing claims that still described end-of-queue delivery, realign the ask_user_question table row, and refresh the chatd architecture TODO note.
Codex Review Summary: ✅ CompletedThis 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. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40c7e4c581
ℹ️ 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".
…cade forkInterruptDescendants documented that it reports whether any descendant transitioned, but it set the flag for every successful Interrupt call. A descendant whose worker is already interrupting it succeeds unchanged, so an idle parent with such a descendant reported interrupted=true for a request that transitioned nothing. Aggregate the returned boolean instead, which also restores the pre-merge behavior of not counting waiting descendants.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e0bd002c4
ℹ️ 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".
|
@codex review |
1 similar comment
|
@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". |
…pt result Server.InterruptChat discarded the fork cascade's boolean, so interrupt on an errored or already-owned-interrupting target whose running descendant the cascade stopped reported interrupted=false. Pre-merge, interruptSubagent returned true for any non-idle target; aggregate the cascade result to keep that truthfulness while keeping upstream's precision for the target itself.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
|
Codex Review: Didn't find any major issues. Swish! 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". |
UAT report (branch server, HTTP-only)Build:
A. queue + steer (chat B. nested subagent spawn + wait (root C. todo_write (chat E. interrupt cascade (root D. wake-up delivery - not testable on this build: the wake-up delivery worker is #91, merged to main at 08:53Z after this build was cut; the build only contains the #82 wake-up tables/queries and no wake-up routes. Suggest re-running scenario D on the next branch-server deploy.
|
|
Codex Review: Didn't find any major issues. Another round soon, 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". |
Merge evidence for head
|
Closes #110.
Merges upstream coder/coder at
99fb0da86498cf464a5b4593e377e88415368ce2into forkmainby hand, as a merge commit (not squash), like every sync PR, so a later merge of the same upstream history brings only new commits. Forkmainalready carried the queue stack (coder#30073, coder#31153, coder#31154, coder#31155, coder#31156, merged in #23); this sync brings its upstream continuation: coder#31174 (interrupt busy behavior removed), coder#31175 (message_agentalways steers), and coder#31748 (an edit holds the whole lane), plus upstream's other changes to the 145-file conflict surface.Conflict families and resolutions
coderd/database/queries/chats.sql,queries.sql.go,querier.go): upstream'sediting_sincerule inGetChatQueuedMessageHead(feat: hold every steer message while one is under edit coder/coder#31748) with the fork'sinterleave_subagentscandidate-ranking hook kept. Verified the result is the byte union:GetChatQueuedMessageHeadis identical to upstream's, the worker-acquisition block is identical to forkmain's.codersdk/chats.go):ChatBusyBehaviorInterruptremoved (feat!: steer chat messages by default and remove the interrupt busy behavior coder/coder#31174). Fork hooks kept (Childrendescendants doc,SubagentName/DescriptioninChatContextResource, OpenAI-compatible provider).site/src/api/typesGenerated.tsregenerates byte-identical.chatd.go,chatstate_bridge.go,chat_mutations.go): the two-lane queued-message switch as upstream wrote it;SendMessageBusyBehaviorInterruptgone.subagent_operations.go,fork_cascade.go, tests): upstream's 3-value(chat, interrupted, error)shape; the fork's idle-target early return re-applied on top, so interrupting a waiting or paused target still cascades to its active descendants and reportsinterrupted=true.forkInterruptResultdeleted: upstream'sInterruptnow succeeds unchanged from waiting, paused, and owned interrupting states, so the error-adaptation it handled is impossible.sendSubagentMessagedropped its behavior parameter (feat: make message_agent always steer coder/coder#31175 mademessage_agentalways steer).chatQueueReconciliation,chatStore,ChatPageContent,AgentChatPage): upstream's store simplification taken wholesale; the fork's queued-message suppression machinery is dropped because it served the old promote flow that steer semantics removed, and the open-question dock already tolerates the queue dropping the answer. The fork's composer hook stays:handleSendkeepscomposerPartsand unions it with upstream'sbusyBehaviorparameter.AgentChatSendButton.tsxcomes from upstream.docs/coder-agents/with the fork's openai-compat and async-question prose kept. The async-question delivery claims that contradicted the new steer lane are corrected: a dashboard answer is held under Next step and read before the next model call, not at the end of the queue.coderd/x/chatd/ARCHITECTURE.mdcarries a TODO for the fork owner to describe that lane end to end.000640.Validation
./.github/fork/check-apidoc.shpasses (no swagger drift),chatdmig checkpasses,check-scopespasses../coderd/x/...,./coderd/database/...(incl.forkdb,dbauthz,chatdmigunit and schema tests with pg_dump 17),./enterprise/dbcrypt/..., chat/skill/mcp/plugin/swagger selections of./coderd,./enterprise/coderd, coderdtest packages,TestExpPluginsin./cli,./agent/agentcontext/...,./agent/agentgit/..., and a./enterprise/cmd/coderbuild. All green.TestPubsub_Disconnectneeds a docker socket for its own container; it passes with one mounted.tsctypecheck, thesrc/pages/AgentsPageunit suite, and biome plus oxlint on the touched files all pass.Run
make genbefore relying on this tree outside CI; the pre-commit hook was skipped through its owngit config coder.pre-commit falseopt-out because this host cannot run the full hook.