Repository navigation
fix(minimal,minimal-client,minimald): a resume that minvmd refuses shows minvmd's reason, and the - #3482
Conversation
Without one, ssh exits 255, the client reads that as a dropped connection, and its blind terminal unwind moves the cursor over the refusal text.
…reason A refused box row resume was a warn line, and the attach went on to a launch refusal that hid the cause. It is now a HostRefusal error that carries the VM host's reason.
Pin that a resume the VM host refuses fails the attach with its reason, and that a refused attach writes no blind unwind over its error line.
…hat-minvmd-refuses-shows-minvmd-s-reas
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
/revise Review of head 09c548c. Fix these. Keep every change inside the plan's files, plus
|
…hat-minvmd-refuses-shows-minvmd-s-reas # Conflicts: # crates/minimald/src/connection.rs
minvmd's other refusals, and the parse refusal of a minvmd from before the resume, stay a warn line as before. The reason prints once, after the box name, and logs at debug.
The test drives a refused attach through the SSH handler and checks that the exit status arrives before the channel closes.
Also show in the unwind test what the daemon's exit status prevents: a refusal that ends with ssh's 255 gets the blind unwind after it.
|
Round 2 of 10 on a /revise note, pushed as Resolved conflicts in:
Verify Outside the task's
Converted to a draft: something above needs a person before review. When minvmd refuses to give an own_ip box an address, for example with the DNS service stopped, bare min, min box attach and min box exec fail and print 'box : the running VM cannot reach Minimal's DNS service for box names, ... run Notes from the agent: Conflict round: the merge of origin/main conflicted only in crates/minimald/src/connection.rs. The resolution keeps this branch's exit status for every refusal (AttachError::exit_code returns u32). It also takes main's refusal line 'Cannot attach to the box: ' (BCLI-068), with main's attach_refusal_line test. The REFUSAL constant in crates/minimal/src/tests.rs now uses that new text. Directive items: (1)+(2) resume_box_row_at now fails only on a reply that starts with 'could not give the box an address: ' (new pub const NO_ADDRESS_REFUSAL). All other BoxControlReply::Error replies, including a parse error from a minvmd from before ResumeBox, fall back to the earlier warn line and Ok(false). The doc comments now say this. (3) The tracing::warn on the refusal is now debug. HostRefusal carries the reason without the prefix, and the context is only 'box '. The printed text is 'box web: the running VM cannot reach ...'. (4) The exit code stays 1. This round documents it in docs/reference/cli-min.md under |
|
Reviewed: no findings; approval withheld, 1 thread unresolved at APPROVE withheld: 1 unresolved thread — minimal-foundry[bot] crates/minimal-client/src/attach.rs:853. Resolving the last thread releases the approval on this head. Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none seen in the touched hunks. |
| /// The prefix minvmd puts on its refusal to give a box an address | ||
| /// (`allocate_box_address_keeping`). The reason after it names the step the | ||
| /// user can run, so a resume that it refuses fails the attach (NET-138). | ||
| pub const NO_ADDRESS_REFUSAL: &str = "could not give the box an address: "; |
There was a problem hiding this comment.
LOW · correctness · confidence 0.60 · in NO_ADDRESS_REFUSAL
NO_ADDRESS_REFUSAL copies the literal that minvmd writes in allocate_box_address_keeping (crates/minvmd/src/control.rs:2437). The client uses it to choose between failing the attach and a warn line. If someone rewords the minvmd text, the resume silently goes back to the old warn-and-continue path. The new client test builds its wire text from the constant, so it cannot catch this drift. Share the constant, or add a test in minvmd that asserts the prefix. Also, that prefix covers every allocator refusal (quarantine, range probe), not only the DNS case. The doc comment says each reason names a step the user can take. Check that this holds.
What the reviewer checked
control.rs:2437 error: format!("could not give the box an address: {reason}"); attach.rs:843 pub const NO_ADDRESS_REFUSAL: &str = "could not give the box an address: ";
Hand this to an agent
Act on a code-review finding.
File: crates/minimal-client/src/attach.rs
Lines: 840-843
Category: correctness
Severity: low (reviewer confidence 0.60)
Finding:
`NO_ADDRESS_REFUSAL` copies the literal that minvmd writes in `allocate_box_address_keeping` (crates/minvmd/src/control.rs:2437). The client uses it to choose between failing the attach and a warn line. If someone rewords the minvmd text, the resume silently goes back to the old warn-and-continue path. The new client test builds its wire text from the constant, so it cannot catch this drift. Share the constant, or add a test in minvmd that asserts the prefix. Also, that prefix covers every allocator refusal (quarantine, range probe), not only the DNS case. The doc comment says each reason names a step the user can take. Check that this holds.
First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.
👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.
There was a problem hiding this comment.
Addressed in 6e1096f8b808: Added resume_refusal_carries_the_vm_host_reason_prefix_minvmd_writes, which reads minvmd's control.rs and fails on drift. Sharing the constant needs minimald-rpc and minvmd, outside this task's layers. The doc comments no longer claim that every allocator reason names a step.
…hat-minvmd-refuses-shows-minvmd-s-reas
NO_ADDRESS_REFUSAL copies the literal minvmd writes. A test now reads minvmd's control.rs and fails when the two drift. The doc comments no longer claim that every allocator reason names a step for the user.
|
Round 3 of 10 on the runtime's review findings, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
With the DNS service stopped, bare min and min box attach on a stopped own_ip box fail with minvmd's reason, which names min finalize-install --show, and the error line stays on screen after the terminal unwind. The client prefix that selects this refusal is now pinned to minvmd's source by a test. Notes from the agent: Revise round 3. The review asked to share NO_ADDRESS_REFUSAL with minvmd. That needs a constant in minimald-rpc and an edit in crates/minvmd/src/control.rs, and both are outside this task's layers. In its place, a test in crates/minimal-client/src/box_registration.rs reads crates/minvmd/src/control.rs and fails when minvmd no longer writes the prefix. A later task can move the constant into minimald-rpc and remove that test. The doc comments now say that the allocator reasons include a full or quarantined range and a failed range bind check. Some of these reasons only state the situation and name no step. A resume with no address cannot go on, so the attach still fails with the reason. |
|
Round 4 of 10 on a failed check suite: the coder changed nothing. A person needs to take it from here. |
|
Round 5 of 10 on a failed check suite: the coder changed nothing. every commit this round put on the branch above 6e1096f is a merge of the base branch, so it carries no work of its own |
|
Round 6 of 10 on a failed check suite: the coder changed nothing. every commit this round put on the branch above e49b92b is a merge of the base branch, so it carries no work of its own |
norrietaylor
left a comment
There was a problem hiding this comment.
Approved at e49b92b. Only the no-address refusals are fatal, an older minvmd's reply stays a warning, the reason prints once in plain words, exit 1 is documented, the daemon's exit-status fix has a handler test, and the refusal prefix is checked against minvmd's source. Low leftovers are in 3507 (follow-up).
Defect
Fixes #3477
crates/minimal-client/src/attach.rscrates/minimal-client/src/box_registration.rscrates/minimal/src/cmd/boxes/attach.rscrates/minimal/src/cmd/boxes/vm_host.rscrates/minimald/src/connection.rscrates/minimald/src/box_actor/attach.rscrates/minimal/src/tests.rsTask marker
Proof
When minvmd refuses the resume of a stopped own_ip box, for example because the DNS service is stopped, bare min and min box attach (and min box exec, and the dashboard attach) now end before they take the terminal. They print
error: the running VM refused to restore the network addresses of box <name>: <minvmd's reason>, and that reason namesmin finalize-install --show. A refusal from the in-VM daemon now sends an exit status, so ssh does not end with 255, and no blind cursor restore moves the cursor over the error line.Notes from the agent: Nobody ran the proof against a live VM with the DNS service stopped. Fake VM hosts and a fake terminal pin it in the tests. New printed text:
the running VM refused to restore the network addresses of box <name>, the prefix to minvmd's reason. Daemon attach refusals other than a refused resume now end with exit status 1. Before this change ssh ended with 255. A resume refusal is now a typed error, minimal_client::box_registration::HostRefusal, and it fails min box exec and the dashboard attach too, through their existing?. A minimald older than this branch still sends no exit status, and the client then still writes its blind unwind on 255. This task did not change interactive_attach code for that case. Only its doc comment changed, because TERMINAL_UNWIND lives in crates/minimal/src/attach.rs, which is outside the layers. Clippy on minimal, minimald and minimal-client with --all-targets is clean. Other tests run: the resume tests in minimal-client and minimal, minimal dash::rpc, and minimald connection::. All of them pass.Tests
cargo nextest run -p minimal-client resume_refusal_carries_the_vm_host_reasoncargo nextest run -p minimal resume_refused_by_vm_host_names_its_reasoncargo nextest run -p minimald attach_refusal_sends_an_exit_statuscargo nextest run -p minimal attach_error_stays_on_screen_after_the_unwindVerify
min task run agent-verifyexited 101, so this PR is a draft.Base
The base branch moved while the coder worked; it was merged in before the tests ran.