Repository navigation
Closed
Labels
kind:taskA task the plan skill rendered; the body carries ## TaskA task the plan skill rendered; the body carries ## Taskmodel:standardA standard model: work that needs care, or routine work that is largeA standard model: work that needs care, or routine work that is largesize:M200 to 500 net lines; one PR200 to 500 net lines; one PR
Description
Task
| slice | size | difficulty | model | who | estimated lines |
|---|---|---|---|---|---|
| Exec into a box | M | needs care | standard | an agent | 480 (220 code, 260 tests) |
A terminal exec survives its client; stopping one leaves the box.
Covers:
- BOX-150
- BOX-151
- BOX-152
- BOX-153
Layers:
- exec:
- crates/minimald/src/exec.rs: survival; exec_enabled refusal
- crates/minimald/src/exec/process.rs: stops one exec
- crates/minimald/src/nsenter.rs: a tty exec's PTY becomes its controlling terminal (
setsid+TIOCSCTTY, notsetpgid) - crates/minimald/src/exec/tests.rs: tests
cargo nextest run -p minimald pty_or_detached_exec_survives_client_losscargo nextest run -p minimald stop_exec_ends_process_groupcargo nextest run -p minimald exec_disabled_refuses_exit5cargo nextest run -p minimald tty_exec_pty_is_controlling_terminal
- events:
- crates/boxes/src/events.rs: exec event kinds
- crates/minimald/src/rpc.rs: exec stop handler
cargo nextest run -p minimald exec_events_carry_principal_argv_pty_code
Widened by the maintainer (2026-11-02), from arch's review of T30 (#2843): a tty exec's PTY is not its controlling terminal (the nsenter shim calls setpgid, not setsid with TIOCSCTTY), so Ctrl-C does not reach the exec and an attach relays no window-size change. This task owns that, plus the principal and argv fields on exec_started/exec_exited, already covered by exec_events_carry_principal_argv_pty_code.
Waits on:
- T30 — Run a command in a box with a terminal or detached, under an exec id #2404
- T2 — Write each box's lifecycle events where only the daemon can reach #2389
Plan block
### T31 — Keep terminal and detached execs past a client loss, stop one exec, and honour exec_enabled
slice: S7
kind: task
covers: BOX-150, BOX-151, BOX-152, BOX-153
size: M
est: 220 code, 260 tests
executor: agent
difficulty: needs care
model: standard
diagnostics: daemon log names exec stops and refusals
observability: exec events carry argv, flag and code
layers:
- exec:
- crates/minimald/src/exec.rs: survival; exec_enabled refusal
- crates/minimald/src/exec/process.rs: stops one exec
- crates/minimald/src/nsenter.rs: tty exec PTY is its controlling terminal
- crates/minimald/src/exec/tests.rs: tests
test: cargo nextest run -p minimald pty_or_detached_exec_survives_client_loss
test: cargo nextest run -p minimald stop_exec_ends_process_group
test: cargo nextest run -p minimald exec_disabled_refuses_exit5
test: cargo nextest run -p minimald tty_exec_pty_is_controlling_terminal
- events:
- crates/boxes/src/events.rs: exec event kinds
- crates/minimald/src/rpc.rs: exec stop handler
test: cargo nextest run -p minimald exec_events_carry_principal_argv_pty_code
produces: none
consumes:
- crates/boxes/src/events.rs
proof: A terminal exec survives its client; stopping one leaves the box.
depends on:
- blocked by #2404
- blocked by #2389
Reacted by minimal-foundry
Metadata
Metadata
Assignees
Labels
kind:taskA task the plan skill rendered; the body carries ## TaskA task the plan skill rendered; the body carries ## Taskmodel:standardA standard model: work that needs care, or routine work that is largeA standard model: work that needs care, or routine work that is largesize:M200 to 500 net lines; one PR200 to 500 net lines; one PR
Activity
minimal-foundry commentedon Nov 2, 2026
Done. #2874 merged.
branch
agent/2406-keep-terminal-and-detached-execs-past-a-client-l· epic #2236 · PR #2874a2c497e7001db2d88c50e98dUpdated 2026-11-04T04:18:11.103Z.
mitodrummer commentedon Nov 2, 2026
Two more items from the review of #2843 (T30), in this task's exec-lifecycle scope:
serve_exec_wait(crates/minimald/src/exec/bridge.rs ~2264): an attached exec (a shell, an argv or an attachedmin://exec) gets an exec id but is never put inEXECS, because onlystart_managed_execcallsregister_exec. Amin://exec/waiton a still-running attached id then answers that the daemon did not start it, which is false. Register attached execs too, or answer "running, attached".supervise_managed_exec(crates/minimald/src/exec/process.rs ~1249): a detached exec's output pump is never aborted. If a descendant keeps the pipe open after the exec ends, the pump task, its descriptor and its transcript file stay for the life of the daemon. Bound the detached pump, or abort it when the box is reaped. The review also found that an aborted pump leaves itsspawn_blockingread parked while a descendant holds the PTY or pipe.