feat: close sessions from Bach + Started column#6
Merged
Conversation
- `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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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;
--yesto 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--jsonoutput (started_atISO field). Today's sessions render asHH:MM, older asMM-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