Repository navigation
fix(tui): route leading-slash lines by registered command id - #1205
Merged
Merged
Conversation
A leading slash dispatches a slash command only when its first token (to whitespace, lowercased) exactly matches a registered command id. Absolute paths (/Users/you/notes) and unknown names now reach the model verbatim as prompts; bare slash stays empty. All three submit sites share one registry-owned set, and the slash popup, arg-stage parse, and unedited-hint strip treat path heads as prompts. Unknown-slash choice: typos go to the model (no did-you-mean notice, no fuzzy matcher); multi-slash input always did.
Case-insensitive routing matched /CLEAR but forwarded the typed case, so the exact registry lookup missed and reported Unknown command. The router now returns the canonical lowercase id; the ignores-case test asserts the lowered name and a keeper test drives /CLEAR through the real registry.
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.
Leading-slash composer lines misrouted as commands: absolute paths (/Users/you/notes) and unknown slash names dispatched against the command registry instead of reaching the model.
This change routes a leading slash to a command only on an exact registered-id hit (first token to whitespace, lowercased). Anything else is sent verbatim as a prompt; bare slash stays empty. All three submit sites share one call-site-owned set from the palette/registry source, and the slash popup, arg-stage parse, and unedited-hint strip treat path heads as prompts.
Unknown-slash UX: typos go to the model (no did-you-mean notice, no fuzzy matcher); multi-slash input always did.
Verification: submit-handler + command-catalog suites 51/51 pass; agent-ask-wake, live-session-port, runtime-bridge suites 119/119 pass; full repo gate (lint, typecheck, dead-exports, build, projects-dir-guard, 8606 tests across 551 files) green.
Fixes CL-9000