Skip to content

refactor(tui): one helper for rejecting pending prompts; swallowed budget 37 -> 22 - #513

Merged
mrnasil merged 1 commit into
mainfrom
chore/tui-swallowed-errors
Nov 27, 2026
Merged

mrnasil merged 1 commit into
mainfrom
chore/tui-swallowed-errors

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 27, 2026

Copy link
Copy Markdown
Member

What

No behaviour change; the TUI swallowed-error count drops from 37 to 22.

  • One helper instead of four copies. Cancel, force-stop, closing a background session and shutdown each had their own loops for "cancel every waiting question, deny every waiting permission prompt". They now call reject_pending. Two of the four used to deny permissions before cancelling questions; all four now cancel questions first. The replies go to independent one-shot channels, so the order is not observable.
  • Nine false positives removed. let _ = sat on calls that return no error: apply_generated_title and go_prev_question / go_next_question (bool), Buffer::set_line (cursor position), spawn_title_refine (task handle). Without the binding the budget stops counting them.

scripts/swallowed_error_budget.json: tui 37 -> 22.

Left alone on purpose

The remaining 22 are terminal restore on exit (10), sends to a receiver that may already be gone (9), the exit summary on stderr (2) and the busy-key pass-through that ignores handle_event's keep-running result (1). None of these were touched, so the event loop and terminal setup are unchanged and the docs/tui-term-matrix.md manual checks were not run.

Verification

  • cargo clippy -p whycodes-tui --all-targets -- -D warnings, cargo fmt --all --check, all budget scripts: green.
  • affected_tests.py --execute: 406 passed, 0 failed.

🤖 Generated with Claude Code

…dget 37 -> 22

- Cancel, force-stop, closing a background session and shutdown each
  carried their own copy of "cancel every waiting question, deny every
  waiting permission prompt". They now call reject_pending.
- Nine `let _ =` bindings sat on calls that return no error (a bool,
  a cursor position, a task handle). Dropping them stops the budget
  counting things that were never swallowed errors.

No behaviour change. The 22 left are terminal restore on exit, sends
to a receiver that may already be gone, and the busy-key pass-through.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@mrnasil
mrnasil merged commit d06905c into main Nov 27, 2026
7 checks passed
@mrnasil
mrnasil deleted the chore/tui-swallowed-errors branch November 27, 2026 18:57
@mrnasil mrnasil mentioned this pull request Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant