Skip to content

Sessions tab and codev session CLI decide 'running' differently #175

Open

Description

@grimmerk

Severity: P3 (minor). Flagged by: cubic on #174 (thread), confidence 9/10.

What. Two pieces of code read Claude Code's sessions/<pid>.json registrations and decide which sessions are running, and they use different rules:

Where Reads Decides "running" by
App, Sessions tab — readSessionRegistrations in src/live-sessions.ts every account's sessions/*.json the pid appears in the list of running claude processes
CLI, codev session list --live / self — readAllRegistrations / readRegistrations / isLive in src/cli/session-self.ts (#174) the same files the pid is alive and its start time equals the file's procStart

The app's rule can show a session as running when a leftover registration's pid has been reused by another claude process. The CLI's rule does not. A disagreement is silent: the two views just list different sessions.

Why not fixed in #174. Sharing the file parser alone would not make them agree, because the difference is the liveness rule. self's reader already existed before #174 as a second copy.

Suggested fix. Make src/cli/session-self.ts the one reader and the one isLive rule (the app can import from src/cli/; the CLI cannot import from the app). Have live-sessions.ts build on it: it already runs ps, so it can supply the start times. Then add a test that one fixture set gives the same running set through both paths.

🤖 On behalf of @grimmerk — generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions