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
This issue might be a duplicate of existing issues. Please check:
Write tool called with invalid parameters #18131: Identical error message — write tool called with invalid parameters (Invalid input: expected string, received undefined for both content and filePath), same version 1.2.27
This issue appears to be related to how the write tool arguments are being processed/passed through the AI model response pipeline.
Error Analysis
The error indicates:
For both and fields - this suggests the arguments are being lost or undefined somewhere in the tool call chain.
Likely Root Causes
1. Tool Call Argument Parsing Issue
The tool is likely implemented as part of the edit/apply system. When the AI model generates a write operation, the arguments may not be properly extracted or validated before being passed to the tool execution layer.
2. Streaming Response Handling
If using streaming responses from the LLM, there could be a race condition where tool calls are parsed before complete arguments are received.
3. Schema Validation Timing
The error shows arguments are - this typically happens when:
The tool call arguments object is created before all fields are populated
There's a schema mismatch between what the model outputs and what the tool expects
Recommended Investigation
Check how tool is defined in the tool registry
Look at the tool argument extraction/validation logic
Verify the schema definition matches what the LLM is being told to output
Possible Fix
Ensure the tool schema explicitly marks fields as required and add validation before executing the tool to provide better error messages.
I am having similar issues with various models (even the ones provided by OpenCode, e.g. Big Pickle). Things got worse in the last 2 weeks, I would say.
I haven't installed any new plugins or added MCP servers or changed the config.
Activity
github-actions commentedon Mar 18, 2026
This issue might be a duplicate of existing issues. Please check:
Invalid input: expected string, received undefinedfor bothcontentandfilePath), same version 1.2.27If your issue is the same as #18131, please consider adding your details there instead.
RewFa-CEO commentedon Mar 19, 2026
Root Cause Analysis
This issue appears to be related to how the write tool arguments are being processed/passed through the AI model response pipeline.
Error Analysis
The error indicates:
For both and fields - this suggests the arguments are being lost or undefined somewhere in the tool call chain.
Likely Root Causes
1. Tool Call Argument Parsing Issue
The tool is likely implemented as part of the edit/apply system. When the AI model generates a write operation, the arguments may not be properly extracted or validated before being passed to the tool execution layer.
2. Streaming Response Handling
If using streaming responses from the LLM, there could be a race condition where tool calls are parsed before complete arguments are received.
3. Schema Validation Timing
The error shows arguments are - this typically happens when:
Recommended Investigation
Possible Fix
Ensure the tool schema explicitly marks fields as required and add validation before executing the tool to provide better error messages.
Upgrade OpenCode from v1.1.51 to v1.2.27
dctr commentedon Mar 20, 2026
To clarify, I am not running a custom model. This happens with Claude Sonnet/Opus 4.6
Taudris commentedon Apr 2, 2026
Still happening on 1.3.13 with Opus 4.6 on Copilot.
It also completely stops the agent, which is damaging to productivity.
ChanifRusydi commentedon Jun 4, 2026
Same here with latest version (1.15.13) and claude-opus-4.8
A few observable error is as follows :
Its also observed that it happen mostly when writing into file with big chunks
shochdoerfer commentedon Jun 29, 2026
I am having similar issues with various models (even the ones provided by OpenCode, e.g. Big Pickle). Things got worse in the last 2 weeks, I would say.
I haven't installed any new plugins or added MCP servers or changed the config.
adarshmadrecha commentedon Jul 11, 2026
The same issue still on latest (v1.17.18)
Model: MiniMax M3
github-actions commentedon Sep 10, 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.