Skip to content

Stop reporting crashed sessions as running forever - #396

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-5672-listsessions-fabricates-status-running-forever
Aug 8, 2026
Merged

Stop reporting crashed sessions as running forever#396
TheGreatAxios merged 1 commit into
mainfrom
cl-5672-listsessions-fabricates-status-running-forever

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • listSessions treated any session directory with a context/ subdir but no readable run.json as "running," including sessions that crashed before their first saveState call ever wrote state
  • Reuses the existing "crashed" value in RunState's status union so a dead session is reported honestly and drops out of the default resume picker instead of appearing live forever

Test plan

  • src/session/list-sessions.test.ts — new test fails before the fix, passes after
  • bun run typecheck (pre-existing unrelated arktype ArkErrors failures across vendor/intx-inference and other untouched files; nothing in src/session/index.ts or the new test)
  • bun run build
  • Full test suite via lock-guarded bun run test: 4139 pass, 1 pre-existing unrelated failure (src/agent/lsp-availability.test.ts, an environmental language-server detection check untouched by this change)

A session directory with a context/ subdir but no readable run.json
never reached its first saveState call, so it isn't running — it
crashed during setup before the run loop could write any state.
listSessions now reports that case as crashed, which drops it from
the default resume picker (only running/cancelled sessions are shown
there) instead of showing a dead session as live indefinitely.
@linear-code

linear-code Bot commented Aug 8, 2026

Copy link
Copy Markdown

CL-5672

@TheGreatAxios
TheGreatAxios merged commit 3d1bc83 into main Aug 8, 2026
3 checks passed
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