Skip to content

feat: close sessions from Bach + Started column#6

Merged
Catafal merged 2 commits into
mainfrom
feat/sessions-close-started
Jun 11, 2026
Merged

feat: close sessions from Bach + Started column#6
Catafal merged 2 commits into
mainfrom
feat/sessions-close-started

Conversation

@Catafal

@Catafal Catafal commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Two radar upgrades from REPL dogfooding:

Close sessions from Bach

bach sessions close <id-prefix> (and /sessions close <id> in the REPL) sends SIGTERM to the process behind a running/idle session.

There is no OS-level session→PID mapping, so attribution is deliberately conservative: a process must match the session's runtime binary (ps) AND its working directory (lsof cwd). One candidate → kill (after confirmation; --yes to skip). Multiple candidates (two sessions in the same project) → list PIDs and kill nothing; rerun with --pid. Ended sessions are refused. SIGTERM, not SIGKILL, so the runtime can flush its transcript.

Started column

Session start time (transcript birth time via st_birthtime, mtime fallback) shown in the CLI table, REPL table, and --json output (started_at ISO field). Today's sessions render as HH:MM, older as MM-DD HH:MM.

Tests: 890 → 899 passing (close authority matrix: terminated / not_running / ambiguous-kills-nothing / pid-override-must-be-candidate / no-process; PID attribution; started_at).

🤖 Generated with Claude Code

Catafal and others added 2 commits June 11, 2026 09:31
- `bach sessions close <ref>` / REPL `/sessions close <ref>`: SIGTERM the
  process behind a running/idle session. Attribution is heuristic (runtime
  binary + lsof cwd match), so ambiguity lists candidate PIDs and kills
  nothing — rerun with --pid to pick. Always confirms; ended sessions refused.
- Started column (transcript birth time, st_birthtime with mtime fallback)
  in CLI table, REPL table, and --json output.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Catafal Catafal merged commit 458a758 into main Jun 11, 2026
2 checks passed
@Catafal Catafal deleted the feat/sessions-close-started branch June 11, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant