anomalyco / anomalyco/opencode

Abort leaves orphaned task calls pending

Open
#42,286 2 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Aug 13, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.