forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
When opencode is restarted (new binary), any running taskctl jobs are left in a stale state:
- Job remains
runningwith a dead Pulse PID - Tasks stuck in
developing/reviewing/adversarial-runningwith no active agents taskctl resumerefuses because job is still markedrunningtaskctl stopsends signal but Pulse is dead so nothing processes itenableAutoWakeup()in-memory listener dies with the process — PM never wakes up even after restart- User must manually edit JSON files to force job to
stopped
Fix
On taskctl start and taskctl resume, run a recovery scan that:
- Checks if the job's Pulse PID is alive — if not, immediately marks job
stopped - Resets tasks in
developing/reviewing/adversarial-runningback toopen - Cleans up orphaned worktrees for those tasks
- Re-calls
enableAutoWakeup(pmSessionId)so PM wakeup listener is re-registered - Logs a system comment on each reset task
Also: taskctl stop on a dead-PID job should immediately mark stopped rather than sending signal.
Acceptance Criteria
- After binary restart,
taskctl resume <jobId>auto-detects dead PID, resets stale tasks, restarts Pulse -
taskctl stopon dead-PID job immediately transitions tostopped - Tasks in flight at restart are reset to
openwith a system comment -
enableAutoWakeupre-registered on resume so PM wakes up on task completion - No manual JSON editing needed after restart
- Tests cover restart/recovery scenario
- Adversarial: APPROVED
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working