JSON parsing failed: Text #1450

Open
opened 2026-02-16 17:31:02 -05:00 by yindo · 15 comments
Owner

Originally created by @bb33bb on GitHub (Aug 22, 2025).

Originally assigned to: @thdxr on GitHub.

Write

The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text:
{"filePath": "/Volumes/4t/Deep Multi-Task and Meta Learning/01/main.py".
Error message: JSON Parse error: Expected '}'
Originally created by @bb33bb on GitHub (Aug 22, 2025). Originally assigned to: @thdxr on GitHub. ``` Write The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text: {"filePath": "/Volumes/4t/Deep Multi-Task and Meta Learning/01/main.py". Error message: JSON Parse error: Expected '}' ```
yindo added the model-problem label 2026-02-16 17:31:02 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 22, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2002: Similar JSON parse error 'Expected '}' with the write tool after updating to v0.5.5
  • #1803: Similar JSON parsing error with AWS Bedrock - 'The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed'
  • #1278: Similar 'JSON Parse error: Unterminated string' issue with openrouter/kimi-k2

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 22, 2025): This issue might be a duplicate of existing issues. Please check: - #2002: Similar JSON parse error 'Expected '}' with the write tool after updating to v0.5.5 - #1803: Similar JSON parsing error with AWS Bedrock - 'The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed' - #1278: Similar 'JSON Parse error: Unterminated string' issue with openrouter/kimi-k2 Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Aug 22, 2025):

this is the llm failing to call the tool looks like, this can happen from time to time, some models are worse than others.

What model was it?

@rekram1-node commented on GitHub (Aug 22, 2025): this is the llm failing to call the tool looks like, this can happen from time to time, some models are worse than others. What model was it?
Author
Owner

@bb33bb commented on GitHub (Aug 22, 2025):

duplicated, sorry
github claude 4 model

this is the llm failing to call the tool looks like, this can happen from time to time, some models are worse than others.

What model was it?

@bb33bb commented on GitHub (Aug 22, 2025): duplicated, sorry github claude 4 model > this is the llm failing to call the tool looks like, this can happen from time to time, some models are worse than others. > > What model was it?
Author
Owner

@bb33bb commented on GitHub (Aug 30, 2025):

Write

The arguments provided to the tool are invalid: Invalid input for tool write: Type validation failed: Value:
{}.
Error message: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "filePath"
    ],
    "message": "Required"

Write

The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text:
{"filePath": "xxxx.txt".
Error message: JSON Parse error: Expected '}'
@bb33bb commented on GitHub (Aug 30, 2025): ``` Write The arguments provided to the tool are invalid: Invalid input for tool write: Type validation failed: Value: {}. Error message: [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": [ "filePath" ], "message": "Required" Write The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text: {"filePath": "xxxx.txt". Error message: JSON Parse error: Expected '}' ```
Author
Owner

@JacobHolman commented on GitHub (Sep 9, 2025):

I’m experiencing a similar issue. It seems that this model, specifically the GitHub Claude 4 one, has recurring problems.

@JacobHolman commented on GitHub (Sep 9, 2025): I’m experiencing a similar issue. It seems that this model, specifically the GitHub Claude 4 one, has recurring problems.
Author
Owner

@bb33bb commented on GitHub (Sep 10, 2025):

I’m experiencing a similar issue. It seems that this model, specifically the GitHub Claude 4 one, has recurring problems.

I am using the same model.

@bb33bb commented on GitHub (Sep 10, 2025): > I’m experiencing a similar issue. It seems that this model, specifically the GitHub Claude 4 one, has recurring problems. I am using the same model.
Author
Owner

@barrenaedu commented on GitHub (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.

Image
@barrenaedu commented on GitHub (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. <img width="3076" height="409" alt="Image" src="https://github.com/user-attachments/assets/37efb797-2701-4d33-a623-1c487d942bdd" />
Author
Owner

@rekram1-node commented on GitHub (Oct 8, 2025):

yeah looks like lm studio issue : https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues/1071

@rekram1-node commented on GitHub (Oct 8, 2025): yeah looks like lm studio issue : https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues/1071
Author
Owner

@yagil commented on GitHub (Oct 8, 2025):

Fixed in LM Studio 0.3.30, sorry about that

@yagil commented on GitHub (Oct 8, 2025): Fixed in LM Studio 0.3.30, sorry about that
Author
Owner

@barrenaedu commented on GitHub (Oct 8, 2025):

It's ok, just a comment in case anyone needed more information about versions,etc... Thank you

@barrenaedu commented on GitHub (Oct 8, 2025): It's ok, just a comment in case anyone needed more information about versions,etc... Thank you
Author
Owner

@vasilvestre commented on GitHub (Nov 28, 2025):

Happening with copilot and opus 4.5

@vasilvestre commented on GitHub (Nov 28, 2025): Happening with copilot and opus 4.5
Author
Owner

@brpaz commented on GitHub (Dec 20, 2025):

I am also started having this issue last week from nowhere. Also using GitHub Copilot models. In my case Sonnet 4.5

@brpaz commented on GitHub (Dec 20, 2025): I am also started having this issue last week from nowhere. Also using GitHub Copilot models. In my case Sonnet 4.5
Author
Owner

@rekram1-node commented on GitHub (Dec 20, 2025):

@brpaz can u share session?

Note that normally this is the model/provider emitting incomplete tool calls

@rekram1-node commented on GitHub (Dec 20, 2025): @brpaz can u share session? Note that normally this is the model/provider emitting incomplete tool calls
Author
Owner

@rekram1-node commented on GitHub (Dec 20, 2025):

opencode export > session.json

@rekram1-node commented on GitHub (Dec 20, 2025): `opencode export > session.json`
Author
Owner

@brpaz commented on GitHub (Dec 21, 2025):

Sorry. I think I don´t have that session anymore.

In the meantime, I found some Github Issue that mentioned that this happens when the contents of the file are too big. asking the model to write to the file in chunks seems to have fixed the issue.

If this happens agian I will save the session and share here.

@brpaz commented on GitHub (Dec 21, 2025): Sorry. I think I don´t have that session anymore. In the meantime, I found some Github Issue that mentioned that this happens when the contents of the file are too big. asking the model to write to the file in chunks seems to have fixed the issue. If this happens agian I will save the session and share here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1450