8000 fix(min): print a refused newer box state without the daemon-failure lead by agent-137 · Pull Request #3874 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(min): print a refused newer box state without the daemon-failure lead - #3874

Merged
mitodrummer merged 1 commit into
mainfrom
fix/refusal-without-daemon-prefix
Nov 29, 2026
Merged

mitodrummer merged 1 commit into
mainfrom
fix/refusal-without-daemon-prefix

Conversation

@agent-137
@agent-137 agent-137 commented Nov 28, 2026 •
Copy link
Copy Markdown
Member

When a 0.8 min meets box state that a newer release wrote, the daemon refuses before it writes anything (#3850). min printed that refusal behind a lead that reads as a daemon fault. The pc run of gominimal/inbox#1330 (journey J4) printed this:

error: Failed to ensure the minimald daemon is running: A newer min wrote the box state in <st>. That state has format version 2. This min reads format version 1 or older, and it changed nothing. Install the newer min, then run your command again.

The daemon did not fail. It refused on purpose. With this PR, the same run prints:

error: A newer min wrote the box state in <st>. That state has format version 2. This min reads format version 1 or older, and it changed nothing. Install the newer min, then run your command again.

Change

  • autospawn::boot_failure_error returns the refusal as a typed StateRefusal error. The refusal text does not change. is_state_refusal finds that error.
  • cmd::ensure_daemon adds the "Failed to ensure the minimald daemon is running" lead to every start failure except a refusal.
  • On Linux with the VM provider chosen by /dev/kvm, the note about that choice is not appended to a refusal, because the VM did not fail to start. Before this change, the note also turned the error back into plain text, and the lead came back.

Text this changes

  • The refusal prints as the whole error, from the native daemon and from the VM. Pinned by cmd::tests::a_state_refusal_prints_without_the_daemon_lead, which also pins that another start failure keeps the lead.
  • autospawn::tests::boot_failure_error_for_a_state_refusal now also checks that both refusal forms come back as a StateRefusal.
  • No script or doc quotes the old lead in front of the refusal.

Verification

  • just fix is clean, and so is fmt plus clippy --fix.
  • just test-one state_refusal -p minimal: 2 passed.
  • The full just test -p minimal was stopped partway when the shared host ran low on memory. CI runs it.

Refs gominimal/inbox#1330

🤖 Generated with Claude Code

https://claude.ai/code/session_016CYvTvep9ZaSf5pJMB2hQA

Summary by CodeRabbit

  • Bug Fixes
    • Improved startup error messages when the app encounters state created by a newer version, preserving the specific explanation instead of adding unrelated context.
    • Avoided showing the KVM provider note for this type of startup refusal, making error guidance more relevant.
    • Other startup failures continue to include the general daemon-startup context.

…lead

A 0.8 min that meets box state from a newer release stops before it
writes anything, and its daemon prints why. min passed that refusal up
through ensure_daemon, which put "Failed to ensure the minimald daemon
is running:" in front of it. That lead reads as a daemon fault, but the
daemon refused on purpose and changed nothing.

The refusal is now a StateRefusal error. ensure_daemon prints it as the
whole message and keeps the lead for every other start failure. The
note about the VM provider chosen by /dev/kvm is not added to a
refusal either, since the VM did not fail to start.

Refs gominimal/inbox#1330

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016CYvTvep9ZaSf5pJMB2hQA
@agent-137
agent-137 requested a review from a team as a code owner November 28, 2026 23:43
@coderabbitai
coderabbitai Bot commented Nov 28, 2026 •
Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Newer-state refusals are represented as typed io::Error values. Linux minvmd handling omits the KVM provider note for these errors. ensure_daemon returns state refusals without daemon-start context and retains that context for other startup errors.

Changes: State-refusal error handling

Layer / File(s) Summary
Typed refusal and startup handling
crates/minimal/src/autospawn.rs
boot_failure_error wraps newer-state refusal text in StateRefusal. The Linux minvmd error handler omits the KVM provider note for that error. Tests check the refusal type and display text.
Daemon startup error formatting
crates/minimal/src/cmd/mod.rs
ensure_daemon uses daemon_start_error to format startup errors. State refusals omit the “Failed to ensure the minimald daemon is running” context. Other startup errors retain it. A test checks both formats.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: norrietaylor, 0chroma

Merge Risk: Minimal · up to be1dd

This change makes the refusal message for newer box state clearer by dropping the misleading daemon-failure prefix. Other startup errors are unchanged. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(min): print a refused newer box state without the daemon-failure lead" follows the Conventional Commit form and names the main change: a state refusal is printed without the "Failed to …
Description check Passed The description covers the problem, the change, the text it alters, and verification. It does not follow the template headings exactly: there is no explicit Summary, Testing, or Checklist heading. The…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(min): print a refused newer box state without the daemon-failure lead" follows the Conventional Commit form and names the main change: a state refusal is printed without the "Failed to ensure the minimald daemon is running" lead. The changeset matches this, adding the StateRefusal typed error, is_state_refusal, and the ensure_daemon change that skips the lead for refusals.

Full details: Description check

Explanation

The description covers the problem, the change, the text it alters, and verification. It does not follow the template headings exactly: there is no explicit Summary, Testing, or Checklist heading. The Testing content is present but partial, since the full test run was not completed. The checklist items (docs updated, BREAKING CHANGE footer) are not addressed. Issue linkage is given as "Refs gominimal/inbox#1330", which matches the template's suggested linking form.

Resolution

Optionally add the template's Checklist section, state whether docs need updating, and state whether a BREAKING CHANGE footer applies. Consider using the template headings (Summary, Testing, Checklist) so the structure matches the repository template.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit reads the startup note,
And finds a typed refusal quote.
The KVM hint steps aside,
While other errors keep their guide.
Then hops away beneath the moon.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 01267704-2705-4b82-a9cf-7796733f958a
Commits

Reviewing files that changed from the base of the PR and between d3bafd0 and be1dd6c.

Files selected for processing: 2

  • crates/minimal/src/autospawn.rs
  • crates/minimal/src/cmd/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review.

@minimal-foundry
minimal-foundry Bot commented Nov 28, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at be1dd6c11b35.

Nothing to do.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 28, 2026
@agent-137
Copy link
Copy Markdown
Member Author

/arch-review

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arch-review: PASS · the full ruling

The design of record does not govern how min frames a refused newer box state, so this ruling is a PASS by absence. The change keeps the refusal text, types it as StateRefusal, and removes only the daemon-failure lead and the KVM note for it. Other start failures keep the lead. The code stays in the minimal crate, as #3850 placed it. No condition is open.

Ruled at be1dd6c against gominimal/arch@d3d472929d81 by claude-opus-5-5.

@mitodrummer mitodrummer 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.

Approved.

@mitodrummer
mitodrummer added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit b58e1f5 Nov 29, 2026
45 of 47 checks passed
@mitodrummer
mitodrummer deleted the fix/refusal-without-daemon-prefix branch November 29, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0