Metadata
| Status | done |
|---|---|
| Assigned | agent-1257 |
| Agent identity | f51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e |
| Created | 2026-04-30T14:08:18.218683243+00:00 |
| Started | 2026-04-30T14:08:48.011832397+00:00 |
| Completed | 2026-04-30T14:21:02.050311925+00:00 |
| Tags | priority-high,bug,tui,ux,input,dialog, eval-scheduled |
| Eval score | 0.93 |
| └ blocking impact | 0.90 |
| └ completeness | 0.98 |
| └ coordination overhead | 0.88 |
| └ correctness | 0.95 |
| └ downstream usability | 0.85 |
| └ efficiency | 0.90 |
| └ intent fidelity | 0.89 |
| └ style adherence | 0.95 |
Description
Description
fix-new-chat-2 (commit f6d2c62ce) gated vendor_pty_active on InputMode::Normal for keystroke routing — keys typed into the new-chat dialog no longer leak to the underlying chat's PTY. But the user reports that PASTING (Cmd-V / Ctrl-Shift-V / middle-click) into the dialog STILL leaks the pasted content into the underlying chat tab.
User repro 2026-04-30 on fresh post-fix binary: pasted https://lambda01.tail334fe6.ts.net:30000 into the new-chat dialog → URL appeared in the active background chat tab.
Likely cause
Paste events are a separate crossterm event class. When the terminal sends bracketed paste \x1b[200~<content>\x1b[201~, crossterm parses it as Event::Paste(String) rather than a sequence of Event::Key events. fix-new-chat-2's input_mode guard was on the key-event branch of the dispatch; the paste-event branch likely has its own direct-to-PTY forwarding that doesn't consult input_mode.
The fix is the symmetric guard on the paste path: when input_mode is NOT Normal (i.e., the launcher overlay is open), paste events go to the focused dialog widget, NOT to the underlying PTY child stdin.
Confirmed scope (from user testing)
- Keystroke leak: FIXED by fix-new-chat-2
- Paste leak: STILL BROKEN
- Switching focus between chat tabs (no dialog open): works correctly — chat-vs-chat input routing is fine
- Bug is specific to: new-chat overlay open + paste event
Investigation
- Find the paste-event handling in src/tui/ — search for
Event::PasteorMouseEventKind::Paste(different terminals may emit differently) - Check whether it routes through a unified input dispatch (which fix-new-chat-2 should have covered) OR through a separate paste-only branch (which it didn't)
- If the latter: apply the same input_mode guard on the paste branch
Validation
- Failing test written first: simulate Event::Paste while launcher overlay is open, assert child_input_bytes_written stays at 0
- Live smoke: open new-chat dialog, paste a URL into a text field, confirm: - URL appears in the dialog field (not the background chat) - Background chat's PTY child stdin receives 0 bytes during the paste
- Same for keystroke path (no regression of fix-new-chat-2)
- No regression on chat-vs-chat input routing (typing into a focused chat works as before)
- cargo build + cargo test pass
- Permanent smoke scenario: programmatic Event::Paste injection while launcher is open, byte-level assertion on background pane's child stdin
- cargo install --path . was run before claiming done
Process note
This is the THIRD iteration of the new-chat input-leak bug class (fix-new-chat → fix-new-chat-2 → this). Pattern: each iteration covers ONE event class (chat tab focus, keystrokes, paste). Future input-routing changes should test ALL crossterm event kinds (Key, Mouse, Paste, Resize, FocusGained, FocusLost) to avoid another sequel. Worth a smoke scenario template that exercises every event kind under each input_mode combination so this regression class is fully gated going forward.
Depends on
Required by
- (none)
Log
- 2026-04-30T14:08:18.207834565+00:00 Task paused
- 2026-04-30T14:08:24.177619025+00:00 Task published
- 2026-04-30T14:08:45.963747082+00:00 Lightweight assignment: agent=Careful Programmer (f5143935), exec_mode=full, context_scope=task, reason=Careful Programmer excels at correctness-critical bugs requiring exhaustive verification; paste-event guard fix is a symmetric application of fix-new-chat-2's approach with extensive validation requirements.
- 2026-04-30T14:08:48.011836815+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-30T14:08:55.637254500+00:00 Starting investigation: searching for Event::Paste handling in src/tui/
- 2026-04-30T14:19:59.890485660+00:00 Implemented fix: added matches!(app.input_mode, InputMode::Normal) guard to handle_paste's vendor_pty_active in src/tui/viz_viewer/event.rs (symmetric to fix-new-chat-2). Also added InputMode::Launcher arm so pasted text routes to the focused launcher section's text field (Name, EndpointRegister, Model/Endpoint custom_text or filter).
- 2026-04-30T14:20:03.371561676+00:00 Added 4 unit tests in chat_tab_navigation_tests: launcher_open_does_not_leak_paste_to_underlying_pty (byte-level via real PtyPane), launcher_open_clears_paste_routing_to_launcher_field (routing without PTY), launcher_paste_reaches_custom_endpoint_text (user repro path), paste_in_normal_mode_still_reaches_chat_pty (negative control). All 4 pass.
- 2026-04-30T14:20:17.438555868+00:00 Added permanent smoke scenario tui_launcher_modal_does_not_leak_paste in tests/smoke/manifest.toml + scenarios/. Owners: fix-paste-events, fix-new-chat-2, smoke-gate-is. Validated: cargo build + 3277 cargo test pass, scenario passes locally, cargo install --path . done.
- 2026-04-30T14:20:38.343977268+00:00 Committed: 83a7df519 — pushed to remote
- 2026-04-30T14:21:02.050315973+00:00 Task pending eval (agent reported done; awaiting `.evaluate-*` to score)
- 2026-04-30T14:22:59.894176970+00:00 PendingEval → Done (evaluator passed; downstream unblocks)