Tool execution aborted #781

Closed
opened 2026-02-16 17:28:16 -05:00 by yindo · 26 comments
Owner

Originally created by @bb33bb on GitHub (Jul 17, 2025).

Originally assigned to: @thdxr on GitHub.

RGrep
Tool execution aborted
AI_InvalidToolInputError: Invalid input for tool grep: JSON parsing failed:
Text: {"include": "*.py"
', "path": "xxxxxxxxxxx".
Error message: JSON Parse error: Expected '3'

Originally created by @bb33bb on GitHub (Jul 17, 2025). Originally assigned to: @thdxr on GitHub. RGrep Tool execution aborted AI_InvalidToolInputError: Invalid input for tool grep: JSON parsing failed: Text: {"include": "*.py" ', "path": "xxxxxxxxxxx". Error message: JSON Parse error: Expected '3'
yindo closed this issue 2026-02-16 17:28:16 -05:00
Author
Owner

@thdxr commented on GitHub (Jul 17, 2025):

what model is this?

@thdxr commented on GitHub (Jul 17, 2025): what model is this?
Author
Owner

@rodsnts commented on GitHub (Jul 17, 2025):

I'm having the same issues

Image
@rodsnts commented on GitHub (Jul 17, 2025): I'm having the same issues <img width="1204" height="1074" alt="Image" src="https://github.com/user-attachments/assets/b71700b5-772f-4f04-96c9-95d670c61761" />
Author
Owner

@JohnBakhmat commented on GitHub (Jul 17, 2025):

Codex, o4-mini, but not 4.1-mini

@JohnBakhmat commented on GitHub (Jul 17, 2025): Codex, o4-mini, but not 4.1-mini
Author
Owner

@CaffeeLake commented on GitHub (Jul 17, 2025):

  • I also encountered the same error.
  • Image
@CaffeeLake commented on GitHub (Jul 17, 2025): - I also encountered the same error. - <img width="1665" height="934" alt="Image" src="https://github.com/user-attachments/assets/7fc43ffe-326d-40b3-8cf0-a6eaf22e1f2e" />
Author
Owner

@bb33bb commented on GitHub (Jul 17, 2025):

i use github copolit->claude 4

@bb33bb commented on GitHub (Jul 17, 2025): i use github copolit->claude 4
Author
Owner

@navkuun commented on GitHub (Jul 18, 2025):

Also getting this, with codex-mini using o4-mini through Azure

@navkuun commented on GitHub (Jul 18, 2025): Also getting this, with codex-mini using o4-mini through Azure
Author
Owner

@claidler commented on GitHub (Jul 18, 2025):

I noticed this issue with Kimi K2, but it was resolved by only allowing specific (working) providers via OpenRouter. Even Groq has issues it seems, so you have to do some manual work to see what's reliable at this moment. Hopefully things will stabilise over time

@claidler commented on GitHub (Jul 18, 2025): I noticed this issue with Kimi K2, but it was resolved by only allowing specific (working) providers via OpenRouter. Even Groq has issues it seems, so you have to do some manual work to see what's reliable at this moment. Hopefully things will stabilise over time
Author
Owner

@bb33bb commented on GitHub (Jul 18, 2025):

i will take care whether it is still exist, if solved in two days, i will try to close this issue.

@bb33bb commented on GitHub (Jul 18, 2025): i will take care whether it is still exist, if solved in two days, i will try to close this issue.
Author
Owner

@heiningair commented on GitHub (Jul 18, 2025):

Also just had this issue with kimi k2. will try @claidler s way and restrict it to get only the working providers.

@heiningair commented on GitHub (Jul 18, 2025): Also just had this issue with kimi k2. will try @claidler s way and restrict it to get only the working providers.
Author
Owner

@claidler commented on GitHub (Jul 18, 2025):

@heiningair it worked with the official moonshot one on openrouter at least. I had trouble with some others, including Groq

@claidler commented on GitHub (Jul 18, 2025): @heiningair it worked with the official moonshot one on openrouter at least. I had trouble with some others, including Groq
Author
Owner

@heiningair commented on GitHub (Jul 18, 2025):

@heiningair it worked with the official moonshot one on openrouter at least. I had trouble with some others, including Groq

thanks! will try that :)

@heiningair commented on GitHub (Jul 18, 2025): > [@heiningair](https://github.com/heiningair) it worked with the official moonshot one on openrouter at least. I had trouble with some others, including Groq thanks! will try that :)
Author
Owner

@heiningair commented on GitHub (Jul 18, 2025):

@heiningair it worked with the official moonshot one on openrouter at least. I had trouble with some others, including Groq

my test also showed, that kimi k2 only works so far with "moonshot ai" as allowed provider (in openrouter.ai dashboard). as soon as i allow any other provider it has these "Tool execution" issues

@heiningair commented on GitHub (Jul 18, 2025): > [@heiningair](https://github.com/heiningair) it worked with the official moonshot one on openrouter at least. I had trouble with some others, including Groq my test also showed, that kimi k2 only works so far with "moonshot ai" as allowed provider (in openrouter.ai dashboard). as soon as i allow any other provider it has these "Tool execution" issues
Author
Owner

@bb33bb commented on GitHub (Jul 19, 2025):

Image
@bb33bb commented on GitHub (Jul 19, 2025): <img width="1778" height="266" alt="Image" src="https://github.com/user-attachments/assets/b10da64b-4494-4855-a558-9d4439cc0667" />
Author
Owner

@claidler commented on GitHub (Jul 19, 2025):

@heiningair did you try literally every other provider?

@claidler commented on GitHub (Jul 19, 2025): @heiningair did you try literally every other provider?
Author
Owner

@Prikalel commented on GitHub (Jul 21, 2025):

have the same issue.

appears even with some pair models on openrouter

@Prikalel commented on GitHub (Jul 21, 2025): have the same issue. appears even with some pair models on openrouter
Author
Owner

@effektsvk commented on GitHub (Jul 23, 2025):

I'm also having this issue, it is very unreliable, sometimes it works, sometimes not. I'm using OpenAI o4-mini

Here is an example error:

AI_InvalidToolInputError: Invalid input for tool grep: Type validation failed: Value: {"pattern":"label","path":"/Users/erik/privateGit/vscode-git-
graph/web/graph.ts"}.
Error message: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "include"
    ],
    "message": "Required"
  }
]

I told the model to try again and pasted it this error two times and eventually it worked. I don't understand how is it possible that the received is undefined when the path value seems to be filled in the object that is printed in Value: ...

opencode version: 0.3.57

@effektsvk commented on GitHub (Jul 23, 2025): I'm also having this issue, it is very unreliable, sometimes it works, sometimes not. I'm using `OpenAI o4-mini` Here is an example error: ``` AI_InvalidToolInputError: Invalid input for tool grep: Type validation failed: Value: {"pattern":"label","path":"/Users/erik/privateGit/vscode-git- graph/web/graph.ts"}. Error message: [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": [ "include" ], "message": "Required" } ] ``` I told the model to try again and pasted it this error two times and eventually it worked. I don't understand how is it possible that the `received` is `undefined` when the `path` value seems to be filled in the object that is printed in `Value: ...` opencode version: `0.3.57`
Author
Owner

@esafak commented on GitHub (Jul 24, 2025):

I experienced this with openrouter/gpt-4.1 mini on 0.3.58:

AI_InvalidToolInputError: Invalid input for tool grep: Type validation failed: Value:
{"pattern":"getProjectFile","path":"/Users/emre/code/langserver","include":null}.
Error message: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "null",
    "path": [
      "include"
    ],
    "message": "Expected string, received null"
  }
]

