GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #1803

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[aws bedrock: anthropic opus 4.1] The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text#1803
Copy link
Assignees
rekram1-node

Description

@alexeypolitov
alexeypolitov
opened on Aug 11, 2025
Issue body actions
Image

https://opencode.ai/s/szC8qWz4

2025-08-11T041226.log.zip

Activity

  1. thdxr
    self-assigned this
    on Aug 11, 2025
  2. alexeypolitov commented on Aug 12, 2025

    @alexeypolitov
    alexeypolitov
    on Aug 12, 2025
    Author
    More actions

    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

  3. thdxr
    added
    model-problem
    on Aug 12, 2025
  4. thdxr commented on Aug 12, 2025

    @thdxr
    thdxr
    on Aug 12, 2025 – with Linear
    Member
    More actions

    this is likely issues on their end given the new model - give it a week and let me know if there are still problems

    Reacted by Alexey Poliov
  5. alexeypolitov commented on Aug 12, 2025

    @alexeypolitov
    alexeypolitov
    on Aug 12, 2025
    Author
    More actions

    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

  6. alexeypolitov commented on Aug 12, 2025

    @alexeypolitov
    alexeypolitov
    on Aug 12, 2025
    Author
    More actions

    maybe, it's related to this settings. like some limit on bedrock, that unhandled by ai-sdk

    Image
  7. ahmadomarr commented on Sep 9, 2025

    @ahmadomarr
    ahmadomarr
    on Sep 9, 2025
    More actions

    @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 '}'
    
  8. barrenaedu commented on Oct 8, 2025

    @barrenaedu
    barrenaedu
    on Oct 8, 2025
    More actions

    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
  9. kevinw86 commented on Dec 4, 2025

    @kevinw86
    kevinw86
    on Dec 4, 2025
    More actions

    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

  10. rekram1-node commented on Dec 4, 2025

    @rekram1-node
    rekram1-node
    on Dec 4, 2025
    Member
    More actions

    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

  11. nachtgold commented on Dec 16, 2025

    @nachtgold
    nachtgold
    on Dec 16, 2025
    More actions

    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.

    Reacted by majestichou
  12. lfmunoz commented on Jan 24, 2026

    @lfmunoz
    lfmunoz
    on Jan 24, 2026
    More actions

    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

  13. plutowang commented on Feb 24, 2026

    @plutowang
    plutowang
    on Feb 24, 2026
    More actions

    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
  14. diarworld commented on Feb 26, 2026

    @diarworld
    diarworld
    on Feb 26, 2026
    More actions

    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

  15. gabrielhmsantos commented on Mar 24, 2026

    @gabrielhmsantos
    gabrielhmsantos
    on Mar 24, 2026
    More actions

    Similar problem in Minimax M2.7
    JSON Parse error: Unexpected EOF

  16. rekram1-node
    assigned
    rekram1-node
    and unassigned
    thdxr
    on Mar 24, 2026
  17. rekram1-node
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    and removed
    model-problem
    on Mar 24, 2026
  18. a101010 commented on Mar 28, 2026

    @a101010
    a101010
    on Mar 28, 2026
    More actions

    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...

  19. sgmihai commented on Apr 18, 2026

    @sgmihai
    sgmihai
    on Apr 18, 2026
    More actions

    Just got this with qwen3.6-35b under llama.cpp-cuda-git

  20. thdxr
    removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  21. github-actions commented on Jul 3, 2026

    @github-actions
    github-actionsBot
    on Jul 3, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  22. github-actions
    closed this as not plannedon Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.