Repository navigation
feat(coderd): add a steer lane to queued chat messages - #31154
ethanndickson merged 2 commits into
Conversation
|
@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. |
|
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". |
2a87da4 to
374867d
Compare
374867d to
66164be
Compare
51639c7 to
7bbb242
Compare
7bbb242 to
5248dcd
Compare
5248dcd to
21072a6
Compare
21072a6 to
2e0cd29
Compare
2e0cd29 to
f32ac30
Compare
f32ac30 to
a81510a
Compare
|
@codex review |
|
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". |
2d0f136 to
294b67b
Compare
chatstate now uses the busy_behavior of a queued message as its lane, steer or queue. The queue lists the steer lane first, then the queue lane. FinishTurn, FinishInterruption, and a send from E1, E1P, or P deliver the whole steer lane. If the steer lane is empty, they deliver the queue head. Delivery stops at the first row under edit, so rows ahead of an edited row still go out in order. chatstate accepts the steer busy behavior, but no caller sends it yet. Interrupt sends still go into the queue lane, and PromoteQueuedMessage reorders a message inside its own lane.
294b67b to
464c55a
Compare
…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. #31174 makes `steer` the API default. Outside of tests, nothing creates steer messages until #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. #31153 moves queue delivery into one helper, #31154 adds the two lanes, #31155 stores interrupt sends in the steer lane, and #31156 makes "Send now" steer, which also fixes two presses being delivered in reverse order. This supersedes #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
As suggested on #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_behavioras its lane, and the steer lane always goes first.GetChatQueuedMessageslists 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 deliversS1 S2, andQ1waits for the next turn end.chatstate accepts
steerhere, 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:#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