fix(tui): complete absolute paths as paths - #19930
Merged
teknium1 merged 1 commit intoMay 4, 2026
Merged
Conversation
helix4u
marked this pull request as ready for review
May 4, 2026 22:56
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.
What does this PR do?
Fixes a TUI completion routing bug where text beginning with an absolute path, such as
/home/d/Desktop/file.md, could enter the slash-command completion path because completion checked onlyinput.startsWith("/").The submit path already has a stricter slash-command shape check, so this makes completion use the same distinction: real slash commands still use
complete.slash, while absolute paths usecomplete.path.Related Issue
No GitHub issue found. This came from a Discord support report where an absolute path typed at the start of the TUI prompt appeared to be eaten unless the user prefixed it with a space.
Searched for existing PRs/issues with:
prompt starting with / eatenabsolute path slash command eatenlooksLikeSlashCommand useCompletioncomplete.slash absolute pathType of Change
Changes Made
ui-tui/src/hooks/useCompletion.tsso completion useslooksLikeSlashCommand()instead of treating every leading/as a slash command.completionRequestForInput()to keep the completion routing decision testable.ui-tui/src/__tests__/useCompletion.test.tscovering slash commands, absolute-path-leading prompts, trailing absolute path tokens, and plain text.How to Test
cd ui-tui && npm run type-checkcd ui-tui && npm test -- --run src/__tests__/useCompletion.test.ts src/__tests__/useComposerState.test.ts/home/d/Desktop/agenda/CrimsonRed/.hermes/plans/2026-05-04-HANDOFF-NEXT.mdand press Enter. It should be treated as prompt text/path input, not as a slash command.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passscripts/run_tests.sh -n 4Documentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
cd ui-tui && npm run type-checkpassed.cd ui-tui && npm test -- --run src/__tests__/useCompletion.test.ts src/__tests__/useComposerState.test.tspassed: 2 files, 13 tests.scripts/run_tests.sh -n 4failed:51 failed, 19611 passed, 51 skipped, 222 warnings in 596.24s (0:09:56)The full-suite failures are outside the files changed by this PR.
Full-suite failure list