8000 fix(minimal): name the min stop race in plain language by gominimal-aw-bot[bot] · Pull Request #2314 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal): name the min stop race in plain language - #2314

Merged
norrietaylor merged 7 commits into
mainfrom
inbox-patch/fix/shutdown-race-rpc-failure-text-f7b77dd741d51601
Oct 20, 2026
Merged

norrietaylor merged 7 commits into
mainfrom
inbox-patch/fix/shutdown-race-rpc-failure-text-f7b77dd741d51601

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 18, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABX3vc8g

An activation that races min stop loses the race: its CreateSession or ConfigureLoadout RPC fails with the daemon's shutdown refusal, which surfaced as a raw RPC chain (a refused RPC wrapping the daemon-side Internal error: in shutdown) instead of a sentence.

The daemon now marks every shutdown refusal with a shared constant in minimald-rpc (informed by #613), and the client matches on it to print one plain line: the daemon was shutting down, no session was created, run the command again once it is running. Other failures keep their chain, wrapped exactly as before. Applies to min session activate, min task run, and the dashboard activate.

Verification

  • cargo fmt --all --check — clean
  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean
  • cargo test --locked -p minimald-rpc -p minimald -p minimal — minimald-rpc and minimald fully green; minimal 525 passed, 1 pre-existing environment-dependent failure (tests::legacy_network_spellings_parse_with_hint), verified to fail identically on unmodified main
  • New unit tests: a shutdown-raced RPC failure maps to the plain sentence; an ordinary RPC failure keeps its chain and wrap (both pass)

Summary by CodeRabbit

  • Bug Fixes
    • Session activation now gives clearer shutdown messages, distinguishing when no session was created from when a created session could not be started.
    • Other session activation failures retain their error details.
    • Session creation is refused when the host cannot enforce the requested egress rules, rather than creating a session with unenforceable network settings.

An activation that races min stop loses the race and its RPC fails
with the daemon's shutdown refusal, which surfaced as a raw RPC
chain (a refused ConfigureLoadout/CreateSession wrapping the
daemon-side 'Internal error: in shutdown') instead of a sentence.

The daemon now marks every shutdown refusal with a shared constant
in minimald-rpc, and the client matches on it to print one plain
line: the daemon was shutting down, no session was created, run
the command again once it is running. Other failures keep their
chain, wrapped as before. Applies to min session activate, min task
run, and the dashboard's activate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 18, 2026 03:17
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 18, 2026
@coderabbitai
coderabbitai Bot commented Oct 18, 2026 •
Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 1855dd91-4a68-4a0f-bb06-cf1fd7a14609
📥 Commits

Reviewing files that changed from the base of the PR and between 37aafe9 and 446d849.

📒 Files selected for processing: 4
  • crates/minimal/src/cmd/mod.rs
  • crates/minimal/src/cmd/session.rs
  • crates/minimald/src/box_manager.rs
  • crates/minimald/src/rpc.rs
🚧 Files skipped from review as they are similar to previous changes: 1
  • crates/minimald/src/box_manager.rs

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

📝 Walkthrough

The daemon now uses a shared shutdown-refusal message and rejects certain host-address declarations before session creation. Client handling maps exact refusals from CreateSession and ConfigureLoadout to distinct messages and preserves other RPC error context.

Changes: Session shutdown error handling

Layer / File(s) Summary
Daemon refusal and creation checks
crates/minimald-rpc/src/lib.rs, crates/minimald/src/box_manager.rs, crates/minimald/src/rpc.rs
The RPC crate defines SHUTDOWN_REFUSAL. Daemon shutdown guards use the constant. Session creation rejects specified host-address declarations that cannot be enforced when the host decides per box. The forced-shutdown test checks the refusal text in session lookup and CreateSession responses.
Exact client error mapping
crates/minimal/src/cmd/mod.rs
The client maps an exact, unwrapped shutdown refusal for CreateSession or ConfigureLoadout to a distinct message for each RPC. Tests cover both messages and verify that other errors retain existing handling.
Session RPC call sites
crates/minimal/src/cmd/session.rs, crates/minimal/src/dash/rpc.rs, crates/minimal/src/task.rs
These paths pass CreateSession and ConfigureLoadout transport failures to session_rpc_failed. Session activation still withdraws the registered box row before returning the failure.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: mitodrummer

Merge Risk: ⚪ Minimal · up to 446d8

This change replaces the raw RPC error chain with a plain-language message when an activation races a shutdown. Other failures keep their existing error context. No merge-blocking risk is evident from the supplied context.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title is concise, uses the required Conventional Commit format, and clearly describes the main change: reporting the min stop race in plain language.
Description check Passed The description explains the change and includes verification commands, test results, and the known pre-existing failure. It omits the required ## Checklist section and uses ## Verification instea…
Docstring Coverage Passed Docstring coverage is 94.44% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 7 files.
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: Description check

Explanation

The description explains the change and includes verification commands, test results, and the known pre-existing failure. It omits the required ## Checklist section and uses ## Verification instead of ## Testing, but it is otherwise substantially complete.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 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 hears the daemon say,
“The session cannot start today.”
Two RPCs name the shutdown race,
And other errors keep their place.
The burrow notes the shared reply,
Then hops along beneath the sky.

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

@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Oct 18, 2026
@norrietaylor norrietaylor changed the title fix: name the min stop race in plain language fix(minimal): name the min stop race in plain language Oct 18, 2026
The shutdown-race sentence no longer leads with the internal RPC name,
and the refusal marker matches only as the end of the daemon's message,
so the same words inside other text keep their chain.
…tarted

A ConfigureLoadout refused in shutdown follows a CreateSession that worked,
so 
8000
the text no longer claims no session was created: it says the session was
created but not started, and that the daemon deletes it when it starts again.

The daemon test now pins the refusal text end to end: the manager's error is
the marker, and a CreateSession after a forced shutdown ends its stderr with it.
@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry
minimal-foundry Bot commented Oct 18, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at 446d849b570a.

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 — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

Comment thread crates/minimal/src/cmd/mod.rs Resolved
The client reworded any error whose chain had a cause ending with the shutdown
marker, so an unrelated error ending in the same words was hidden. The wire
carries no structured refusal, so match the whole client-side error text for
this RPC exactly, and keep the original error in the chain under the plain
line. The daemon test now pins that exact stderr text.
@norrietaylor
Copy link
Copy Markdown
Member

/review

Wrapping the original error put the RPC name back into the printed chain. Return
the plain line alone again, and log the raw error at debug so the RPC name stays
in the logs. The exact match is unchanged.
@norrietaylor
Copy link
Copy Markdown
Member

/review

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

APPROVE withheld: 1 unresolved thread — minimal-foundry[bot] crates/minimal/src/cmd/mod.rs.

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 2 of 3 personas ran (security, supply-chain); did not complete: correctness.

@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 — advisory review

Verdict COMMENT — 1 finding, 1 inline.

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

Comment thread crates/minimal/src/cmd/mod.rs Resolved
@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 — every review thread is resolved; @norrietaylor closed the last one. The review of 1c02cf07ac5d withheld this approval on the threads open then. Posted as a comment, as the review itself was; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 18, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/review

2 similar comments
@norrietaylor
Copy link
Copy Markdown
Member

/review

@norrietaylor
Copy link
Copy Markdown
Member

/review

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

Approved on ARCH PASS at 1c02cf0.

@bryan-minimal bryan-minimal 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.

The match is deliberately exact: a single-link error whose whole text is the client's daemon-side wrapper around the shared SHUTDOWN_REFUSAL constant, and the tests pin the negative cases (the marker inside other text, another RPC's refusal, a wrapped one). The two sentences say what each lost race leaves behind, which is the useful part. The daemon-side test checks the exact stderr bytes the client keys on. One heads-up for whoever merges second: #2224 rewrites the DeleteSession handler around the third in shutdown site this PR changes, and adds two refusals of its own that should use the constant once both are in.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot
Copy link
Copy Markdown
Contributor Author

Commit pushed: 37aafe9

Generated by Worker iterate agent (side-repo-ops operator) · ⊞ 37K

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 19, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/review

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

Choose a re C690 ason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

@norrietaylor
norrietaylor merged commit abbdb31 into main Oct 20, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/fix/shutdown-race-rpc-failure-text-f7b77dd741d51601 branch October 20, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0