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
Stale background subagents persist in UI after session restart/compaction #27373
Background subagents (e.g. librarian, explore) that were launched in a previous session context (before compaction or restart) persist in the UI's "Subagentes" panel as running tasks indefinitely. They cannot be cleared.
Steps to Reproduce
Start a session and launch background subagents (e.g. task(subagent_type="librarian", run_in_background=true, ...))
Session gets compacted (context reset) or OpenCode is restarted
The subagent entries remain visible in the UI sidebar showing "running" state
background_cancel(all=true) returns "No running or pending background tasks to cancel"
Restarting OpenCode does not clear them
Expected Behavior
Stale subagent entries should be cleared on session restart or compaction
Or: provide a CLI command like opencode session clear-tasks <sessionID> to manually clear them
Or: the UI should detect orphaned tasks and remove/mark them as stale
Activity
github-actions commentedon Jul 13, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.