opencode Bug: ~Half of Agent Tool Calls Rejected as 'Expected Object, Received String'

meijin4 · ghdev · 2026-10-12

Issue #54792 in anomalyco/opencode reports that about half of all tool calls issued by the agent are rejected before execution with The tool call arguments failed to parse: expected object, received string at the root. The same call succeeds when replayed verbatim, making the failure rate look random and causing severe productivity loss in long sessions.

Environment: opencode 2.0.27, WindowsNT 10.0.26300 (win32 x64), shell cmd.exe (commands run through pwsh), latest channel, no plugins.

Reproduction: in a long session editing many files, issue tool calls with moderately complex string arguments (multi-line code with \n, escaped quotes \", accented characters, ${} template literals) and observe a large share rejected at the parse layer with no side effects.

Expected: arguments parsed as a JSON object and the call executes.

Actual: arguments are emitted/delivered as a raw string (truncated or double-encoded JSON) instead of an object.

Additional context:

Original post →

More from coding & agent

coding & agent channel →