Skip to content

fix(tui): make Ctrl+O inspector complete and draft-safe#4498

Merged
Hmbown merged 4 commits into
mainfrom
agent/091-tui-regressions
Jul 18, 2026
Merged

fix(tui): make Ctrl+O inspector complete and draft-safe#4498
Hmbown merged 4 commits into
mainfrom
agent/091-tui-regressions

Conversation

@Hmbown

@Hmbown Hmbown commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • route Ctrl+O to the whole-turn inspector even when the composer contains a draft
  • move external-editor access to Ctrl+Shift+O and align help/localized keybinding copy
  • preserve the complete final assistant result in the pager and copied pager body
  • keep the exported handoff intentionally compact
  • preserve Sh1Zuku / @SparkofSpike report credit in commit metadata and contributor records

Fixes #4482.

Verification

  • cargo test -p codewhale-tui key_shortcuts::tests --locked
  • cargo test -p codewhale-tui turn_inspector_pager_retains_complete_long_final_result --locked
  • cargo test -p codewhale-tui shipped_complete_packs --locked
  • cargo test -p codewhale-tui ctrl_o_help_copy_matches_turn_inspector_behavior --locked
  • python3 scripts/test_check_coauthor_trailers.py
  • cargo fmt --all
  • git diff --check

Release note

This PR is intentionally scoped to the reproducible Ctrl+O failures. The separate intermittent Windows repaint report in #4479 remains open until its terminal/version evidence supports a narrow fix rather than a speculative repaint loop.

@Hmbown Hmbown added the bug Something isn't working label Jul 17, 2026
@Hmbown Hmbown added this to the v0.9.1 milestone Jul 17, 2026
@Hmbown Hmbown added tui Terminal UI behavior, rendering, or interaction ux User experience, interaction, or presentation polish reliability Reliability, flaky behavior, retries, fallbacks, and robustness v0.9.1 Targeting v0.9.1 labels Jul 17, 2026
@Hmbown

Hmbown commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Exact-head local gate update for 2883f95: cargo check -p codewhale-tui --bin codewhale-tui --locked passed. The branch is clean and tracking origin/agent/091-tui-regressions.

@Hmbown

Hmbown commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Follow-up review fixes are public at exact head f62e0d2: Caps Lock plus Ctrl+O now stays on the inspector, external-editor routing requires explicit Shift and has an F4 fallback for legacy terminals, c/y uses a source-faithful Turn Inspector payload (indentation, tabs, repeated/blank lines retained), and blank display rows are no longer doubled. Focused shortcut, 36 pager tests, long-result regression, locked binary check, fmt, and diff check pass. CI restarted on this head.

@Hmbown
Hmbown force-pushed the agent/091-tui-regressions branch from f62e0d2 to 227d0e5 Compare July 17, 2026 22:01
@Hmbown

Hmbown commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto public main 7885f8db8e6ebdd4fe577dcdc2799808a22dadbd after #4491. Contributor credit for @luismateusvargas, @redjade75723, and @SparkofSpike/Sh1Zuku is preserved. New exact head: 227d0e5c297ec5ed7d37cdd5a732473310669b28. Post-rebase gates: pager 36/36, shortcut routing 2/2, complete long Turn Inspector result 1/1, fmt and diff checks pass. CI is rerunning on this exact head.

@Hmbown

Hmbown commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Pushed follow-up 0ee5719f4 for the Windows CI failure. Foreground and background hooks now receive a closed pipe when there is no payload, which is a reliable EOF signal through cmd/PowerShell (unlike a NUL handle, which may reopen console input). Exact local proof: cargo fmt --all -- --check; cargo test -p codewhale-tui --bin codewhale-tui observer_hook_receives_eof_instead_of_inheriting_terminal_stdin --locked; git diff --check. Waiting for the public Windows exact-head rerun before merging.

@Hmbown

Hmbown commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Public handoff update: pushed exact head 10834f5fc9eeef62757f18f726dd8509d74b69e9 (verify with the PR API). The earlier Windows rerun proved the closed-stdin hook regression passes. Its remaining Windows failure was a separate acceptance fixture using Unix-only printf; this head uses portable echo and a newline-tolerant assertion. Focused exact test and cargo fmt --check pass locally. Fresh exact-head CI is now authoritative. The macOS approval_modal_keeps_wheel_for_review_and_denies_without_side_effect timeout remains a separate PTY-test stabilization item; the failure frame already contained DENIAL-HONORED and no side effect was reported, so do not conflate it with the hook production fix.

@Hmbown

Hmbown commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Correction to the preceding comment: the exact remote head is 10834f5fc8b4a55f57e36419bcec5de1f5856c8c (the earlier SHA text contained a transcription typo). The branch and CI are running on this corrected exact SHA.

Hmbown and others added 4 commits July 17, 2026 19:22
Route Ctrl+O to the Turn Inspector regardless of composer contents, move external-editor access to Ctrl+Shift+O, and retain complete final responses in the pager while keeping exported handoffs compact.

Co-authored-by: Sh1Zuku <125943630+SparkofSpike@users.noreply.github.com>
Signed-off-by: Hunter B <hmbown@gmail.com>
Keep Caps Lock from routing Ctrl+O to the editor, provide F4 where legacy terminals cannot distinguish Ctrl+Shift+O, and preserve source-faithful Turn Inspector clipboard content including indentation and blank lines.

Signed-off-by: Hunter B <hmbown@gmail.com>
Use a piped stdin for both foreground and background hooks, dropping the writer immediately when no payload exists. This provides portable EOF through cmd and PowerShell, where a NUL handle can be reopened as console input and hang the hook.\n\nRefs #4489.

Signed-off-by: Hunter B <hmbown@gmail.com>
Signed-off-by: Hunter B <hmbown@gmail.com>
@Hmbown
Hmbown force-pushed the agent/091-tui-regressions branch from 10834f5 to 44cddb8 Compare July 18, 2026 02:26
@Hmbown

Hmbown commented Jul 18, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto public main de7f45586fb8ce21f8093315080f5058cacb38c3 after #4505 and #4506. The only conflict was the contributor ledger; both @w1w218 and @SparkofSpike entries are preserved. New exact head: 44cddb80fe18c7bc5f8d5cdd41acb7f67b755a2e. Local exact-head gates: hook EOF regression passed; portable Operate shell acceptance passed; Ctrl+O shortcut tests 2/2; pager tests 36/36; cargo fmt --all -- --check; git diff --check; co-author/author validation passed for all four commits. Fresh hosted CI on this head is authoritative.

@Hmbown

Hmbown commented Jul 18, 2026

Copy link
Copy Markdown
Owner Author

Correction: the exact remote head is 44cddb80fb46ae437de39999951cdd26b7af8428 (the preceding comment had a transcription error). The branch and fresh CI are running on this exact SHA.

@Hmbown
Hmbown marked this pull request as ready for review July 18, 2026 02:38
Copilot AI review requested due to automatic review settings July 18, 2026 02:38
@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Hmbown
Hmbown merged commit 0c6109c into main Jul 18, 2026
19 of 20 checks passed
@claude

claude Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working reliability Reliability, flaky behavior, retries, fallbacks, and robustness tui Terminal UI behavior, rendering, or interaction ux User experience, interaction, or presentation polish v0.9.1 Targeting v0.9.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ctrl+O pager: output truncated with ... and closes immediately while typing

2 participants