opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Tool calls abort, fail, syntax error

Open stellar-ssj opened this issue 1 year ago • 8 comments

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

Image Image

Operating System

windows 10

Terminal

wezTerm

stellar-ssj avatar Nov 07 '25 15:11 stellar-ssj

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.

github-actions[bot] avatar Nov 07 '25 15:11 github-actions[bot]

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

stellar-ssj avatar Nov 07 '25 17:11 stellar-ssj

I am also getting this in pwsh on windows.

Image

Hona avatar Nov 11 '25 23:11 Hona

For whatever reason this only seems to happen on windows

rekram1-node avatar Nov 12 '25 00:11 rekram1-node

I've done some digging, weirdly the first message succeeds then all subsequent calls fail:

Image

Hona avatar Nov 12 '25 03:11 Hona

SyntaxError: Unexpected end of JSON input

Image

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

johnem-msft avatar Nov 12 '25 15:11 johnem-msft

On my end, it's not tool calls, but specifically the bash tool. Other tools work just fine.

Maybe something in bash.ts ...

Sewer56 avatar Nov 12 '25 21:11 Sewer56

After some quick pairing, @Hona and I fixed the issue, in #4234

Explanation here:

https://github.com/sst/opencode/pull/4234#issuecomment-3524335247

Sewer56 avatar Nov 12 '25 23:11 Sewer56