Repository navigation
fix(minimal,minimald): a create that the daemon refuses at BOX-160 admission makes min exit 3, not 1 - #3694
Conversation
The CreateSession reply carried the refusal's text but not its code, so min exited 1 for a spec its built-in root excludes. A new admission_refusal helper gives the code, and the reply carries it.
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
|
Approved: 1 finding, none above this repo's threshold at Nothing to do. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This change conforms to the design. A create that the daemon refuses at admission now ends min with exit 3. The Exit codes table in architecture.md gives exit 3 to an invalid Box Spec. The helper sits beside the refusal types in box_manager.rs, and the reply arm comes before the InvalidInput arm. The refusal still fails closed, and its text and log record do not change.
Ruled at 6fa05bb against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
| Err(e) if crate::box_manager::admission_refusal(&e).is_some() => { | ||
| CreateSessionReply::Err { | ||
| error: e.to_string(), | ||
| code: None, | ||
| exit_code: crate::box_manager::admission_refusal(&e), | ||
| hint: None, | ||
| } | ||
| } |
There was a problem hiding this comment.
NIT · correctness · confidence 0.50 · in serve_create_session
The guard and the body both call admission_refusal(&e). Bind the code once, or use the unenrolled_refusal shape with expect. This is only duplicated work.
What the reviewer checked
Err(e) if admission_refusal(&e).is_some() => { ... exit_code: admission_refusal(&e) ...
Hand this to an agent
Act on a code-review finding.
File: crates/minimald/src/rpc.rs
Lines: 675-682
Category: correctness
Severity: nit (reviewer confidence 0.50)
Finding:
The guard and the body both call `admission_refusal(&e)`. Bind the code once, or use the `unenrolled_refusal` shape with `expect`. This is only duplicated work.
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.
Disputed as non-blocking: calling admission_refusal(&e) twice is a cheap downcast on the refusal path only, and binding it would mean restructuring the match guard. Left as is for this fix.
Follow-up
Fixes #3688
crates/minimald/src/box_manager.rscrates/minimald/src/rpc.rscrates/minimal/src/tests.rsTask marker
Proof
A session create whose spec sets io.pty_enabled to false passes the client check, and the daemon refuses it at admission. The CreateSession reply now carries exit_code 3, so min ends with exit code 3 and prints the daemon's refusal text, which names
io.pty_enabledand says no box was created.Notes from the agent: admission_refusal returns Option, not i32, because CreateSessionReply::Err carries exit_code as Option. The new reply arm sits before the InvalidInput arm and sets code and hint to None. The refusal text is unchanged. cargo clippy -p minimald --all-targets is clean. I did not run clippy for the minimal crate.
Tests
cargo test -p minimald admission_refusal_reply_carries_exit_codecargo test -p minimal daemon_only_admission_refusal_exits_3Verify
min task run agent-verifytimed out after 1800s, so this PR is a draft.Closes #3313 (the original issue this task was triaged from).