forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
After a session reset/resume, background task slots remain occupied by stale/orphaned task records, preventing new tasks from being spawned even though fewer tasks are actually running.
Reproduction
- Have tasks running when session resets/crashes
- Resume or restart the same session
- Spawn new tasks → hits "exceeded concurrent task limit (5)" prematurely
- Check running tasks → fewer than 5 are actually running
Key Detail
Session restart/resume does NOT fix the issue. The orphaned slot count persists across session restarts.
Only workaround: Start a completely NEW session (losing all session context/history).
Expected Behavior
- Task slots should be released when parent session resets
- Or: On session resume, detect and clean up orphaned task records
- Or: Task completion events should properly free slots regardless of session state
Observed Behavior
- Task slots remain occupied by ghost/orphaned tasks
check_taskon old task IDs returnscompletedornot_found, but slots aren't freed- Problem persists across session restart/resume
- User must abandon session entirely to recover full slot capacity
Impact
- High - Forces users to lose session context to recover task capacity
- Blocks parallel work orchestration
Potential Fix Areas
packages/opencode/src/tool/task.ts- task tracking/counting logic- Session initialization - cleanup of stale task records on resume
- Background task state persistence - ensure slot counts are accurate
- Consider: slots tied to session ID vs global count
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels