Skip to content

feat(site): show steer as the default for busy chats - #31173

Merged
ethanndickson merged 9 commits into
ethanndickson/message-agent-steerfrom
ethanndickson/site-steer-default
Nov 9, 2026
Merged

ethanndickson merged 9 commits into
ethanndickson/message-agent-steerfrom
ethanndickson/site-steer-default

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

The site has never sent a busy_behavior, so since #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 #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

@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

CODAGT-1140

@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T08:52:51.048080Z 8c133d7 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ethanndickson
ethanndickson force-pushed the ethanndickson/site-steer-default branch from 4d31105 to d156a82 Compare October 26, 2026 04:19
@ethanndickson
ethanndickson force-pushed the ethanndickson/site-steer-default branch from d156a82 to d26f0cc Compare October 26, 2026 04:47
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d26f0cc775

ℹ️ 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".

@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

re: Remove assertions from the story play function

These assertions predate both this PR and the AGENTS.md rule. This PR only changes the asserted label from "Queue" to "Send", because it removes the "Queue" label; without that change the check would always pass. Moving the assertions out of play (and porting the Escape check to Vitest, which has no equivalent today) is a separate cleanup, so I'm leaving it out of this PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d26f0cc775

ℹ️ 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".

@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

re: Reconcile promotions that deliver from errored chats

The scenario is real but narrow and self-healing: it needs an errored chat with a queue, a down WebSocket, and a successful HTTP promote. On reconnect the stream replays the queue, status, and missed messages, so the store converges. The previous optimistic removal didn't help here either, since the delivered message also stayed out of the transcript until the socket recovered; showing it as a pending steer row is closer to the truth. Every server-side change is invisible while the socket is down, so I'm not adding a promote-specific refetch for this.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: d26f0cc775

ℹ️ 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".

@ethanndickson
ethanndickson marked this pull request as ready for review October 26, 2026 05:31
@ethanndickson
ethanndickson requested a review from a team as a code owner October 26, 2026 05:31
@ethanndickson
ethanndickson force-pushed the ethanndickson/site-steer-default branch 3 times, most recently from ef96e3e to 8c133de Compare October 27, 2026 00:46
@ethanndickson
ethanndickson force-pushed the ethanndickson/site-steer-default branch 2 times, most recently from 59ada44 to 87b69ca Compare November 5, 2026 06:41
@ethanndickson
ethanndickson force-pushed the ethanndickson/site-steer-default branch from 87b69ca to 8c133d7 Compare November 5, 2026 08:38
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 8c133d7de6

ℹ️ 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".

A message sent while the agent works can change the model: the agent uses that message's model from its next model call.
When several messages are delivered together, the agent uses the model of the last one, and the reasoning effort of the last one that sets an effort.
API and MCP clients can set `busy_behavior` to `queue` to deliver a message when the current turn ends instead.
The chat groups held messages under **Next step** and **After turn**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: Use the present tense here (Copy Editor). The sentence reads "The chat groups held messages under Next step and After turn.", where "held" parses as the past-tense verb of "the chat groups" (object: "messages"), describing ongoing product behavior. The surrounding section is present tense (line 126 "Messages are held and delivered", line 133 "receives", line 135 "goes"), and the style guide requires present tense by default (docs/.style/style-guide/voice-and-tone.md#present-tense-by-default).

Suggested change
The chat groups held messages under **Next step** and **After turn**.
The chat groups hold messages under **Next step** and **After turn**.

API and MCP clients can set `busy_behavior` to `queue` to deliver a message when the current turn ends instead.
The chat groups held messages under **Next step** and **After turn**.
The agent receives messages under **Next step** before its next model call, and messages under **After turn** when the current turn ends.
**Send now** moves a message to **Next step**, or sends it at once when the agent isn't working.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: no comma before "or" in a short compound predicate (Copy Editor). "Send now" is the single subject of both verb phrases "moves a message to Next step" and "sends it at once when the agent isn't working", so the comma before "or" isn't needed per the no-comma-in-a-short-compound-predicate rule (docs/.style/style-guide/capitalization-and-punctuation.md#no-comma-in-a-short-compound-predicate).

Suggested change
**Send now** moves a message to **Next step**, or sends it at once when the agent isn't working.
**Send now** moves a message to **Next step** or sends it at once when the agent isn't working.

The send button now says Send instead of Queue while the chat is busy, paused, or has a queue head under edit, and queued rows show whether they run at the next step or after the turn.
Queue reconciliation removes the rows named by queued_message_id instead of guessing the queue head.
Send now moves the row to the end of the Next step group instead of hiding it, and the row leaves the list when the server delivers it. This removes the separate set of hidden "Send now" rows, so a failed Send now keeps the queue it already has instead of refetching it.
Remove comments that restate code or test names. A 404 does not prove that a queued message was delivered or deleted, so the comments no longer claim it.
…works

From the chat UI, a message sent while the agent works goes under Next step. The removed lines said that Send now does not stop the agent, and that API and MCP clients can queue a message for After turn.
`queue` is also the busy_behavior of the After turn group, so the line
that names both groups now calls their messages held, like the lines
above it.
@ethanndickson
ethanndickson force-pushed the ethanndickson/site-steer-default branch from 8c133d7 to 90619da Compare November 6, 2026 06:03

@mafredri mafredri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, deferring approval to FE team.

@ethanndickson
ethanndickson requested review from jakehwll and mafredri and removed request for mafredri November 9, 2026 04:39
@ethanndickson
ethanndickson merged commit 673b29e into main Nov 9, 2026
36 of 58 checks passed
@ethanndickson
ethanndickson deleted the ethanndickson/site-steer-default branch November 9, 2026 04:55
ethanndickson added a commit that referenced this pull request Nov 9, 2026
"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.

#31174 then makes `steer` the API default and removes `interrupt` as a
busy behaviour, #31175 makes `message_agent` always steer, and #31173
updates the site.

Part of CODAGT-1140
ethanndickson added a commit that referenced this pull request Nov 9, 2026
…ehavior (#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 #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
#31173. chatd still accepts `interrupt` internally, as `message_agent`
uses it, and #31175 removes both.

Part of CODAGT-1140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants