Skip to content

fix: add a built-in default loadout for zero-config sessions - #1128

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/builtin-default-loadout-e126ccd38ecd1ad1
Jul 31, 2026
Merged

fix: add a built-in default loadout for zero-config sessions#1128
norrietaylor merged 1 commit into
mainfrom
inbox-patch/builtin-default-loadout-e126ccd38ecd1ad1

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABK4Q8PQ

Activating a session with no loadout flags and an empty default_loadouts returned an empty loadout set, so a fresh box opened on the stock prompt with no orientation. This adds a built-in default loadout — no packages, just a shaped PS1 and a once-only, TTY-gated banner shipped via the documented attach-shell MOTD recipe (a self-unsetting PROMPT_COMMAND payload). It is the lowest-precedence source: --no-loadouts, --loadout, a non-empty default_loadouts, and a user default.toml all take priority. The banner points at the in-sandbox min add/min search helpers, and min loadout list shows a default (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)

Generated by inbox-patch ·

Note

Add a built-in default loadout for zero-config sessions

  • When no --loadout or --no-loadouts flag is given and default_loadouts is empty, sessions now receive a built-in default loadout (defined as an inline TOML constant) unless a user loadouts/default.toml exists, which takes precedence.
  • min loadout list now shows a default (built-in) row when no user default.toml is present, even if the loadouts directory is missing entirely.
  • The built-in default sets a once-only orientation banner and a shaped prompt via vars; it contributes no packages.
  • Behavioral Change: the missing-loadouts-directory case in loadout list no longer exits early — it prints a single message and renders the table with the built-in row.

Macroscope summarized 430ef97.

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>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5247a770-7096-4bb1-a1de-7a4238eb852c

📥 Commits

Reviewing files that changed from the base of the PR and between e167d60 and 430ef97.

📒 Files selected for processing (2)
  • crates/minimal/src/loadouts.rs
  • docs/reference/loadouts.md

Comment @coderabbitai help to get the list of available commands.

@norrietaylor
norrietaylor marked this pull request as ready for review July 31, 2026 07:57
@norrietaylor
norrietaylor requested a review from a team as a code owner July 31, 2026 07:57

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.toml on disk takes precedence over the built-in, and show_builtin keys off !present.contains(...) so the row disappears when shadowed. The built-in never silently overrides user config.
  • The banner prints exactly once. PROMPT_COMMAND evaluates MINIMAL_MOTD then 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 so NO_COLOR is respected.
  • TOML escaping is correct. MINIMAL_MOTD uses a ''' literal string, so \n reaches printf uninterpreted by the TOML parser — which is what makes the banner render rather than print literal backslash-n.
  • No output-surface split. cmd_loadout_list has no --json path, so the built-in row cannot appear in one representation and not another — the disjoint-output class flagged in the QA ledger (min ls table 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.

@norrietaylor
norrietaylor merged commit e8ebe4f into main Jul 31, 2026
30 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/builtin-default-loadout-e126ccd38ecd1ad1 branch July 31, 2026 08:10
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