fix(tui): apply path/@ completion on Enter#13590
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Enter-key behavior so that, when a completion row is highlighted, Enter applies the completion instead of submitting the draft message.
Changes:
- Adjusts
submit()completion-on-Enter gating logic to trigger beyond just slash-prefixed inputs. - Updates how the inserted completion text is normalized when both the input and completion start with
/.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
30f89ac to
b4f1bef
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
ui-tui/src/app/useSubmission.ts:245
submit()now attempts to apply a completion whenevercomposerState.completions.lengthis non-zero, butuseCompletion()clears completions via auseEffect. This means completions from a previous input value can survive for one render; if the user types something that no longer matches slash/path completion triggers and immediately presses Enter, a stale completion can be inserted (becausenext !== value) instead of submitting. Consider gating this block with the same predicate used byuseCompletion(e.g.,value.startsWith('/')ORTAB_PATH_REmatch) or exposing anisCompletionActiveForInput(value)helper fromuseCompletionsosubmit()only applies completions when they're relevant to the currentvalue.
if (composerState.completions.length) {
const row = composerState.completions[composerState.compIdx]
if (row?.text) {
const text = value.startsWith('/') && row.text.startsWith('/') ? row.text.slice(1) : row.text
const next = value.slice(0, composerState.compReplace) + text
if (next !== value) {
return composerActions.setInput(next)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Completion selection on Enter was gated to slash commands only
(value.startsWith('/')), so @file, ./path, and ~/path completions fell
through and submitted the incomplete input instead of inserting the
highlighted row.
Guard on completions.length && compReplace > 0 — useCompletion already
scopes population to slash and path tokens, and the next !== value check
keeps plain-text submits working when the completion is already applied.
5fbb74d to
4b0686f
Compare
ulasbilgen
pushed a commit
to ulasbilgen/hermes-adhd-agent
that referenced
this pull request
May 1, 2026
…applies-path-completion fix(tui): apply path/@ completion on Enter
aj-nt
pushed a commit
to aj-nt/hermes-agent
that referenced
this pull request
May 1, 2026
…applies-path-completion fix(tui): apply path/@ completion on Enter
Luminet2023
pushed a commit
to Luminet2023/hermes-agent
that referenced
this pull request
May 1, 2026
…applies-path-completion fix(tui): apply path/@ completion on Enter
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…applies-path-completion fix(tui): apply path/@ completion on Enter
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…applies-path-completion fix(tui): apply path/@ completion on Enter
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…applies-path-completion fix(tui): apply path/@ completion on Enter
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.
From TUI blitz-test feedback: "Using @ to select a file, then hitting enter on the file, does not insert the file but sends the incomplete message as is."
Summary
submit()gated completion-on-Enter tovalue.startsWith('/'), so@file,./path,~/path, and/absolute/…completions fell through and submitted the draft instead of inserting the highlighted row.completions.length && compReplace > 0—useCompletionalready scopes population to slash and path tokens, and thenext !== valuecheck keeps plain-text submits working when the completion is already applied.Test plan
npm run type-checkcleannpm test— 152/152 pass@<partial>, Up/Down to pick file, Enter — expect insert, not submit/h, Enter — expect slash completion still applies (parity)