I got around it by telling it to use rg but that has failed before too:

AI_InvalidToolInputError: Invalid input for tool bash: Type validation failed: Value:
{"command":"rg -n getProjectFile ls.nim","description":"Search getProjectFile occurrences
in ls.nim"}.
Error message: [
  {
    "code": "invalid_type",
    "expected": "number",
    "received": "undefined",
    "path": [
      "timeout"
    ],
    "message": "Required"
  }
]
@esafak commented on GitHub (Jul 24, 2025): I experienced this with openrouter/gpt-4.1 mini on 0.3.58: ``` AI_InvalidToolInputError: Invalid input for tool grep: Type validation failed: Value: {"pattern":"getProjectFile","path":"/Users/emre/code/langserver","include":null}. Error message: [ { "code": "invalid_type", "expected": "string", "received": "null", "path": [ "include" ], "message": "Expected string, received null" } ] ``` I got around it by telling it to use `rg` but that has failed before too: ``` AI_InvalidToolInputError: Invalid input for tool bash: Type validation failed: Value: {"command":"rg -n getProjectFile ls.nim","description":"Search getProjectFile occurrences in ls.nim"}. Error message: [ { "code": "invalid_type", "expected": "number", "received": "undefined", "path": [ "timeout" ], "message": "Required" } ] ```
Author
Owner

@Syazvinski commented on GitHub (Jul 28, 2025):

Yeah. it seems this issue is based on how different providers do tool use. Maybe we could add a feature to speciy specific providers without doing it in openrouter settings? openrtouer has docs for this from the API side, would be useful to have a working list of providers for different models.

@Syazvinski commented on GitHub (Jul 28, 2025): Yeah. it seems this issue is based on how different providers do tool use. Maybe we could add a feature to speciy specific providers without doing it in openrouter settings? openrtouer has docs for this from the API side, would be useful to have a working list of providers for different models.
Author
Owner

@bb33bb commented on GitHub (Jul 29, 2025):

i use github copolit, now github seems like OK, everything seems well when using opencode.

@bb33bb commented on GitHub (Jul 29, 2025): i use github copolit, now github seems like OK, everything seems well when using opencode.
Author
Owner

@andrii-k6a commented on GitHub (Aug 4, 2025):

I see this with gpt-4.1:

Image
@andrii-k6a commented on GitHub (Aug 4, 2025): I see this with gpt-4.1: <img width="662" height="406" alt="Image" src="https://github.com/user-attachments/assets/fb157d91-e6c9-45f1-ae90-8b3fdddcc52d" />
Author
Owner

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

Now let me create the main analysis classes and continue with the refactoring. Since the file is quite
large, I'll need to split it into manageable sections. Let me first create a new, better structured
version:
Build claude-sonnet-4 (12:03 PM)

Write

The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text:
{"filePath": "xxxxxxxxxxxx".
Error message: JSON Parse error: Expected '}'

@bb33bb commented on GitHub (Aug 15, 2025): Now let me create the main analysis classes and continue with the refactoring. Since the file is quite large, I'll need to split it into manageable sections. Let me first create a new, better structured version: Build claude-sonnet-4 (12:03 PM) Write The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text: {"filePath": "xxxxxxxxxxxx". Error message: JSON Parse error: Expected '}'
Author
Owner

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

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Author
Owner

@jplourde71 commented on GitHub (Jan 28, 2026):

Perfect! Now let me create the modern navbar with all the requested features:
~ Preparing edit...
Tool execution aborted
▣ Build · claude-sonnet-4.5 · 1m 38s

@jplourde71 commented on GitHub (Jan 28, 2026): Perfect! Now let me create the modern navbar with all the requested features: ~ Preparing edit... Tool execution aborted ▣ Build · claude-sonnet-4.5 · 1m 38s
Author
Owner

@djosh34 commented on GitHub (Jan 29, 2026):

Perfect! Now let me create the modern navbar with all the requested features: ~ Preparing edit... Tool execution aborted ▣ Build · claude-sonnet-4.5 · 1m 38s

Same exact problem here, using github copilot with claude-sonnet-4.5

@djosh34 commented on GitHub (Jan 29, 2026): > Perfect! Now let me create the modern navbar with all the requested features: ~ Preparing edit... Tool execution aborted ▣ Build · claude-sonnet-4.5 · 1m 38s Same exact problem here, using github copilot with claude-sonnet-4.5
Author
Owner

@dasheck0 commented on GitHub (Jan 29, 2026):

Same exact problem here, using github copilot with claude-sonnet-4.5

Me too. But only recently. Never had this before. But since a few hours more or less constantly

@dasheck0 commented on GitHub (Jan 29, 2026): > Same exact problem here, using github copilot with claude-sonnet-4.5 Me too. But only recently. Never had this before. But since a few hours more or less constantly
Author
Owner

@leogsouza commented on GitHub (Jan 29, 2026):

Same issue here using copilot with claude sonnet 4.5

@leogsouza commented on GitHub (Jan 29, 2026): Same issue here using copilot with claude sonnet 4.5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#781