fix(tui): steer user messages into the running turn while a goal is active - #2153
Conversation
🦋 Changeset detectedLatest commit: 9071abc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba67dbb33e
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1485d0fb0
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! 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". |
Related Issue
None — this is a clear, reproducible bug fix; the problem is explained below.
Problem
While a goal is being pursued, the engine holds its single active turn across the whole goal continuation loop. The TUI, however, goes idle at every
turn.ended— including each goal continuation boundary — and then sends queued input (drained from its message queue, or typed in the brief idle window) as a freshprompt. That prompt races the goal driver and is rejected withturn.agent_busy("Cannot launch a new turn while another turn (ID N) is active"), so the user's message is silently dropped: it appears in the local transcript but never reaches the session history.What changed
session.steerinstead ofsession.prompt. The engine buffers steered input into the running goal turn (flushed at the next step / turn boundary, where the model can react to it), or launches a turn of its own if the goal loop just ended — both correct outcomes, with no rejection. When no goal is active, messages still go throughpromptexactly as before.turn.agent_busy: "Wait for the current turn to finish or steer it") rather than changing engine semantics, so other hosts are unaffected.@moonshot-ai/kimi-code, patch).Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.