Before submitting
Area
apps/server
Steps to reproduce
- Start a thread and let its provider session reach
status: "running" with an active turn, bound to a git worktree.
- Outside the app, delete that worktree's directory (e.g. it was removed by other tooling, or manually).
- The provider process/cwd for that thread is gone, but nothing updates the thread's session state.
- Try to archive the thread from the sidebar.
Expected behavior
The thread's session should eventually reflect that the underlying process/worktree is gone (e.g. via the idle/session reaper), or archiving should be possible once that's detected.
Actual behavior
The thread is permanently stuck. The client's archive guard (apps/web/src/hooks/useThreadActions.ts:158-172) refuses to archive any thread with session.status === "running" and a non-null activeTurnId. ProviderSessionReaper (apps/server/src/provider/Layers/ProviderSessionReaper.ts:59-67) unconditionally skips any thread with activeTurnId set, no matter how stale, so nothing ever clears it automatically.
Impact
Minor bug or occasional failure
Version or commit
main @ 4f584da
Workaround
Switch the thread to a different branch/worktree via the branch toolbar selector — this triggers thread.session.stop, which unconditionally sets status: "stopped", activeTurnId: null through the normal event path. Avoid using the regular Stop button first, since turn-interrupt uses allowRecovery: true and may try to restart the session in the missing worktree.
Before submitting
Area
apps/server
Steps to reproduce
status: "running"with an active turn, bound to a git worktree.Expected behavior
The thread's session should eventually reflect that the underlying process/worktree is gone (e.g. via the idle/session reaper), or archiving should be possible once that's detected.
Actual behavior
The thread is permanently stuck. The client's archive guard (
apps/web/src/hooks/useThreadActions.ts:158-172) refuses to archive any thread withsession.status === "running"and a non-nullactiveTurnId.ProviderSessionReaper(apps/server/src/provider/Layers/ProviderSessionReaper.ts:59-67) unconditionally skips any thread withactiveTurnIdset, no matter how stale, so nothing ever clears it automatically.Impact
Minor bug or occasional failure
Version or commit
main @ 4f584da
Workaround
Switch the thread to a different branch/worktree via the branch toolbar selector — this triggers
thread.session.stop, which unconditionally setsstatus: "stopped",activeTurnId: nullthrough the normal event path. Avoid using the regular Stop button first, since turn-interrupt usesallowRecovery: trueand may try to restart the session in the missing worktree.