Skip to content

fix: validate --loadout before the missing-config banner in min session activate - #1153

Draft
gominimal-aw-bot[bot] wants to merge 1 commit into
mainfrom
inbox-patch/activate-validate-loadout-order-80c408182daa2477
Draft

fix: validate --loadout before the missing-config banner in min session activate#1153
gominimal-aw-bot[bot] wants to merge 1 commit into
mainfrom
inbox-patch/activate-validate-loadout-order-80c408182daa2477

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_kwDOSUhdos8AAAABKmgwZw

min session activate printed the "No minimal.toml found ... Continuing without one" scaffold-offer banner before resolving the --loadout argument, so passing a loadout file that does not exist produced a "proceeding" notice immediately followed by a not-found error — a contradictory sequence. The scaffold offer now runs after loadout resolution, so a bad --loadout fails before any output is emitted; the banner's order relative to the "Applying loadouts" line is unchanged. The offer is a convenience, not a precondition (informed by #682), so moving it past argument validation preserves its behaviour. No unit test accompanies the change: the reorder lives in a daemon-driven async activation path the test harness does not exercise in isolation.

Verification

cargo fmt --all --check --manifest-path target/Cargo.toml — clean, no drift
cargo clippy --workspace --locked --manifest-path target/Cargo.toml -- -D warnings — 0 warnings, finished in 9m 44s
cargo build --workspace --locked --manifest-path target/Cargo.toml — ok, finished in 3m 48s
cargo test --workspace --locked --manifest-path target/Cargo.toml — ok, exit 0, no failing tests

Note

Fix --loadout validation to run before the missing-config banner in cmd_activate

Previously, offer_mfile_scaffold() was called before loadout resolution in cmd_activate, meaning a scaffold prompt could appear even when the --loadout flag was invalid. The call is now deferred until after loadouts are resolved and options are composed, so a bad --loadout value fails fast without printing the scaffold offer.

Macroscope summarized 6cbb44a.

`min session activate` printed the "No minimal.toml found ...
Continuing without one" banner from the config-scaffold offer
before resolving `--loadout`, so passing a nonexistent loadout
file showed a "proceeding" notice immediately followed by a
not-found error.

Move the scaffold offer to after loadout resolution so argument
validation fails before any output is emitted. The banner's order
relative to the "Applying loadouts" notice is unchanged.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c32e7559-9fca-42e5-a34b-724fb96a6fd7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@gominimal-aw-bot

Copy link
Copy Markdown
Contributor Author

[inbox-patch:clobber]

This PR would revert recently merged work

Simulating this merge shows it undoing commits that landed on the base branch within the last 3 day(s):

  • d392e005180% of its 5 surviving lines in these files would be undone
    • fix: align min ls table columns with its --json field set (fix: align min ls table columns with its --json field set #1144)
      This is the stale-read failure, not a conflict: the agent read these files before the commits above merged, then wrote the whole region back from that stale read. Git applies it cleanly, so there is no conflict, no failing test, and nothing unusual in the diff summary — see gominimal/inbox#460.

Before merging, restore the reverted region to its state on the base branch. The rest of this PR is unaffected.

If a listed commit is one this PR intends to supersede, say so and merge — this check reports, it does not block.

@norrietaylor

Copy link
Copy Markdown
Member

The [inbox-patch:clobber] flag above is a verified false positive — disregard it

I checked it against the code rather than trusting the tool. Every one of #1144's lines survives this merge; none are reverted.

Re-running the scan's exact filters locally on the same inputs gives total=22 gone=0. Listing them individually shows 22 kept, 0 gone — the min ls table formatting, status_label, and the project_path column are all intact in the merged tree.

Ruled out as causes: the blob-filtered clone (filtered and full clones both yield 30 + lines for d392e0051), main moving between scan and check (origin/main has not advanced since 4a738d4e at 21:03Z), and #1144 not being an ancestor (it is).

The scan computed total=5, small enough that four incidental misses cross the 80% threshold. Tracked as gominimal/inbox#472. The check reports rather than blocks precisely so a miscall like this cannot strand a good fix.

Review of the change itself — looks right

Moving offer_mfile_scaffold after resolve_active_loadouts is the correct fix for the ordering bug: a bad --loadout now errors before anything prints.

I checked the specific risk that the move could break first-run scaffolding — if anything between the old and new call sites read the project's minimal.toml, the scaffold offer could become unreachable. It does not. read_client_config, user_policy_path and read_user_policy are all user-level config, and resolve_active_loadouts reads the loadouts dir. The project path reaches offer_mfile_scaffold independently.

The comment explaining why the call sits there is the right thing to leave behind — without it the next reader would be tempted to move it back up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant