Skip to content

feat(web): add steer-now buttons for queued messages - #2273

Open
bernardlim wants to merge 1 commit into
MoonshotAI:mainfrom
bernardlim:feat/web-steer-queued-messages
Open

feat(web): add steer-now buttons for queued messages#2273
bernardlim wants to merge 1 commit into
MoonshotAI:mainfrom
bernardlim:feat/web-steer-queued-messages

Conversation

@bernardlim

@bernardlim bernardlim commented Jul 27, 2026

Copy link
Copy Markdown

Add explicit steer actions to the web UI's queued-message list: a per-row button that injects a single queued message into the running turn, and a queue-header button that steers the whole queue (TUI Ctrl+S parity).

Also fix Ctrl+S steering not triggering when CapsLock is on, and count web-initiated steers in the input_steer telemetry event by moving the tracking call to the shared steer path.

Related Issue

Resolve #2270

Problem

See linked issue. In short: the web UI queues messages during a running turn but offers no visible way to inject them into that turn, and no way to steer a single queued message without steering everything at once.

What changed

  • Per-row "Steer now" button on each queued message: steers only that entry into the running turn via the existing POST /sessions/{id}/prompts:steer endpoint, leaving the rest of the queue untouched. Attachments are carried along.
  • Queue-header "Steer now" button: steers the whole queue at once — the same merge semantics as the composer Ctrl+S shortcut. Falls back to a normal send when no turn is running.
  • Queue integrity: all queue-mutating submissions (row steer, whole-queue steer, automatic drain) run through one per-session operation queue, so they never race. A turn that ends mid-steer defers its drain until the steer settles; rejected steers restore into the latest visible queue order; and a per-session incarnation token invalidates pending operations across archive/restore, so stale work can never revive a forgotten session's queue.
  • CapsLock fix: the composer's Ctrl+S check now lowercases e.key, so steering no longer silently fails when CapsLock is on. (Terminal input is unaffected by CapsLock, so the TUI never had this issue.)
  • Telemetry alignment: moved the existing input_steer tracking call from the TUI-only RPC steer path down into the shared prompt-queue steer path, so steers initiated from the web UI are counted the same way as TUI steers (segmented by the existing ui_mode field). No new event, no schema change.

Why this approach: the UI surface is purely additive on top of the existing steer machinery — no backend or protocol changes; everything flows through the same submit-then-steer path the composer shortcut already used. The queue internals were hardened (serialization, lifecycle invalidation) specifically so the new per-entry steer flows cannot corrupt ordering or revive stale work under races.

Tests: new unit tests cover single-entry steer (queue order preserved, attachments included), restore-on-rejection, concurrent steers, steer/drain interleaving on turn end, session-switch liveness, archive/restore invalidation, and rejection-after-reorder ordering; a telemetry assertion verifies input_steer fires from the shared steer path.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 978aac2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to 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: 8346474702

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-web/src/composables/client/useWorkspaceState.ts Outdated
Comment thread apps/kimi-web/src/components/chat/ChatPane.vue Outdated
Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
Comment thread packages/agent-core-v2/test/agent/prompt/promptService.test.ts Outdated
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch from 51cc434 to ee96253 Compare July 27, 2026 17:16

@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: 51cc434d52

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-web/src/composables/client/useWorkspaceState.ts Outdated
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch from 763b7e9 to b38fe4e Compare July 27, 2026 17:21

@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: b38fe4e772

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-web/src/composables/client/useWorkspaceState.ts Outdated
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch from 3755a54 to 6cb0499 Compare July 27, 2026 17:33

@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: 6cb0499e8f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-web/src/composables/client/useWorkspaceState.ts Outdated
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch 4 times, most recently from 8b71f02 to 0d86757 Compare July 27, 2026 18:26

@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: 0d86757945

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-web/src/composables/client/useWorkspaceState.ts
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch from 0d86757 to c15ead7 Compare July 28, 2026 01:06

@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: c15ead7cbe

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-web/src/composables/client/useWorkspaceState.ts Outdated
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch from c15ead7 to 122ea70 Compare July 28, 2026 02:10

@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: 122ea70315

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-web/src/composables/client/useWorkspaceState.ts Outdated
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch from 122ea70 to 5dfd98d Compare July 28, 2026 02:44

@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: 5dfd98dc58

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-web/src/composables/client/useWorkspaceState.ts
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch 2 times, most recently from a42f8e0 to a421050 Compare July 28, 2026 03:40
Add explicit steer actions to the web UI's queued-message list: a per-row
button that injects a single queued message into the running turn, and a
queue-header button that steers the whole queue (TUI Ctrl+S parity).

Also fix Ctrl+S steering not triggering when CapsLock is on, and count
web-initiated steers in the input_steer telemetry event by moving the
tracking call to the shared steer path.

Closes MoonshotAI#2270
@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch from a421050 to 978aac2 Compare July 28, 2026 13:38
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 978aac20cf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@bernardlim
bernardlim force-pushed the feat/web-steer-queued-messages branch 2 times, most recently from 74fc9a0 to 978aac2 Compare July 28, 2026 13:56
@bernardlim

Copy link
Copy Markdown
Author

@RealKai42, could you please take a look at the overall approach in this PR?

Although the visible change is adding “Steer now” controls, the implementation also touches queued-message handling, operation serialization, automatic draining when a turn ends, session lifecycle invalidation, and the shared steer path.

Since this could affect a fairly important part of the existing interaction flow, I’d especially appreciate your feedback on whether the proposed UX and queue semantics align with the intended direction before we move forward. Thanks!

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.

feat(web): steer queued messages into the running turn from the queue UI

1 participant