You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Background subagent task_status returns 'cancelled' but session data still accessible via task(task_id=) resume #27827
When using task(background=true) to launch a background subagent, the task completes successfully and results are visible in the UI. However, when the parent agent polls for results using task_status(task_id="...", wait=true), it returns state: cancelled with empty error.
The session data is not lost — using task(task_id="...", prompt="...") to resume the session retrieves the full completed results.
Steps to Reproduce
Set OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true
The subagent completes its work (results visible in parent session context)
Parent agent calls task_status(task_id="...", wait=true) to get results
state: cancelled is returned, no result data
Expected Behavior
task_status(wait=true) should return state: completed with the full task result data, matching what is visible in the session UI.
Workaround
Instead of using task_status, use task(task_id="<same_id>", prompt="return your previous result") to resume the session and retrieve results. But this is clunky — the parent agent shouldn't need to know the prompt again.
Activity
YoungJurry commentedon May 16, 2026
Closing and re-submitting as a new issue — the triage bot did not assign labels or staff. Re-submitted to ensure proper triage.