Skip to content

fix(cli): report errors the CLI used to discard; swallowed budget 26 -> 2 - #512

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

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

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 27, 2026

Copy link
Copy Markdown
Member

What

The CLI crate had 26 places that threw an error away. 24 of them now name it.

  • Upgrade rollback. When installing the new binary fails and the previous one cannot be put back either, the error says so and names the displaced file. Before, the restore result was dropped: no binary installed and no hint where the old one went. A missing previous binary (fresh install) is no longer "restored" at all.
  • Plain REPL. /models, /agent and /connect print why a listing failed instead of printing nothing.
  • Session saves. A failed save after a turn logs a warning, including when the database cannot be opened. Four sites, one helper (persist_session).
  • CI events and upgrade leftovers. Failed writes and failed cleanup log at debug.

scripts/swallowed_error_budget.json: cli 26 -> 2. The two left are a stdout flush before the REPL prompt and the last-resort tracing init.

Verification

  • cargo check, cargo fmt --all --check, cargo clippy -p whycodes-cli --all-targets -- -D warnings, all budget scripts: green.
  • affected_tests.py --execute: 405 passed, 4 failed. The same 4 fail on unchanged main on this Windows machine (two lockfile PID tests, cmd_upgrade_downloads_and_replaces_target, run_shell_capture_stdout_stderr_and_empty), so CI on Linux is the real check here.
  • New tests cover the helper error branches and the rollback message. The replace_binary branch that calls them on a failed rename is not exercised by a test.

🤖 Generated with Claude Code

…-> 2

- upgrade: when installing the new binary fails and the previous one
  cannot be put back either, the error now says so and names the
  displaced file. Before, the restore result was dropped and the user
  was left with no binary and no hint where the old one went.
- plain REPL: /models, /agent and /connect print why a listing failed
  instead of printing nothing.
- session saves after a turn log a warning on failure, including when
  the database cannot be opened (four sites, one helper).
- CI event writes and upgrade leftover cleanup log at debug.

The two remaining sites are a stdout flush before the REPL prompt and
the last-resort tracing init.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@mrnasil
mrnasil merged commit 1db96be into main Nov 27, 2026
7 checks passed
@mrnasil
mrnasil deleted the chore/cli-swallowed-errors branch November 27, 2026 18:26
@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