anomalyco / anomalyco/opencode
Tool output encode failure marks unrelated concurrent tool calls as failed
@neriousy is already working on this.
Since Sep 3, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When several tool calls run concurrently in one turn and one of them fails to encode its output for storage (ToolOutputStore.StorageError with operation: "encode"), the runner marks every other still-running tool call in that turn as failed too, even if they would have succeeded on their own.
This happens in packages/core/src/session/runner/llm.ts around the awaitToolFibers race: once it reports a failure, failUnsettledTools sweeps everything not yet settled with "Tool execution failed", regardless of whether the other calls' own execution was fine.
An encode failure is specific to the one tool whose output couldn't be serialized — it doesn't mean anything is wrong with the others. A write failure is more likely a shared storage problem and probably should keep failing fast.
This can also cause the model to unnecessarily retry a tool call it believes failed on the next turn, wasting an extra provider round-trip and potentially re-executing a side effect that already succeeded (e.g. writing the same file twice).
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
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.