Skip to content

FEAT-013 T059: wire production remove/recreate tmux backends (remove no-ops in prod) #33

@brettheap

Description

@brettheap

Surfaced while finishing FEAT-013. The M6/M7 remove/recreate handlers read `ctx.managed_tmux_kill_fn` / `ctx.managed_route_cleanup_fn` / `ctx.managed_log_detach_fn`, but `daemon.py` never sets them, so they default to `None`. `service.remove_pane` only acts `if tmux_kill_fn is not None` — meaning in production a remove marks the `managed_pane` row `removed` but leaves the real tmux pane alive and routes/logs uncleaned (FR-010 violation). T042/T048 are checked complete but the side-effects are a no-op in the running daemon.

Scope

  • Build the three backends: kill via the FEAT-004 adapter `kill_pane` (added in T057), route cleanup via FEAT-010, log detach via FEAT-007.
  • Set them on `DaemonContext` at boot; thread through M6/M7.

Design decision to resolve

`managed_pane` stores `tmux_pane_index`, not the `%N` pane id that `kill_pane` targets. Either join `managed_pane.agent_id` → agent-registry `pane_composite_key.tmux_pane_id` to recover `%N`, or add an index-targeted kill verb. (The real-bench smoke should validate whichever is chosen.)

Verification

  • Unit tests with `FakeTmuxAdapter`.
  • Real `py-bench` smoke: remove kills the underlying pane + cleans routes/logs; recreate links predecessor + spawns a fresh pane.

Tracked in `specs/013-managed-session-lifecycle/tasks.md` as T059.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions