8000 fix(minimal): report an already-destroyed session instead of failing by gominimal-aw-bot[bot] · Pull Request #2315 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal): report an already-destroyed session instead of failing - #2315

Merged
norrietaylor merged 4 commits into
mainfrom
inbox-patch/destroy-race-already-destroyed-628e3bf7e0a65d56
Oct 18, 2026
Merged

norrietaylor merged 4 commits into
mainfrom
inbox-patch/destroy-race-already-destroyed-628e3bf7e0a65d56

Conversation

@gominimal-aw-bot
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABX3vZaA

Two concurrent min session destroy <name> calls race in the daemon: the
loser's DestroySession comes back "no session with ID ...", which the CLI
surfaced as a hard error — a failure reported for a session in exactly the
state asked for. Thread --force into destroy_session and treat that
answer as the goal state: under --force, print "Session (name) is
already destroyed" and exit 0; without it, still fail, but naming the
session. destroy_all_sessions passes force through, so a mid-loop race
loser is not counted a failure. Other daemon errors are unchanged.

Verification

  • cargo fmt --all --check --manifest-path target/Cargo.toml — clean.
  • cargo clippy --workspace --all-targets --locked --manifest-path target/Cargo.toml -- -D warnings — clean.
  • cargo test --locked --manifest-path target/Cargo.toml -p minimal — 524 passed, 1 failed: tests::legacy_network_spellings_parse_with_hint, a pre-existing failure reproduced identically on the unmodified checkout (fd-2 capture quirk in the test's stderr pipe, unrelated to this change); the new test and the connection-inventory test it registers in both pass.
  • Behavioural proof: the new harness test a_destroy_of_an_already_destroyed_session_reports_it destroys a session twice through a real in-process daemon — the second destroy is the race's loser — asserting the forced re-destroy reports "already destroyed" and succeeds, and the unforced one fails naming the session.

Two concurrent `min session destroy` calls race inside the daemon:
the loser's DestroySession comes back "no session with ID ...",
which the CLI surfaced as a hard error — reporting a failure for a
session that is in exactly the state asked for.

Thread the destroy's `--force` into destroy_session and treat that
answer as the goal state: under `--force` the destroy prints
"Session <name> is already destroyed" and exits 0; without it, the
command still fails, but with wording that names the session rather
than forwarding the daemon's internals. destroy_all_sessions passes
its force through, so a mid-loop race loser is no longer counted a
failure. Any other daemon error is unchanged.

Proven by a harness test that destroys a session twice.

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:19
@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

Warning

Review limit reached

  • Run on-demand review

This review includes 7 billable files and costs up to $1.75.

Or wait 53 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 5188e051-50e7-46ca-9fe6-f47c1ed4c29b
📥 Commits

Reviewing files that changed from the base of the PR and between 11b0b44 and ffed3ed.

📒 Files selected for processing: 7
  • crates/minimal/src/cli.rs
  • crates/minimal/src/cmd/session.rs
  • crates/minimal/src/tests.rs
  • crates/minimald-rpc/src/lib.rs
  • crates/minimald/src/box_manager.rs
  • crates/minimald/src/rpc.rs
  • docs/reference/cli-min.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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: report an already-destroyed session instead of failing fix(minimal): report an already-destroyed session instead of failing Oct 18, 2026
…ucceed

The -f help text and the session destroy reference now say that a forced
destroy treats an already-destroyed session as success, and that an
unforced one fails naming it. The destroy_session comment no longer
describes the forced path as the general one.
@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 ffed3ed7027e.

Nothing to do.

Clobber: none: git log on the changed files shows no recent fix reverted.

@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 (security, supply-chain); did not complete: correctness.

Comment thread crates/minimald/src/box_manager.rs Resolved
…ed lead

ConfigureLoadout, FinalizeSession, RenameSession and AbortSession now build their
not-found text from minimald_rpc::UNKNOWN_SESSION_ID_LEAD, as destroy does, so the
wire text cannot drift from what the client matches. The message bytes are 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/minimald/src/box_manager.rs:1439.

minimal-review — advisory review

Verdict COMMENT — No findings.

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

@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 ffed3ed7027e 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 appro 8000 ved the current head label Oct 18, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/review

1 similar comment
@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 ffed3ed.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit c5b6dcd Oct 18, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/destroy-race-already-destroyed-628e3bf7e0a65d56 branch October 18, 2026 22:18
@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 race's loser is told the session is gone, and the change reads that one answer through a shared constant on both sides rather than two spellings, which is the right fix. Under --force that is the goal state and a success; without it, the error names the session. The harness test covers both. One heads-up for whoever merges second: #2224 rewrites the DeleteSession handler in box_manager.rs around the line this PR touches, so the two will need a small rebase against each other, and #2224's side should pick up UNKNOWN_SESSION_ID_LEAD when it does.

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