anomalyco / anomalyco/opencode
Abort leaves orphaned task calls pending
@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
- Start a session that invokes the
tasktool. - Interrupt or restart the local runner after the task part is persisted but before it reaches a terminal state.
- Abort the parent session.
- Observe the task part still shown as
pendingorrunningand its assistant message left incomplete.
For the fork path:
- Run
opencode --continue --forkwith no resumable root session. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.