fix(shell): remove queued-input bordered ghost in running-turn TUI - #216
Merged
Conversation
Pressing Enter during an active agent turn left a redundant bordered copy of the accepted input in scrollback beside the intended queued row. The running-turn lifecycle set Application.full_screen=True mid-turn — which prompt_toolkit 3.0.52 ignores for the renderer once the session is built, so it never achieved its purpose — while _sync_erase_when_done gated final-frame erasure on `not full_screen`. Enter therefore final-rendered the accepted buffer as a fossilized bordered card. Make accepted-prompt erasure depend only on prompt mode (AGENT erases the accepted frame; SHELL keeps it in normal scrollback) and drop all dynamic prompt_toolkit fullscreen toggling (_set_running_fullscreen, _previous_full_screen). The tui.sticky_input config key is retained for backward compatibility with honest legacy wording; the composer stays inline during active turns. Regression coverage: a screen-mode-preserved running-prompt lifecycle contract, a strengthened Enter-to-queue test (one append, one invalidation, no steer/echo), and a pyte-rendered PTY test proving the queued follow-up renders once with its hint (never a bordered ghost) and executes once in FIFO order.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughChangesQueued input lifecycle
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Jul 20, 2026
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
Pressing Enter during an active agent turn to queue a follow-up left a redundant bordered "ghost" copy of the accepted input in terminal scrollback, beside the intended teal
❯ …queued row with its↑ to edit · ctrl-s to send immediatelyhint.Root cause: the running-turn lifecycle set
Application.full_screen=Truemid-turn — which prompt_toolkit 3.0.52 ignores for the renderer once the session is constructed, so it never achieved its purpose — while_sync_erase_when_done()gated final-frame erasure onnot full_screen. Enter therefore final-rendered the accepted buffer as a fossilized bordered card.Changes
_sync_erase_when_done()now depends only on prompt mode: AGENT erases the accepted frame; SHELL keeps it in normal scrollback._set_running_fullscreen,_previous_full_screen) and their turn-start/attach/detach calls._turn_starting, delegate attachment, invalidation order, and pre-stream input-card gating are unchanged.tui.sticky_inputconfig key retained for backward compatibility with honest legacy wording; the composer stays inline during active turns.Tests
full_screenfields disagree, and the lifecycle never mutates those fields.test_mid_turn_queued_input_renders_once_and_executes_once: the queued follow-up shows its live❯ … / ↑ to editrow and never fossilizes as a bordered accepted-input card (the ghost), and executes once in FIFO order. The guard flags the queued text only when it is wedged between a card border directly above and committed⏺content directly below — the fossil signature — which excludes the two healthy renderings (the live queued display and the post-drain execute-echo). A/B-verified across every rendered frame: fails on the pre-fix code, passes on the fix.Verification
make check-pythinker-code(ruff + format + pyright 0 errors + ty) — green.make test-pythinker-code(unit + e2e including the local PTY suite) — green.docs/en/release-notes/changelog.mdregenerated vianpm run sync.Summary by CodeRabbit
Bug Fixes
Documentation