Skip to content

[codex] Fix session scan liveness and stale detection#74

Merged
boxp merged 2 commits into
mainfrom
fix/boxp-69-scan-liveness
Jul 8, 2026
Merged

[codex] Fix session scan liveness and stale detection#74
boxp merged 2 commits into
mainfrom
fix/boxp-69-scan-liveness

Conversation

@boxp

@boxp boxp commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix startup scan resurrecting dead sessions: scan-recent-sessions! now checks agent liveness before writing active (:running etc.) sessions that lack a pane-id — sessions whose agent process is :dead are skipped, :alive/:unknown are written (consistent with stale cleanup's conservative handling of :unknown)
  • Skip expired terminal sessions (older than the closed TTL) during scans so completed history doesn't flood the TUI
  • Fix pane-id-less sessions never going stale: stale-session? now falls back to a cwd-matched process-tree check instead of unconditionally treating them as alive when their cwd matches any live pane
  • Make session-has-live-agent? public so the scan path reuses the same 3-state (:alive/:dead/:unknown) liveness logic

Ticket

Obsidian BOXP-69 (follow-up to #73)

Test plan

  • make ci (262 tests, 0 failures)
  • New tests: dead/alive/unknown liveness during scan, expired-terminal skip, pane-id-less stale fallback (dead → stale, alive/unknown → not stale)

🤖 Generated with Claude Code

@boxp
boxp merged commit 972f494 into main Jul 8, 2026
6 checks passed
@boxp
boxp deleted the fix/boxp-69-scan-liveness branch July 8, 2026 13:13
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