Repository navigation
fix(tui): keep local commands out of model prompts - #100188
Merged
Merged
Conversation
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(tui): keep local commands out of model prompts This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Contributor
Author
|
Land-ready verification for
Known gap: external model transport remains mocked by the repository's PTY harness; command routing and the real local TUI/backend path are exercised. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 5, 2026
Closed
5 tasks
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 #71592
What Problem This Solves
Fixes an issue where users of
openclaw tui --localcould select or type shared slash commands such as/status,/compact,/commands, and/context, then have those control commands sent to the model as ordinary user prompts because the embedded backend does not run the Gateway command handlers.Why This Change Was Made
The TUI now resolves shared aliases through the canonical command registry, advertises only commands with an explicit local route, and rejects known Gateway-owned commands before model submission. Gateway-connected behavior, argument-bearing
/btwand/side, and intentionally unknown slash text remain unchanged; bare/btwand/sidenow return the shared usage hint.AI-assisted: yes. I reviewed the implementation and understand the affected local and Gateway command paths.
User Impact
Local TUI users no longer spend model turns or pollute transcripts when they invoke an advertised control command that requires the Gateway. Autocomplete and
/helpnow match what local embedded mode can actually execute, and unsupported commands produce a direct local explanation.Evidence
node scripts/run-vitest.mjs src/tui/commands.test.ts src/tui/tui-command-handlers.test.ts— 96 tests passed.OPENCLAW_TUI_PTY_INCLUDE_LOCAL=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.tui-pty.config.ts src/tui/tui-pty-local.e2e.test.ts --testNamePattern 'drives the real local backend'— the TUI visibly rejected/status,/compact,/commands, and/context, returned usage for bare/side, made zero model requests for those inputs, then sent a normal prompt through the real embedded backend and renderedLOCAL_PTY_RESPONSE.tbx_01kwrdzcx1a87xgeb9v92yfghr(run 28731441776) —pnpm check:changedpassed core production/test typechecks, lint, import cycles, and changed guards; the same real local PTY scenario passed on Linux.autoreview --mode localcompleted with no accepted/actionable findings after two in-scope routing findings were fixed.