forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
Both resurrectionScan and heartbeatActiveAgents in pulse.ts use isSessionActivelyRunning(task.assignee) to check if a developer session is alive. This reads from SessionStatus, a module-level in-memory Map.
After a binary restart, SessionStatus can contain stale busy entries for sessions from before the restart. This causes tasks to get stuck at stage: developing forever after restart.
Root Cause
SessionStatus state is not cleared on restart. isPidAlive(task.assignee_pid) is the authoritative signal.
Fix
Add PID-based liveness check in both resurrectionScan and heartbeatActiveAgents:
- Dead if EITHER SessionStatus is idle OR assignee PID is dead
- In resurrectionScan: if stage === developing and dead, advance to reviewing (preserve worktree) instead of resetting to idle
Acceptance Criteria
- After binary restart, task with stage: developing and dead assignee PID advances to reviewing within one Pulse tick
- Worktree preserved when advancing to reviewing
- bun test and bun run typecheck pass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels