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
JSON Parse error: Expected '}' with the write tool after updating to v0.5.5 Description #2002
Since updating to OpenCode version 0.5.5, I am encountering a persistent error when the agent attempts to use the write tool. The operation consistently fails with a JSON parsing error.
Error message:
Write
The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing
failed: Text: {"filePath":
"/Users/M***/*****.md".
Error message: JSON Parse error: Expected '}'
As shown the filePath string being passed to the write tool appears to be truncated. This results in an incomplete and malformed JSON object, which lacks the closing double quote for the file path and the final closing curly brace }. This malformed JSON is causing the JSON Parse error.
This issue seems to be a regression introduced in version 0.5.5, as this functionality was working correctly in previous versions. This bug is critical as it prevents the agent from creating or modifying files.
Steps to Reproduce
Update to OpenCode version 0.5.5.
Assign a task that requires the agent to write to a file with a relatively long file path.
Observe the write tool failing with the "JSON Parse error: Expected '}'" message.
Expected Behavior
The write tool should receive a complete and valid JSON object, allowing it to successfully write to the specified file.
Activity
github-actions commentedon Aug 16, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
thdxr commentedon Aug 17, 2025
what model is this?
behavio1 commentedon Aug 18, 2025
Claude Sonnet 4. I restarted my computer and now it works better - this issue is not appearing anymore so far.
jayair commentedon Aug 19, 2025
Closing this then