fix: remove doubled prefixes from min CLI error output - #1151
Conversation
Two error-formatting sites in the min CLI rendered the same text twice in the displayed error chain. In the loadout path, resolve_active_loadouts wraps read_loadout_file's LoadError with anyhow context. That LoadError's Display already embeds its I/O source, so anyhow also walked into the source and printed the OS error a second time. Flatten the LoadError to a leaf before adding context. In the update path, mctx's MFile Display prepends "minimal.toml: " while mfile's NotFound Display also led with the filename, producing "minimal.toml: minimal.toml not found". Make NotFound context-free so the boundary supplies the filename exactly once.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Comment |
Reviewed — the shared-type change is safe, and it improves an existing messageThe risky part of this diff is changing I checked every consumer. All of them pattern-match the variant and construct their own message — The one place that does render it is Before this change it produced The |
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmgvEQ
Two
minerror paths printed the same text twice.min session activate --loadout <missing>repeated the OS-error string becauseresolve_active_loadoutslayered anyhow context over aLoadErrorwhose Display already embeds its I/O source.
min updateoutside aproject printed
minimal.toml: minimal.toml not foundbecause both themctx boundary and
mfile'sNotFoundled with the filename. The fixesflatten the loadout error to a leaf and make
NotFoundcontext-free,upholding the thiserror/anyhow boundary (informed by ADR-0001); each
path gains a regression test.
Verification
cargo fmt --all --check --manifest-path target/Cargo.toml — clean
cargo clippy --workspace --locked -- -D warnings — 0 warnings
cargo build --workspace --locked — ok
cargo test --workspace --locked — ok (all suites green; +2 new tests)
Note
Fix doubled prefixes in min CLI error output for missing files and loadouts
mfile::Error::NotFound'sDisplayimpl so it renders as"not found"instead of"minimal.toml: not found", preventing duplication when the caller adds context.anyhowerror chain inresolve_active_loadoutsso I/O errors from missing loadout files appear exactly once alongside the--loadout \name`` context string.Macroscope summarized 91f9a78.