Tool calls abort, fail, syntax error
Description
Unfortunately build mode is like useless for me now :/ all that happens:
SyntaxError: Unexpected end of JSON input
OpenCode version
1.0.39
Steps to reproduce
No response
Screenshot and/or share link
Operating System
windows 10
Terminal
wezTerm
This issue might be a duplicate of existing issues. Please check:
- #3034: Same exact error message "SyntaxError: Unexpected end of JSON input" with task tool and tool calls failing, making build mode degraded/unusable
Feel free to ignore if none of these address your specific case.
in this case what i am noticing is that the agents first step happens to be creating some folders and subfolders and it is using / instead of \
i am not sure why this is such an issue, or if something broke in the tool calling. it is still doing this even after downgrading back to .0.15.39
for example: mkdir development/terminal-frontend The syntax of the command is incorrect. OC just aborts and stops.
instead i can manually run; mkdir development\terminal-frontend
I am also getting this in pwsh on windows.
For whatever reason this only seems to happen on windows
I've done some digging, weirdly the first message succeeds then all subsequent calls fail:
SyntaxError: Unexpected end of JSON input
Windows 11 Terminal - installed via: winget install OpenJS.NodeJS.LTS npm install -g opencode-ai
Mines a bit different I feel as it's in the prompt and I get stuck I actually have to: ctrl+p undo command to regain the prompt
On my end, it's not tool calls, but specifically the bash tool. Other tools work just fine.
Maybe something in bash.ts ...
After some quick pairing, @Hona and I fixed the issue, in #4234
Explanation here:
https://github.com/sst/opencode/pull/4234#issuecomment-3524335247