Skip to content

Design: define safe cleanup semantics for leftover issue worker tmux sessions #201

@devkade

Description

@devkade

Description

Scheduled issue-cron work for issue #198 / PR #200 left Ilchul/Kapi tmux runtime sessions that were not safely closed through the current workflow control plane.

This appears to be a runtime lifecycle / cleanup contract gap rather than an implementation blocker in PR #200.

Evidence

  • Completed PR: feat: add PhasePreset schema contract #200
  • Issue context: Design: define full-lifecycle PhasePreset and runtime spec schemas #198
  • Remaining tmux sessions observed after PR merge:
    • issue-198-phase-preset-worker
    • issue-198-phasepreset-runtime-schema
  • issue-198-phase-preset-worker registry/status evidence:
    • status: active
    • phase: planning
    • piLaunch.status: completed-output-present after probe
    • promptDispatch.status: failed
    • runtime observation/recommendation earlier: stale-registry-runtime-mismatch, restart-not-recommended
  • issue-198-phasepreset-runtime-schema had a live tmux pane but no registry entry visible from the supervisor worktree (entry: null).

Reproduction / context

  1. Start/continue an Ilchul/Kapi worker for a bounded issue from an isolated supervisor worktree.
  2. If initial prompt dispatch/readiness is ambiguous, manually continue or fall back to direct supervisor implementation.
  3. Complete PR review/merge successfully.
  4. List tmux sessions; the worker sessions remain active/attached state 0 without an obvious safe completion/cleanup path through the supervisor status/probe surface.

Decision questions

  • Should the supervisor have a safe closeout command for abandoned/stale issue workers after a PR has been merged by direct fallback?
  • Should sessions with promptDispatch.status: failed but live pane output be classified as retained, stale, or cleanup-eligible?
  • Should registry-missing tmux sessions with Ilchul issue slugs be discoverable and cleanup-plan-reportable without requiring destructive tmux kills?

Proposed acceptance criteria

  • Runtime cleanup/report surfaces distinguish retained active work from safe cleanup candidates.
  • Registry-missing but Ilchul-owned tmux sessions can be reported with non-destructive evidence.
  • The cleanup path never silently kills user-owned sessions and never deletes worktrees/branches without explicit authorization.

Labels

Please keep needs-design until Kade confirms the desired lifecycle semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions