(sidebar): show CLI status and age for local sessions too - #254
Merged
Merged
Conversation
Local sessions carry the same busy/idle/waiting/shell descriptor as remote ones (~/.claude/sessions/<pid>.json), but only the remote path rendered it. Rename remoteStatus/remoteStatusUpdatedAt to status/ statusUpdatedAt, annotate local sessions from cli-session-state.js's already-parsed cache, and render the line regardless of remoteAlias.
statusBySession was written before the isProcessAlive gate, so a descriptor left by a crashed or killed CLI (deleted on clean exit only) would surface as a permanently live status. Gate both seed() and handleFile() on liveness, and move the two comment blocks over the ceiling into cli-session-state.md.
This was referenced Sep 11, 2026
Merged
Merged
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.
Closes #245.
Why
A remote session row showed a state word and its age (
idle · 3 min); a local one showed neither, although the local CLI writes the same descriptor (~/.claude/sessions/<pid>.json, samestatusvocabulary andstatusUpdatedAt) andcli-session-state.jsalready parses it.What
cli-session-state.jskeeps asessionId → {status, statusUpdatedAt}map for live pids only and exposesgetStatus(sessionId), a pure lookup — no new watcher, the module's rescan invariant is untouched. A descriptor left behind by a crashed CLI never surfaces; a known session observed with a dead pid is dropped.main.jsannotateRemoteAttachableannotates local sessions from that lookup and remote ones from the host descriptor, under one pair of fields:status/statusUpdatedAt(remoteStatus*renamed).public/sidebar.jsrenders the state + age line for any session carryingstatus, regardless ofremoteAlias;formatRemoteAge→formatStatusAge,.session-remote-status→.session-status.Proof
Mutations on the shipped files: drop the local annotation → local test red, remote green; wrap the render back in
if (session.remoteAlias)→ two local render tests red; drop the liveness gate inseed()→ "seeded at startup" test red only; drop both gates → three tests red.task check: 1230 pass, 0 fail, 8 pre-existing skips.