8000 T31 — Keep terminal and detached execs past a client loss, stop one exec, and honour exec_enabled · Issue #2406 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T31 — Keep terminal and detached execs past a client loss, stop one exec, and honour exec_enabled #2406

Closed

Description

@mitodrummer

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, not setpgid)
    • crates/minimald/src/exec/tests.rs: tests
    • cargo nextest run -p minimald pty_or_detached_exec_survives_client_loss
    • cargo nextest run -p minimald stop_exec_ends_process_group
    • cargo nextest run -p minimald exec_disabled_refuses_exit5
    • 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
    • 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:

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

Activity

  1. added
    kind:taskA task the plan skill rendered; the body carries ## Task
    size:M200 to 500 net lines; one PR
    model:standardA standard model: work that needs care, or routine work that is large
    on Oct 19, 2026
  2. minimal-foundry commented on Nov 2, 2026

    @minimal-foundry
    Contributor

    Done. #2874 merged.

    branch agent/2406-keep-terminal-and-detached-execs-past-a-client-l · epic #2236 · PR #2874

    round outcome job
    1 pushed a2c497e7
    3 pushed 001db2d8
    4 pushed 8c50e98d

    Updated 2026-11-04T04:18:11.103Z.

  3. mitodrummer commented on Nov 2, 2026

    @mitodrummer
    MemberAuthor

    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 attached min://exec) gets an exec id but is never put in EXECS, because only start_managed_exec calls register_exec. A min://exec/wait on 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 its spawn_blocking read parked while a descendant holds the PTY or pipe.
  4. added
    needs-humanAn agent handed off; a human must act, then clear this label. Set by defer and handoffs.
    on Nov 3, 2026
  5. removed
    needs-humanAn agent handed off; a human must act, then clear this label. Set by defer and handoffs.
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:taskA task the plan skill rendered; the body carries ## Taskmodel:standardA standard model: work that needs care, or routine work that is largesize:M200 to 500 net lines; one PR

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0