feat(ui): slash-command and manual-shell routing in the full-screen app#14
Merged
Conversation
…n app A typed /... or !... line is a harness control, not a model turn. The dock routes it to a SlashRouter instead of the model: fast display commands run on the loop thread against a pane-capturing console (output rendered into the pane); interactive/slow/own-stdout commands (confirm, cloud consent, /doctor, /model use) and the manual shell suspend the app via run_in_terminal; and a model-invoking /plan revise runs on the worker thread like a turn. needs_terminal and needs_worker classify deterministically, with a _decline loop-path confirm safety net so a misclassified command can never block the event loop. Adds DESIGN section 31.17.
lavindeep
added a commit
that referenced
this pull request
Jul 2, 2026
feat(ui): slash-command and manual-shell routing in the full-screen app
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.
Branch 8 of the full-screen TUI rework (UI v2, design §31.17).
What
A typed
/...or!...line is a harness control, not a model turn. The dock routes it to aSlashRouter(cli/app_slash.py) instead of the model. The router splits work by what would hang the loop (the invariant is "never hang", not "never run synchronous code"):/help,/status,/context,/logs,/memory show, …) run against a capturingrich.Console; output rendered into the pane viaAppUI.show_slash_output.run_in_terminal(needs_terminal) — interactive / own-stdout commands (confirm(), cloud consent,/doctor,/model usepreload) and the manual shell (!,/shell) suspend the app and use the real terminal./plan revise(needs_worker, runs like a turn viaTurnRunner.start_action, approvals via the §31.16 focus-swap gate) and blocking-network commands/model list//attach <path>(needs_background, captured output marshaled to the pane). Neither can run on the loop thread (model call would deadlock the approval gate; a hung Ollama would freeze the TUI for the client timeout).One
SlashDispatcherdrives all paths; thedispatchclosure swaps its console + confirm per call, with a_declineloop-path confirm so a misclassified command can never block the loop./exitstays a direct quit; a normal line still starts a turn. The default (non-app) REPL is untouched.Tests
needs_terminal/needs_worker/needs_backgroundclassifiers (exhaustive);SlashRouterrouting across all lanes with injected effects;AppUI.show_slash_output; and real-threadTurnRunner.start_actioncoverage (worker execution + marshaled busy-clear). Phase gate green: ruff + format clean, mypy --strict clean (80 files), 1417 passed.Live validation (gemma4:31b-cloud)
/help+/statusrender in the pane;/model listruns its/api/tagscall off-loop and renders the table in the pane (no freeze/flicker);/clearsuspends → confirm → resumes;!lsruns the manual shell; a normal line still starts a model turn.DESIGN §31.17 added.