GeezerVison is showing github.com — [aws bedrock: anthropic opus 4.1] The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text · Issue #1803 · anomalyco/opencode
[aws bedrock: anthropic opus 4.1] The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text #1803Activityalexeypolitov commented on 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 commented on 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 commented on 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 commented on Aug 12, 2025 maybe, it's related to this settings. like some limit on bedrock, that unhandled by ai-sdk
 ahmadomarr commented on Sep 9, 2025 @thdxr I am still facing this issue
The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text: {"filePath": ...
Error message: JSON Parse error: Expected '}'
barrenaedu commented on 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 commented on 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 commented on 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 commented on 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 commented on Jan 24, 2026 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.
⚙ invalid [tool=write, error=Invalid input for tool write: JSON parsing failed: Text: {"filePath": "/home/XXX/git-
alpha/XXXX-com/src/pages/demo/page-bootstrap.vue".
Error message: JSON Parse error: Expected '}']
▣ Build · claude-opus-4.5 · 2m 9s
┃
┃ go write
┃
⚙ invalid [tool=write, error=Invalid input for tool write: JSON parsing failed: Text: {"filePath": "/home/XXXX/git-
alpha/XXXX-com/src/pages/demo/page-bootstrap.vue".
Error message: JSON Parse error: Expected '}']
▣ Build · claude-sonnet-4.5 · 1m 49s
┃
┃ go write plutowang commented on Feb 24, 2026 It's also happened on MiniMax 2.5
invalid [tool=edit, error=Invalid input for tool edit: JSON parsing failed: Text:
Reacted by Dmitry Ibragimov diarworld commented on Feb 26, 2026
It's also happened on MiniMax 2.5
invalid [tool=edit, error=Invalid input for tool edit: JSON parsing failed: Text:
approved, I have the same issue on minimax-m2.5 gabrielhmsantos commented on Mar 24, 2026 Similar problem in Minimax M2.7
JSON Parse error: Unexpected EOF added coreAnything pertaining to core functionality of the application (opencode server stuff) and removed on Mar 24, 2026a101010 commented on 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 commented on Apr 18, 2026 Just got this with qwen3.6-35b under llama.cpp-cuda-git removed coreAnything pertaining to core functionality of the application (opencode server stuff) on May 3, 2026github-actions commented on 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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|