Skip to content

fix(minimal): ask only a VM host daemon to re-hold a box name before an attach - #2225

Merged
bryan-minimal merged 1 commit into
mainfrom
fix/2213-native-rehold
Oct 25, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
fix/2213-native-rehold

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Closes #2213.

What

Since #2149, every min session attach and min session exec of a named host_ip session on the native provider printed one warning to stderr:

warning: the box name hold could not be made (another verb's reply: Error { error: "the native daemon's control socket answers only the answerer verbs; boxes register over the daemon's RPC channels" }); the name answers as it did before

An exec's stderr was no longer the command's alone: a silent command came back with one line, a command writing 20 000 stderr lines came back with 20 001 (min-regress 794 D4, 797s).

Why

rehold_held_name_before_attach re-makes a host_ip session's name hold before any attach or exec, and sent the verb to whatever control socket sat beside the daemon's. On the native provider that is the native daemon's own control socket, which answers only the answerer verbs, so every call was a refusal, and the hold helper warns on a refusal. Nothing was held anyway: only a VM host daemon holds names, and the activation's hold already checks the provider kind.

The change

The re-hold takes the provider kind, as the activation's hold does, and does nothing unless the provider is minvmd. The kind rides through session_via_ssh from each command's arguments (attach, exec, run, the bare attach). One commit.

Test: the native daemon is asked for no hold (a_native_attach_reholds_nothing); the existing re-hold tests run as the VM host.

Evidence

Lab (min-regress, Cloud Hypervisor, local-minimald), this commit on main a3f2fa9 beside main itself, 2 rounds:

scenario main a3f2fa9 this PR
797s: an exec's stderr is the command's alone (true → 0 lines; echo e1 >&2 → e1 only) 0 / 12 10 / 10
794 D4: 20 000 stderr lines come back as 20 000 0 / 12 (20 001 every time) D4 passes in every cell; 794 as a whole is 2 / 10 because its D1/D2 duplex legs still hit the exec stall #2197 fixes, on both sides
789b (duplex stall, the #2197 bug) 5 / 6 2 / 4: the same stall, flaky on both sides, unrelated to this change
000 baseline 12 / 12 10 / 10

Lab job 00764, batch 2213fix-1, six distros × 2 rounds (a few cells skipped for lack of image space on the box, which is why the PR column has fewer cells); verdict REGRESSED (base passes, head fails): none.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Native attach and exec operations no longer send unnecessary name-hold requests for sessions that do not use the VM-backed provider.
    • VM-backed attach operations continue to send the required name-hold request, preserving their existing behavior.

@bryan-minimal
bryan-minimal requested a review from a team as a code owner October 15, 2026 16:20
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

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: beba01f6-8d49-428b-906d-fd0be91411ba
Commits

Reviewing files that changed from the base of the PR and between 5e3b7ad and b46aa47.

Files selected for processing: 1
  • crates/minimal/src/cmd/boxes/vm_host.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

Session attach, exec, and run paths pass the daemon provider kind to the pre-attach name re-hold helper. The helper skips the hold request for providers other than Minvmd. Tests cover native-provider and VM-provider cases.

Changes: Session name re-hold

Layer / File(s) Summary
Provider-aware re-hold and call-site wiring
crates/minimal/src/cmd/list.rs, crates/minimal/src/cmd/session.rs, crates/minimal/src/cmd/boxes/attach.rs, crates/minimal/src/cmd/boxes/vm_host.rs
Attach, exec, and session-run paths pass the provider kind to the re-hold helper. The helper returns without requesting a name hold unless the provider is Minvmd. Tests verify that the Minimald path sends no hold request and update VM-host scenarios to pass Minvmd.

Priority: Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: mitodrummer

Merge Risk: Minimal · up to b46aa

The provider gate preserves VM name re-holds while avoiding native-daemon requests. No issue identified here needs resolution before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title uses the required Conventional Commit format and clearly describes the provider-specific re-hold fix.
Description check Passed The description explains the problem, rationale, implementation, linked issue, tests, and lab evidence. It omits the template headings and checklist items, but it provides the required information and…
Linked Issues check Passed [#2213] The issue requires that named host_ip attach and exec on the native provider stop sending the VM-host name-hold request to the native daemon, so command stderr stays the child's. The whole-P…
Out of Scope Changes check Passed The whole-PR changes are: a provider-kind argument on rehold_held_name_before_attach and its gate (vm_host.rs); the provider-kind parameter on box_via_ssh and its call sites (attach.rs, session.rs…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files.
Full details: Description check

Explanation

The description explains the problem, rationale, implementation, linked issue, tests, and lab evidence. It omits the template headings and checklist items, but it provides the required information and is mostly complete.

Full details: Linked Issues check

Explanation

[#2213] The issue requires that named host_ip attach and exec on the native provider stop sending the VM-host name-hold request to the native daemon, so command stderr stays the child's. The whole-PR diff (merge base e40e028 to head b46aa47) gates rehold_held_name_before_attach in crates/minimal/src/cmd/boxes/vm_host.rs. The function now takes kind: paths::ProviderKind and returns before any request unless kind == paths::ProviderKind::Minvmd. This matches the activation hold's provider check, which the issue names as the model. The issue lists the provider-kind gate as an acceptable fix. The session.rs diff shows cmd_attach, cmd_exec, and cmd_session_run each pass daemon_provider_kind(global) to box_via_ssh, so the kind reaches the re-hold path for each affected command. The bare-command attach path in list.rs passes the kind as well, per the supplied summary. The issue's secondary suggestion to downgrade refusal logging to debug, once per process, is not required, because the native path no longer sends the refused request. The issue's suggested test (an exec on the native provider adds nothing to stderr) is covered in substance by a_native_attach_reholds_nothing, which asserts that the native daemon receives no hold request. The existing re-hold tests now pass ProviderKind::Minvmd and keep their coverage of the VM-host path. Limitation: the attach.rs blob could not be read at head, so the body of box_via_ssh was not read directly. Its forwarding of the kind rests on the session.rs call sites, the changed rehold_held_name_before_attach signature, and the supplied summary. The incremental diff since the previous reviewed heads was also unavailable, so this verdict rests on the whole-PR state at head.

Full details: Out of Scope Changes check

Explanation

The whole-PR changes are: a provider-kind argument on rehold_held_name_before_attach and its gate (vm_host.rs); the provider-kind parameter on box_via_ssh and its call sites (attach.rs, session.rs, list.rs, per the supplied summary and the session.rs diff); and the test changes in vm_host.rs. Each change serves the #2213 fix. The test edits only add the new kind argument to existing calls and add one native-provider test. No unrelated behavior, refactoring, or documentation change was identified in the readable evidence. The attach.rs and incremental diffs could not be read, so the assessment relies on the supplied summary for those files.

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 checks the provider's name,
For Minvmd, the hold stays in the game.
For native paths, no request goes through,
The tests check both provider views.
Then off the rabbit hops, ears bright and clear.

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

@minimal-foundry

minimal-foundry Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Approved: no findings at b46aa4711142.

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.

correctness

minimal-review — approved

Verdict APPROVE — No findings.

security

minimal-review — approved

Verdict APPROVE — No findings.

supply-chain

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 Oct 15, 2026

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

The provider-kind gate is correct, and the new test does exercise it: with the kind dropped, a named host_ip record would send a hold. One merge-time break below.

Comment thread crates/minimal/src/cmd/session.rs Resolved
@bryan-minimal

Copy link
Copy Markdown
Member Author

Rebased onto main after #2201 (the sessions crate is boxes now): the only changes are the crate path in the lines this PR adds. Built, linted and tested on the lab box against 6fb3c55.

@bryan-minimal
bryan-minimal force-pushed the fix/2213-native-rehold branch from cff8b3c to 2232619 Compare October 15, 2026 20:15

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

security

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 1 unresolved thread — mitodrummer crates/minimal/src/cmd/session.rs. No findings.

supply-chain

minimal-review — approved

Verdict APPROVE — No findings.

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

@minimal-foundry minimal-foundry Bot removed the review:approved minimal-review approved the current head label Oct 15, 2026
@norrietaylor

Copy link
Copy Markdown
Member

/arch-review

2 similar comments
@norrietaylor

Copy link
Copy Markdown
Member

/arch-review

@norrietaylor

Copy link
Copy Markdown
Member

/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 change conforms to §7.1 of the networking design. A native node's host_ip sockets already sit on host loopback, so the native daemon has no name hold to re-make. Only the VM host holds names. The re-hold now runs only for Minvmd, the same key as the activation's hold. All four session_via_ssh callers pass that kind. No conditions.

Ruled at 2232619 against gominimal/arch@3dab1097cda1 by claude-opus-5-5.

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

The fix is right: rehold_held_name_before_attach now returns early unless the daemon is minvmd, the VM host. That matches what host_asks_box and the activation's hold already check, all four callers pass daemon_provider_kind(global), and a_native_attach_reholds_nothing fails without the early return.

Requesting changes for the rebase only. The branch conflicts with main in cmd/list.rs and cmd/session.rs. Since #2479 and the module split, session_via_ssh is box_via_ssh in crates/minimal/src/cmd/boxes/attach.rs, and rehold_held_name_before_attach lives in crates/minimal/src/cmd/boxes/vm_host.rs. Main still passes no provider kind there, so the change is still needed; re-apply it in those files rather than resolving hunk by hunk, then let every lane run again.

@bryan-minimal
bryan-minimal force-pushed the fix/2213-native-rehold branch from 2232619 to 5e3b7ad Compare October 23, 2026 15:49
@bryan-minimal

Copy link
Copy Markdown
Member Author

Re-applied onto main as one commit (5e3b7ad), as you asked, rather than resolved hunk by hunk: box_via_ssh (attach.rs) takes the provider kind and every caller passes daemon_provider_kind(global); rehold_held_name_before_attach (vm_host.rs) returns early unless the daemon is Minvmd; a_native_attach_reholds_nothing rides in vm_host.rs with the other re-hold tests. Eight re-hold tests pass on the box, clippy clean; the lanes run on this head.

@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 Oct 23, 2026
…an attach or an exec

The native daemon's control socket answers only the answerer verbs, so
asking it to re-hold a name was a refusal warned on every native attach
and exec's stderr (#2213). The re-hold is for Minvmd alone, as the
activation's hold is; every caller of box_via_ssh passes the daemon's
provider kind. Re-applied onto main's split CLI files (#2479, #2480).
@bryan-minimal
bryan-minimal force-pushed the fix/2213-native-rehold branch from 5e3b7ad to b46aa47 Compare October 25, 2026 17:17

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

@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 3f87f6d Oct 25, 2026
36 checks passed
@bryan-minimal
bryan-minimal deleted the fix/2213-native-rehold branch October 25, 2026 18:19
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

3 participants