Skip to content

Abort leaves orphaned task calls pending #42286

Closed as not planned
Closed as not planned

Description

@0xfed

Description

If OpenCode loses the in-memory runner for a session while a task tool call is still persisted as pending or running, aborting the session only marks it idle. The parent assistant message and task part remain unfinished, so the transcript shows a task that never completed.

The TUI startup path for --continue --fork can also briefly route through a placeholder session ID (dummy), which produces an invalid-session error instead of returning to home when no session is available.

Steps to reproduce

  1. Start a session that invokes the task tool.
  2. Interrupt or restart the local runner after the task part is persisted but before it reaches a terminal state.
  3. Abort the parent session.
  4. Observe the task part still shown as pending or running and its assistant message left incomplete.

For the fork path:

  1. Run opencode --continue --fork with no resumable root session.
  2. Observe the placeholder-session validation error.

Expected behavior

Abort should cancel any live runner, then settle orphaned task parts with an aborted error and complete their parent assistant message. --continue --fork should show a loading state and return home with an error when no session can be forked.

Plugins

None

OpenCode version

1.18.x

Operating System

Linux

Terminal

Terminal emulator

Activity

  1. 0xfed commented on Aug 13, 2026

    @0xfed
    Author

    Related reports:

  2. NamedIdentity commented on Aug 27, 2026

    @NamedIdentity

    #45482 addresses this — abort now returns success only once the branch is closed and released, and pending tool calls are terminalized rather than left running.

  3. Tarquinen commented on Oct 20, 2026

    @Tarquinen
    Contributor

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions