Session list reports running sessions as "aborted" until they finish
OpenCodeReview Version
v1.12.9 (bccbc15f)
Operating System
Windows
Installation Method
npm (global)
LLM Provider
Anthropic (Claude) — via a self-hosted Anthropic-protocol endpoint (irrelevant to this bug: the misreported state comes from session file parsing, not from the LLM).
Bug Description
While a review is still running, ocr session list reports the in-progress session as aborted. Only after the run finishes does the status flip to complete.
Root cause (from source): loadSummaryFromFile in internal/session/list.go initializes Aborted: true and only flips it to false when a session_end record is read. A session file only receives its session_end record at Finalize() (internal/session/history.go), so a live run — which by design has no session_end yet — is indistinguishable from a crashed/interrupted one. There is no liveness signal (PID, heartbeat, or file freshness check) in the listing path.
This matters for the AI-agent workflows the project promotes (README recommends --format json output for AI host agents, and --resume targets interrupted runs): an agent polling ocr session list sees aborted for a healthy running review and may conclude the run died and start a duplicate review, wasting tokens and producing duplicated findings.
Steps to Reproduce
- Configure any LLM endpoint.
- In a terminal, start a review that takes more than a few seconds:
ocr review - While it is still running, from the same repository run:
ocr session list - Observe the running session's STATUS column showing
aborted. - Wait for the review to finish and run
ocr session listagain; the status now showscomplete.
Expected Behavior
An unfinished session whose file is still being appended to should be reported as running (or some equivalent "in progress" state), and only a session with no session_end and no recent activity should be reported as aborted.
Logs / Error Output
Captured on Windows while two reviews were literally running at the same time (one started at 15:46:17, one at 15:47:13 — both alive):
SESSION ID MODE RANGE FILES COMMENTS STATUS STARTED
f2635976-e694-424c-af4a-990b6c147525 workspace - 0 0 aborted 2026-09-28 15:47:13
3f9c6f82-3a3b-430f-8769-7d690f0ea05f workspace - 0 0 aborted 2026-09-28 15:46:17After both reviews finished, the same sessions show complete — so aborted was indeed a false report for live runs.
AI/LLM Disclosure
- "I didn't use AI/LLM to assist or generate the content above."
Additional Context
Disclosure per the project's AI-assisted development policy: this report was written with AI assistance (ZCode agent, GLM model, glm-5.3-flash). The reproduction steps and outputs above were captured from real runs on my machine (Windows 11, Go 1.27.0, OCR v1.12.9 installed via npm).
I have a fix ready (mtime-based liveness detection in the session listing path, adding a running status without changing the existing aborted flag semantics so --resume and existing JSON consumers are unaffected) and will submit a PR referencing this issue.
Source: alibaba/open-code-review