Skip to content

feat: hold every steer message while one is under edit - #31748

Merged
ethanndickson merged 2 commits into
ethanndickson/site-steer-defaultfrom
ethanndickson/chat-steer-refuse-edit
Nov 9, 2026
Merged

ethanndickson merged 2 commits into
ethanndickson/site-steer-defaultfrom
ethanndickson/chat-steer-refuse-edit

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

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 #30074. 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

@linear-code

linear-code Bot commented Nov 4, 2026

Copy link
Copy Markdown

CODAGT-1140

Comment thread coderd/exp_chats.go Resolved
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-steer-refuse-edit branch from b1289b3 to 91d7898 Compare November 5, 2026 04:02
@ethanndickson
ethanndickson marked this pull request as ready for review November 5, 2026 05:20
@ethanndickson
ethanndickson requested a review from a team as a code owner November 5, 2026 05:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-05T13:28:24.906847Z 239fe2f 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.

@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: 91d7898512

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

Comment thread coderd/x/chatd/chatstate/state.go Resolved
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-steer-refuse-edit branch from 91d7898 to a622aec Compare November 5, 2026 06:41
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

re: Preserve paused chats with legacy steer edits

Not reachable from a release. The steer busy behavior is new in this stack: migration 000640 (#31156) adds busy_behavior as NOT NULL DEFAULT 'queue', so every existing row, including rows under edit, becomes a queue row on upgrade and still pauses the chat. No released version can persist a steer row under edit. Only the lower layers of this stack (#31156 to #31173) can create one, and this PR merges with them.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: a622aec856

ℹ️ 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 force-pushed the ethanndickson/chat-steer-refuse-edit branch from a622aec to 3d574f3 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. Keep it up!

Reviewed commit: 3d574f3bc9

ℹ️ 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 draft November 5, 2026 11:26
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-steer-refuse-edit branch from 3d574f3 to 94a90e7 Compare November 5, 2026 11:31
@ethanndickson ethanndickson changed the title feat: refuse edits on queued steer messages feat: hold every steer message while one is under edit Nov 5, 2026
@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: 94a90e7211

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 239fe2fd87

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 239fe2fd87

ℹ️ 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 November 5, 2026 13:18

@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: 239fe2fd87

ℹ️ 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: Keep Send now for ready steer rows in errored chats

Intentional, so I'm keeping it as an accepted known limitation. Send now now shows only on After turn rows. Next step rows already go to the agent as soon as possible, so the button has no job there in the normal case.

A ready Next step row survives into an errored chat only when it arrives during the last step (for example, a long tool call), and the turn then fails with an error that can't be retried, or after the retries run out. Retryable errors keep the chat running, and the held Next step rows go in before the retried model call. In the remaining case the row is not lost: the next message the user sends delivers it first. One rule (Send now only on After turn rows) is easier to understand than a rule that depends on chat status and edit state.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 239fe2fd87

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

Steer messages can be edited again. While one is under edit, every steer
message waits, and a turn that ends during the edit pauses the chat.
GetChatQueuedMessageHead returns a steer message under edit first, so the
paused check finds it. Queue messages keep the old rule: an edit holds the
message and the messages behind it.
Send now on a Next step message did nothing while another Next step message was under edit in a paused or errored chat, and while the turn runs a Next step message already goes in before the next model call. Next step rows no longer offer Send now, and Enter on an empty composer no longer sends a Next step message.
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-steer-refuse-edit branch from 239fe2f to 0a17f5a 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 good!

SELECT * FROM chat_queued_messages
WHERE chat_id = @chat_id::uuid
ORDER BY CASE busy_behavior WHEN 'steer' THEN 0 ELSE 1 END, position ASC, id ASC
ORDER BY (busy_behavior = 'steer' AND editing_since IS NOT NULL) DESC, CASE busy_behavior WHEN 'steer' THEN 0 ELSE 1 END, position ASC, id ASC

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.

Does this run the risk of re-positioning an item in the queue? I guess not, since editing_since would have to become NULL first and then this query would return them in the previous order.

@ethanndickson
ethanndickson merged commit 9fa68ac into main Nov 9, 2026
78 of 104 checks passed
@ethanndickson
ethanndickson deleted the ethanndickson/chat-steer-refuse-edit branch November 9, 2026 04:55
dylanhuff-at-coder added a commit that referenced this pull request Nov 10, 2026
…ex migration to 000641 (#31997)

#31766 and #31748 both added a `000640` migration and both merged, so
main currently has two migrations with the same number. Migrations fail
to load with `duplicate migration file:
000640_workspace_app_stats_session_ended_at_idx.down.sql`, which breaks
every test that sets up a database.

This moves the `workspace_app_stats` index to `000641`. It's a rename
only and `dump.sql` regenerates unchanged. `go test
./coderd/database/migrations/...` and the insights and dbrollup tests
pass with it.

Part of [CORE-439](https://linear.app/codercom/issue/CORE-439).
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.

2 participants