fix: add a built-in default loadout for zero-config sessions - #1128
Conversation
A fresh install with no configured loadouts landed in a bare shell with the stock prompt and no orientation. Add a built-in `default` loadout (no packages: a shaped PS1 and a once-only, TTY-gated banner shipped through the documented MOTD recipe) that applies only when no flags and no `default_loadouts` select anything. A user `default.toml` shadows the built-in, and `min loadout list` shows a `default (built-in)` row unless that file is present. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 32 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 (2)
Comment |
norrietaylor
left a comment
There was a problem hiding this comment.
Reviewed: scope, clobber, correctness, CI. Approving.
Scope — 188 added lines across loadouts.rs and docs/reference/loadouts.md. The largest patch in this batch, but every hunk traces to the request: a built-in default loadout, its shadowing rule, and its row in loadout list.
No clobber — no removed declarations, imports or out-of-scope blocks; loadouts.rs has no competing work in flight.
Correctness
- Shadowing is right. A user
default.tomlon disk takes precedence over the built-in, andshow_builtinkeys off!present.contains(...)so the row disappears when shadowed. The built-in never silently overrides user config. - The banner prints exactly once.
PROMPT_COMMANDevaluatesMINIMAL_MOTDthen unsets both, so it cannot repeat or fire on non-interactive commands. - Redirected output stays clean via the
[ -t 1 ]guard, and the payload is plain text soNO_COLORis respected. - TOML escaping is correct.
MINIMAL_MOTDuses a'''literal string, so\nreachesprintfuninterpreted by the TOML parser — which is what makes the banner render rather than print literal backslash-n. - No output-surface split.
cmd_loadout_listhas no--jsonpath, so the built-in row cannot appear in one representation and not another — the disjoint-output class flagged in the QA ledger (min lstable vs--json) does not apply here.
One note, not blocking. builtin_default_loadout() uses .expect(). It is genuinely infallible — a compile-time const covered by a unit test, so a parse failure is a build-time bug rather than a runtime condition — and the doc comment says exactly that. Flagging only because it sits beside gominimal/inbox#447, where we are removing an unwrap() for this same pattern; the distinction is that #447 unwraps runtime env input and this does not.
CI — 24/24 green.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABK4Q8PQ
Activating a session with no loadout flags and an empty
default_loadoutsreturned an empty loadout set, so a fresh box opened on the stock prompt with no orientation. This adds a built-indefaultloadout — no packages, just a shapedPS1and a once-only, TTY-gated banner shipped via the documented attach-shell MOTD recipe (a self-unsettingPROMPT_COMMANDpayload). It is the lowest-precedence source:--no-loadouts,--loadout, a non-emptydefault_loadouts, and a userdefault.tomlall take priority. The banner points at the in-sandboxmin add/min searchhelpers, andmin loadout listshows adefault (built-in)row unless shadowed. (informed by #686)Verification
cargo fmt --all --check — clean
cargo clippy --workspace --locked -- -D warnings — clean
cargo build --workspace --locked — ok
cargo test --workspace --locked — ok (loadouts unit tests: 8 passed, incl. fallback/shadowing/row rendering)
Note
Add a built-in default loadout for zero-config sessions
--loadoutor--no-loadoutsflag is given anddefault_loadoutsis empty, sessions now receive a built-in default loadout (defined as an inline TOML constant) unless a userloadouts/default.tomlexists, which takes precedence.min loadout listnow shows adefault (built-in)row when no userdefault.tomlis present, even if the loadouts directory is missing entirely.vars; it contributes no packages.loadout listno longer exits early — it prints a single message and renders the table with the built-in row.Macroscope summarized 430ef97.