fix(tui): stabilize sticky prompts and paste recovery#17237
Merged
Conversation
Prevent unterminated bracketed paste input from swallowing future keystrokes, and avoid rendering an empty Thinking panel before reasoning arrives.
Keep the latest prompt sticky while the viewport is in live assistant output beyond history, and clear stale sticky state at the real bottom using fresh scroll height.
Keep the /steer acknowledgement plain text so it reads like the rest of the TUI status copy.
Run the TUI lint autofix and formatter on the PR branch after the sticky prompt and paste recovery changes.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the TUI/Ink input pipeline and viewport UI behavior by recovering from terminals that enter bracketed paste mode but never send the paste-end marker, and by tightening viewport/thinking rendering edge cases.
Changes:
- Add a watchdog-driven recovery path for unterminated bracketed paste (flush/reset paste mode so future keystrokes aren’t swallowed).
- Improve viewport correctness by optionally using a “fresh” Yoga-derived scroll height and by refining sticky prompt boundary logic.
- Avoid rendering an empty Thinking accordion when the app is busy but no reasoning text is present/streaming.
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui-tui/src/types/hermes-ink.d.ts | Updates ScrollBoxHandle typing to include getFreshScrollHeight(). |
| ui-tui/src/lib/viewportStore.ts | Uses cached scroll height first, then falls back to fresh scroll height to clear stale non-bottom state. |
| ui-tui/src/domain/viewport.ts | Fixes sticky-prompt calculation for tail/out-of-range viewport positions and row-boundary behavior. |
| ui-tui/src/components/thinking.tsx | Prevents empty “Thinking” UI when merely busy and no reasoning is active/streaming. |
| ui-tui/src/app/slash/commands/core.ts | Adjusts queued steer system message formatting. |
| ui-tui/src/tests/viewportStore.test.ts | Adds coverage for fresh scroll-height behavior clearing stale non-bottom state. |
| ui-tui/src/tests/viewport.test.ts | Adds coverage for sticky prompt behavior at history tail and row-boundary conditions. |
| ui-tui/packages/hermes-ink/src/ink/parse-keypress.ts | Resets IN_PASTE state on flush even if paste buffer is empty (recovery from missing paste-end). |
| ui-tui/packages/hermes-ink/src/ink/parse-keypress.test.ts | New tests covering empty paste, unterminated paste flush, and empty-unterminated paste reset. |
| ui-tui/packages/hermes-ink/src/ink/components/App.tsx | Arms the flush watchdog for IN_PASTE state (not just incomplete escapes) to trigger recovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Match the buffered-stdin rearm cadence to IN_PASTE state so large pastes do not spin the normal escape timeout while waiting for readable data to drain.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…watchdog fix(tui): stabilize sticky prompts and paste recovery
jsboige
pushed a commit
to jsboige/hermes-agent
that referenced
this pull request
May 14, 2026
…watchdog fix(tui): stabilize sticky prompts and paste recovery
dannyJ848
pushed a commit
to dannyJ848/hermes-agent
that referenced
this pull request
May 17, 2026
…watchdog fix(tui): stabilize sticky prompts and paste recovery
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…watchdog fix(tui): stabilize sticky prompts and paste recovery
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…watchdog fix(tui): stabilize sticky prompts and paste recovery
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.
Summary
/steerqueued acknowledgement.Test plan
npm test -- --run packages/hermes-ink/src/ink/parse-keypress.test.ts src/__tests__/details.test.ts src/__tests__/viewport.test.tsnpm test -- --run src/__tests__/viewport.test.ts src/__tests__/viewportStore.test.ts packages/hermes-ink/src/ink/parse-keypress.test.ts src/__tests__/details.test.tsnpm test -- --run src/__tests__/createSlashHandler.test.tsnpm run fix(completed with warnings only; no errors)npm run type-check