Fix #325: correct CLI status reporting for live sessions#329
Draft
asheshgoplani wants to merge 1 commit intomainfrom
Draft
Fix #325: correct CLI status reporting for live sessions#329asheshgoplani wants to merge 1 commit intomainfrom
asheshgoplani wants to merge 1 commit intomainfrom
Conversation
CLI commands (list --json, status --json) reported incorrect status (error/idle) for live sessions because they lacked the StatusFileWatcher that the TUI uses. Three fixes: 1. Cold-load hook status file from disk in UpdateStatus() when hookStatus is empty, giving CLI the same hook fast path as the TUI. 2. Reset stale acknowledged flag during cold load. ReconnectSessionLazy sets acknowledged=true for previousStatus="idle", causing sessions that transitioned idle->waiting to remain stuck as idle in CLI. 3. Write .sid sidecar file in Restart() after successful RespawnPane() for Claude, Gemini, Codex, and OpenCode. Without this anchor, hook events fired after restart cannot be correlated with the instance. Fixes #325 Committed by Ashesh Goplani
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.
Fixes #325
Summary
UpdateStatus(): WhenhookStatusis empty (CLI path withoutStatusFileWatcher), reads the.jsonhook file once to give CLI the same hook fast path as the TUIReconnectSessionLazysetsacknowledged=trueforpreviousStatus="idle", causing sessions that transitioned idle→waiting to remain stuck as idle in CLI output.sidsidecar inRestart(): After successfulRespawnPane()for Claude, Gemini, Codex, and OpenCode, persists the session ID anchor so hook events after restart can be correlated with the instanceTest plan
TestUpdateStatus_ColdLoadHookFile— verifiesreadHookStatusFilereads hook status from diskTestUpdateStatus_ColdLoadResetsAcknowledged— verifies cold-loading "waiting" status resets stale acknowledged flag (requires tmux)TestWriteHookSessionAnchor_InRestart— verifies.sidfile is written correctlymake ci— all 19 packages green)