feat: allow empty /btw command#378
Conversation
🦋 Changeset detectedLatest commit: c1ae2bb 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
kimi-code/apps/kimi-code/src/tui/commands/btw.ts
Lines 15 to 16 in 297f913
When /btw is opened without arguments during an active main turn, this forks the side agent immediately, before the user types the panel question. startBtw() snapshots the parent context in SessionSubagentHost.startBtw() via useProjectedHistoryFrom(parent.context), so any main-agent output or tool results that arrive while the empty panel is open are missing from the first side question. Please defer startBtw() until the first non-empty panel submit, or refresh the snapshot, so empty /btw behaves like /btw <question> at submission time.
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
kimi-code/apps/kimi-code/src/tui/commands/btw.ts
Lines 15 to 16 in c1ae2bb
When /btw is invoked without arguments, the panel is not mounted until session.startBtw() resolves. Because dispatchInput fires slash-command execution without awaiting it, if startBtw() is slow and the user types the intended side question immediately, btwPanelController.sendUserInput() still sees no active panel and the text falls through to the main prompt/queue instead of the new side agent. The inline /btw question path is safe because the prompt is captured before this await, but the new empty-panel flow needs to reserve/mount the panel or otherwise buffer the first input while the side agent is starting.
ℹ️ 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".
Related Issue
No linked issue. This addresses the limitation that
/btwrequired a question inline instead of allowing users to open the side-channel panel first.Problem
Users who invoke
/btwwithout arguments currently get a usage error, so they cannot open the side-channel panel first and type the question there.What changed
/btwwith no arguments to start the side agent and mount the existing BTW panel in its empty state./btwprompt flow, and cancels an unused empty side agent when the panel is closed./btw, first panel input, and closing an unused empty panel.Validation:
pnpm --filter @moonshot-ai/kimi-code test -- test/tui/commands/resolve.test.ts test/tui/kimi-tui-message-flow.test.ts --runInBandpnpm --filter kimi-code-docs run buildChecklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.