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:
- Frequency: intermittent, roughly 40–60% of calls in a session (20+ occurrences observed)
- Affected tools: edit, write, shell, grep, read and Code Mode execute — not tool-specific, pointing at the tool-call serialization/parsing layer
- Payload correlation: long, heavily escaped payloads fail more often, but short simple calls also fail occasionally
- Impact: no data corruption (a rejected call has no effect), but every rejection must be replayed, doubling round-trips and disrupting work
- Workaround in place: splitting… (original truncated)
More from coding & agent
- Daniel Jeffries: only ~2% can actually use AI agents, mass adoption is 10-20 years away — Dan_Jeffries1 · 2026-10-13
- Fully local AI short film mimics Wes Anderson style with a detailed open pipeline — Mist3r-Robot · 2026-10-13
- Controlling his Mac's terminal from a phone via t3 code beta while waiting at speech therapy — NERDDISCO · 2026-10-13
- LLM cache verifier drift: reject-only calibration tripled error rate; 5% audits fix it — Reasonable_Royal_621 · 2026-10-13
- A style guide for making Claude-like models write normally, and its linguistic traps — gleech · 2026-10-13
- Open-source desktop agent dodaios runs local Qwen models via ollama — and shows where 16GB models fail — InternationalGap3698 · 2026-10-13