Repository navigation
refactor(coderd): deliver queued chat messages through one helper - #31153
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. Keep it up! 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". |
1ff5e09 to
34ac687
Compare
34ac687 to
7a3d8f4
Compare
0dc9f89 to
0e91d6c
Compare
0e91d6c to
bd30e3e
Compare
bd30e3e to
b283be6
Compare
b283be6 to
28493ca
Compare
28493ca to
446d1c6
Compare
446d1c6 to
7f0c72b
Compare
|
@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". |
7f0c72b to
42a8be9
Compare
FinishTurn, FinishInterruption, SendMessage from E1, and PromoteQueuedMessage now share deliverQueuedRows, which moves a list of queued rows into history. The delivery still takes only the queue head, and a head under edit still pauses the chat. FinishTurnResult and FinishInterruptionResult return PromotedMessages as a slice.
42a8be9 to
7a352a0
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
FinishTurn,FinishInterruptionand a send to an errored chat with a queue each had their own code for moving a queued message into history. They now sharedeliverQueuedRows, 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.PromotedMessageson 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
PromoteQueuedMessagefor now. #31156 replaces it with a move into the steer lane, which then goes throughdeliverQueuedRowslike everything else.I've also deleted
GetChatQueuedMessagesByPositionandGetChatQueuedMessageHead, asGetChatQueuedMessagesalready returns the queue in delivery order.Part of CODAGT-1140