feat(tui): run read-only slash commands while a response is streaming - #512
Merged
Merged
Conversation
While a turn is in flight the composer was fully locked: a user could neither type nor inspect state without waiting for completion or cancelling the turn (Issue #511). - The composer stays editable during `streaming`; `submitting` and `disabled` remain locked, and the streaming mode is preserved while a mid-stream draft is typed so the affordance stays truthful. - New bounded allowlist (slash-command.ts): the six secret-safe runtime commands (/status, /model, /settings, /tools, /capabilities, /continuity) plus /help run immediately mid-turn via the existing palette path; pure `busySubmitDecision` classifies a mid-turn submit (run-command / ignored / rejected). - Prompts and non-allowlisted commands are rejected with an explicit, non-destructive notice; the typed draft is preserved and submits once the turn settles. Turn serialization is untouched: nothing is queued, interrupted, or reordered, and command output renders as an in-place notice under the streaming entry. - Unit tests cover allowlist membership, the busy-submit matrix (including the /? alias and argument carry-over), and the truthful streaming affordance with a mid-stream draft.
Extend the Interactive REPL section: the read-only commands run immediately while a response streams, and anything else typed mid-stream waits with the draft preserved (Issue #511).
Owner
Author
Independent self-review (head bb30916)Reviewed the full diff against the acceptance criteria in #511, independent of implementation. Findings: 0 Critical, 0 High, 1 Minor (non-blocking).
Verified against acceptance criteria:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #511
Executes the self-discovery issue #511 (behavior-level reference: Qwen Code
v0.21.3 shipped the same affordance in QwenLM/qwen-code#8130; behavior only —
no code, prose, or assets copied).
Summary
While a turn is in flight the interactive composer was fully locked: the user
could neither type nor inspect state without waiting for completion or
cancelling the turn. Long responses made the shell effectively single-tasking.
streaming(submitting/disabledremain locked). Typing mid-stream preserves the streaming mode, so the
affordance stays truthful — the band keeps reading
✦ streaming, never aneditable-prompt marker.
secret-safe runtime commands (
/status,/model,/settings,/tools,/capabilities,/continuity) plus/help(incl. the/?alias). Theydispatch through the existing palette path and render their existing
redacted output as an in-place notice.
/clear,/exit,/attach,/ask,/goal, overlays…) are rejected with an explicit, non-destructive notice;the typed draft is preserved and submits once the turn settles.
submitWhileBusynever queues, interrupts,or reorders a run; pure
busySubmitDecisionclassifies the mid-turn submit(run-command / ignored / rejected) for unit testing.
Non-goals (per the execution issue)
/clearand/exitare not allowlisted mid-stream; overlays (/stats,/lsp,/tasks,/mission,/activity) stay gated.Reviewer Test Plan
response streams, run
/status— redacted output appears in place and theturn completes undisturbed (receipt captures bound to the head SHA are on
the issue).
in the composer and is submittable after the turn settles.
npm run typecheck,npm test(3017 tests incl. 9 new), integrationvitest (483), and
npm run smokeall green.