You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[aws bedrock: anthropic opus 4.1] The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text #1803
looks like this problem not only with write tool, but it like streaming at all for opus 4.1 in bedrock. I like stop streaming on a middle. reproduce only on large write operations. Not reproduce for opus 4. only for opus 4.1
for share, I did try to use bedrock due openrouter. maybe I not completely understand how openrouter works, but in opencode, opus 4.1 on bedrock due openrouter was pretty fast and have no some steaming-like problems
This is the model calling a tool incorrectly, it should be able to recover on it's own. It called a tool with invalid json, it just has to try again generally
I see same issue with Opus 4.5. Switch model to Sonnet 4.5, same error. gemini-3-pro-preview finally went through.
@thdxr don't blame the models, to me that that sounds HIGHLY brittle and a defeatist attitude . Change should have try catch and stick the response in some object. There should not be such thing as failing to parse response.
Edit: If is about the input or something complicated and you understand problem. Please describe problem better so someone smart or familiar comes up a solution. I.e, Guy who said try different model helped me a lot.
I'm getting similar problem in OpenCode 1.2.27 with minimax-m2.5. The model trys repeatedly and fails to come up with a valid edit. Sometimes it recovers on its own, but sometimes it doesn't. Sometimes it complains about 'special characters', but all of the characters it complains about are fairly normal 'special' characters that it hasn't had trouble with for the past several weeks before I started getting these errors a couple of days ago.
This time it failed with "The remaining implementation details need to be added manually due to edit tool issues." Some recovery...
Activity
alexeypolitov commentedon Aug 12, 2025
looks like this problem not only with write tool, but it like streaming at all for opus 4.1 in bedrock. I like stop streaming on a middle. reproduce only on large write operations. Not reproduce for opus 4. only for opus 4.1
thdxr commentedon Aug 12, 2025
this is likely issues on their end given the new model - give it a week and let me know if there are still problems
alexeypolitov commentedon Aug 12, 2025
for share, I did try to use bedrock due openrouter. maybe I not completely understand how openrouter works, but in opencode, opus 4.1 on bedrock due openrouter was pretty fast and have no some steaming-like problems
alexeypolitov commentedon Aug 12, 2025
maybe, it's related to this settings. like some limit on bedrock, that unhandled by ai-sdk
ahmadomarr commentedon Sep 9, 2025
@thdxr I am still facing this issue
barrenaedu commentedon Oct 8, 2025
Same error here, using opencode 0.14.6 and LM Studio 0.3.29 with qwen/qwen3-coder-30b. If I use qwen/qwen2.5-coder-14b the error is not present.
kevinw86 commentedon Dec 4, 2025
invalid [tool=write, error=Invalid input for tool write: JSON parsing failed: Text: {"filePath": "C:\Users\Project_Design_Document.md".
Error message: JSON Parse error: Expected '}']
how can i fix this
rekram1-node commentedon Dec 4, 2025
This is the model calling a tool incorrectly, it should be able to recover on it's own. It called a tool with invalid json, it just has to try again generally
nachtgold commentedon Dec 16, 2025
I get it, when the content is to long (with Copilot). Then I prompt, that it should write in chunks and then the document could be written.
lfmunoz commentedon Jan 24, 2026
I see same issue with Opus 4.5. Switch model to Sonnet 4.5, same error.
gemini-3-pro-previewfinally went through.@thdxr don't blame the models, to me that that sounds HIGHLY brittle and a defeatist attitude . Change should have try catch and stick the response in some object. There should not be such thing as failing to parse response.
Edit: If is about the input or something complicated and you understand problem. Please describe problem better so someone smart or familiar comes up a solution. I.e, Guy who said try different model helped me a lot.
┃
┃ go write
┃
┃
┃ go write
plutowang commentedon Feb 24, 2026
It's also happened on MiniMax 2.5
diarworld commentedon Feb 26, 2026
approved, I have the same issue on minimax-m2.5
gabrielhmsantos commentedon Mar 24, 2026
Similar problem in Minimax M2.7
JSON Parse error: Unexpected EOF
a101010 commentedon Mar 28, 2026
I'm getting similar problem in OpenCode 1.2.27 with minimax-m2.5. The model trys repeatedly and fails to come up with a valid edit. Sometimes it recovers on its own, but sometimes it doesn't. Sometimes it complains about 'special characters', but all of the characters it complains about are fairly normal 'special' characters that it hasn't had trouble with for the past several weeks before I started getting these errors a couple of days ago.
This time it failed with "The remaining implementation details need to be added manually due to edit tool issues." Some recovery...
sgmihai commentedon Apr 18, 2026
Just got this with qwen3.6-35b under llama.cpp-cuda-git
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.