Repository navigation
T11 — Tasks leave exited boxes, end to end - #3085
Conversation
A task run's client goes away mid-task. The task box ends by itself as exited with the task's code 3, keeps its exited event, and a new client reads its whole output over ReadLog. The daemon log names the box's end and its code.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: every review thread resolved at @agent-137 resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The daemon test conforms to architecture.md line 499. A task box outlives its dropped client, ends exited with code 3, and keeps its event and its output. The CLI layer is not delivered, and no issue owns it. The PR body still says Closes #2407, so merging closes the only issue for the undone work. Make the change in C1: change the body to Part of #2407, and file and name an issue for the CLI test and its test-support seam. No code change is necessary.
Ruled at fe68a6a against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
/review |
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @agent-137 closed the last one. The review of fe68a6a322f1 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
There was a problem hiding this comment.
Reviewed fe68a6a against T11's plan block. The daemon layer's test task_box_exits_with_code_and_output_after_client_drop proves the plan's proof end to end in the daemon: a task box whose client drops mid-run exits by itself with code 3, keeps an exited event with exit_code 3, a new client reads its whole output (before and after the drop, stdout and stderr), and the daemon log names the end with exit_code=3 and the log read. Test-only change. The CLI layer is deferred to #3089 per arch C1, and the body says Part of #2407.
T11 — Tasks leave exited boxes, end to end
slice: S2
kind: integration
covers: none
size: M
est: 60 code, 240 tests
executor: agent
difficulty: routine
model: standard
diagnostics: daemon log names task box's exit and output
observability: one span covers task run end to end
layers:
- daemon:
- crates/minimald/src/box_runtime/tests.rs: tests
test: cargo nextest run -p minimald task_box_exits_with_code_and_output_after_client_drop
- cli:
- crates/minimal/src/tests.rs: tests
test: cargo nextest run -p minimal task_run_dropped_client_reads_back_exited_box
produces: none
consumes: none
proof: run a task that sleeps and then exits 3, close the terminal mid-run, and see the box listed as exited with code 3, its events and its output still readable.
depends on:
- blocked by #2398
- blocked by #2399
- blocked by #2401
- blocked by #2405
- blocked by #2402
Proof
Partly delivered. In the daemon test, a task run starts a task box, and its client drops mid-run. The task then writes more output and exits 3. The box ends by itself as exited with exit code 3. It keeps its exited event with exit_code 3, and a new client reads its whole output (before and after the drop, stdout and stderr) over the ReadLog stream. The CLI half (min box list, min box show and min box events read the exited box) has no test on this branch. The notes say why. Residual: #3089 (the CLI test and the
test-supportmock launcher seam).Notes from the agent: Daemon layer: done. The test task_box_exits_with_code_and_output_after_client_drop is in crates/minimald/src/box_runtime/tests.rs. It copies two small helpers (task box creation, ReadLog read) because the equivalents in crates/minimald/src/box_actor/tests.rs are private. Diagnostics: the test checks that the daemon log line 'task box ende 8000 d: its entrypoint returned' names the box id and exit_code=3, and that the daemon logs the read of the box's output. Observability: the test does not check a span. The existing span session.host.entrypoint_exit covers the box end, and no code change was in scope to add a span.
CLI layer: not done, and nothing committed for it. The test task_run_dropped_client_reads_back_exited_box cannot pass with the layers as cut. The minimal crate's tests run minimald::test_harness::TestServer, but there minimald compiles without cfg(test). So the box actor uses the real SandboxLauncher, and the task's entrypoint fails at launch with 'session spawn: no such package: base' (the baseline packages base, coreutils and socat are not in the test state dir). I observed this when I ran the test. MockLauncher and the test session_launcher are #[cfg(test)] only: crates/minimald/src/box_runtime.rs lines 48 and 58 (mod mock), and crates/minimald/src/box_actor/launcher.rs (the two session_launcher variants), plus other #[cfg(test)] sites in box_runtime.rs. To do this layer, a task must expose the mock launcher under the test-support feature, in minimald …[truncated]
Tests
cargo nextest run -p minimald task_box_exits_with_code_and_output_after_client_dropcargo nextest run -p minimal task_run_dropped_client_reads_back_exited_boxVerify
min task run agent-verifypassed ([tasks.verify]).Part of #2407