Skip to content

beta: cancelled task remains running and blocks resume/amend #47988

Closed as not planned

Description

@PVLPM

Summary

In the OpenCode v2 beta, cancelling a fixer/background task from one session can leave the task registered as running. A different session then refuses to resume or amend it, even though cancellation was attempted and reported as returned. This is reproducible and blocks cleanup/recovery of the task.

Environment

  • opencode version: 0.0.0-beta-19296 (runtime snapshot; opencode/opencode2 was unavailable in the diagnostic shell)
  • OS: Windows 11, build 26200.9168 (Microsoft Windows [Version 10.0.26200.9168])
  • Terminal: xterm-256color environment; terminal application unavailable
  • Shell: PowerShell 7 (agent reported C:\WINDOWS\system32\cmd.exe)
  • Install/channel: beta
  • Active plugins: C:/Users/User/.config/opencode/node_modules/superpowers, @vectorize-io/opencode-hindsight, and oh-my-opencode-slim

Reproduction

  1. Open two OpenCode v2 beta sessions.
  2. From one session, start a subagent/background task.
  3. From the other session, attempt to cancel the task after it becomes stale or unresponsive.
  4. Observe that cancellation returns an error similar to Session abort returned but task did not stay stopped … (unknown).
  5. Attempt to resume or amend the same task.

Expected Behavior

After cancellation completes, the task should reach a definitive terminal state and the UI should allow it to be safely resumed only if it is actually resumable, or clearly report that it cannot be resumed.

Actual Behavior

The task remains reported as running. A later session shows messages similar to:

The stale fixer lane could not be stopped: task_cancel returned “Session abort returned but task did not stay stopped … (unknown).”
I will not edit overlapping files until the lane reaches a definitive terminal state.
The prior fixer lane remains unconfirmed and could not be cancelled, so overlapping review edits are paused until its state becomes definitive.

The UI also reports:

Task <task-id> is still running and cannot be resumed or amended with task().

Additional Context

Image

Activity

  1. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct (e.g., specific to the cross-session cancel race in the v2 beta), please note what makes it different from the above.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the report, @PVLPM!

    The error messages you quoted (Session abort returned but task did not stay stopped … and Task <task-id> is still running and cannot be resumed or amended with task()) don't come from OpenCode itself. OpenCode v2 has no task() or task_cancel tool. Its built-in tool is subagent, which runs background subagents through a background option. The "fixer lane" and task_cancel wording looks like it comes from one of your plugins, most likely oh-my-opencode-slim.

    To work out where the problem is, could you tell us:

    1. Whether it still happens with your plugins disabled (especially oh-my-opencode-slim), using OpenCode's built-in subagent tool with background: true.
    2. In your own words, briefly: what you did in each session (TUI, desktop or web; which prompts or actions), what you expected, and what OpenCode itself showed, rather than the agent's summary.
    3. The output of opencode --version, if you can run it.

    If it only happens with the plugin, please report it to that plugin's maintainers.

    You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.

    Related issues, ordered from most to least likely to be relevant:

  3. opencodejr commented on Oct 31, 2026

    @opencodejr
    Contributor

    Closing this for now, since we haven't heard back. The errors you quoted (task_cancel / still running and cannot be resumed or amended with task()) aren't produced by OpenCode itself; they look like they come from a plugin, most likely oh-my-opencode-slim. We needed to know whether it also happens with plugins disabled and with the built-in subagent tool before we could act on it.

    If you can reproduce it without plugins, please reply with the steps, what you saw and your opencode --version, and we'll be happy to reopen. If it only happens with the plugin, its maintainers are the best place to report it. #36423 tracks cancellation support for background subagents in v2. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions