Skip to content

fix: session registry-based liveness detection for in-process backend#2

Merged
morinpic merged 1 commit into
mainfrom
fix/session-liveness-detection
Jun 18, 2026
Merged

fix: session registry-based liveness detection for in-process backend#2
morinpic merged 1 commit into
mainfrom
fix/session-liveness-detection

Conversation

@morinpic

Copy link
Copy Markdown
Contributor

Summary

  • Replace ps aux UUID grep with ~/.claude/sessions/<PID>.json session registry for team liveness detection
  • Match teams to live sessions using cwd + createdAt≈startedAt (5s tolerance) to avoid false matches when multiple teams share the same directory
  • Add repo and cwd fields to scan output for both ghost and active teams
  • Gracefully handle missing ~/.claude/sessions/ directory
  • Bump version to 0.2.0

Background

The previous ps aux | grep UUID approach always marked in-process backend teams (the Agent Teams default) as ghosts because session UUIDs don't appear on the process command line.

Test plan

  • Active teams (in-process backend) are not flagged as ghosts
  • Actually dead teams are correctly detected as ghosts
  • No errors when ~/.claude/sessions/ does not exist
  • No false matches when multiple teams share the same cwd (createdAt verification)
  • repo and cwd fields are present in output

…ction

The ps aux approach fails for in-process backend (Agent Teams default)
because session UUIDs don't appear on the process command line. Instead,
read ~/.claude/sessions/<PID>.json, verify PID liveness with os.kill,
and match teams by cwd + createdAt≈startedAt (5s tolerance).

Also adds repo and cwd fields to scan output for both ghost and active
teams.

Co-Authored-By: Claude <noreply@anthropic.com>
@morinpic morinpic force-pushed the fix/session-liveness-detection branch from d96f7e8 to 970ec5b Compare June 18, 2026 02:06
@morinpic morinpic merged commit f75364c into main Jun 18, 2026
3 checks passed
@morinpic morinpic deleted the fix/session-liveness-detection branch June 18, 2026 02:19
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