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
<tool_call><tool_call>edit
~ Preparing edit...
Error: The edit tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"filePath"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
Both issues report the edit tool being called with invalid arguments resulting in 'invalid_type' errors. Feel free to ignore if this is a distinct issue.
Error: The bash tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"command"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
Same here. Using Z.ai provider with GLM 4.7. I got some messages error containing <tool_call> and the process just stops. Trying to reprocess will keep failing until closing the tui and reopening.
I've also never seen an error like this before 1.1.3
I've also got the following when using opus 4.5 (claude pro/max provider):
messages.65: tool_use ids were found without tool_result blocks immediately after: toolu_01YKQ6wVzdQ79xM5VaGejoK2. Each tool_use block must have a corresponding tool_result block in the next message.
this also kills the process and its not possible to continue
messages.1: tool_use ids were found without tool_result blocks immediately after: toolu_01LVL5ydPYorBqFmTLbUPtrk. Each tool_use block must have a corresponding tool_result block in the next message.
messages.1: tool_use ids were found without tool_result blocks immediately after: toolu_01LVL5ydPYorBqFmTLbUPtrk. Each tool_use block must have a corresponding tool_result block in the next message.
this bug completely destroyed all the workflows , please treat it as high priority, i'll buy you a round 🍺 . Detected crashing on GLM4.7
Session snippet:
---
## Assistant (Build · glm-4.7 · 6.1s)
_Thinking:_
The edit tool is failing consistently. This is very frustrating. Let me try a minimal change - just adding isFormLocked computed to track the refs correctly.
Actually, I already added isFormLocked in my last edit (lines 8-18), but the tool is rejecting it. The issue might be that the refs (isCreatingDraft, isSavingDraft, isPublishing) don't exist yet. Let me check if those refs are defined earlier in the file.
```
Tool: grep
**Input:**
```json
{
"path": "REDACTED/new.vue",
"pattern": "const isCreatingDraft ="
}
```
**Output:**
```
Found 1 matches
REDACTED/new.vue:
Line 263: const isCreatingDraft = ref(false)
```
```
---
## Assistant (Build · glm-4.7 · 46.5s)
_Thinking:_
The refs exist at line 263 onwards (isProvidersLoaded at 263, isTypesLoaded at 266, isCategoriesLoaded at 269, isFormLocked at 272). isFormLocked at line 272 is computed. That's after the functions I need to create.
Let me add just the isFormLocked computed and then leave functions for later.
```
Tool: edit
**Input:**
```json
{
"filePath": "REDACTED/new.vue",
"newString": "const stepCount = 3\n\n// Track loading states explicitly\nconst isProvidersLoaded = ref(false)\nconst isTypesLoaded = ref(false)\nconst isCategoriesLoaded = ref(false)\n\n// Form locking - prevents editing during save operations\nconst isFormLocked = computed(() =>\n isCreatingDraft.value ||\n isSavingDraft.value ||\n isPublishing.value\n)\n\nconst step1Valid = computed(() => {\n if (!isProvidersLoaded.value || !isTypesLoaded.value || !isCategoriesLoaded.value) {\n return false\n }\n return form.name.trim().length > 0 &&\n form.providerId.trim().length > 0 &&\n form.serviceTypeId.trim().length > 0 &&\n form.serviceCategoryId.trim().length > 0\n})"
}
```
**Error:**
```
Error: The edit tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"oldString"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
```
```
---
## Assistant (Build · glm-4.7 · 32.9s)
---
Reacted by alexandr-ku-MA, Yukai Huang, Han Yang and Alex
There was no regression here this is just models failing to call tools (op) and then some of you are discussing an entirely different issue w/ tool use id stuff which is also not a regression in 1.1.3
Error: The grep tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"pattern"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
still same .... i have wrote detailed instructions how to use tools and no success
Error: The grep tool was called with invalid arguments: [ { "expected": "string", "code": "invalid_type", "path": [ "pattern" ], "message": "Invalid input: expected string, received undefined" } ]. Please rewrite the input so it satisfies the expected schema.
still same .... i have wrote detailed instructions how to use tools and no success
I am having the same issue. I use qwen3-coder-next:q4_K_M, served by ollama and forwarded to using open-webui (v0.8.11) opencode (1.2.27).
~ Preparing write...
Error: The write tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"filePath"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
Update:
Mitigated the issue by increasing context available to the model (32k -> 128k) but the downside is that the model is much slower now. Most issues arise when context window in opencode is full.
Activity
github-actions commentedon Jan 5, 2026
This issue might be a duplicate of existing issues. Please check:
Both issues report the edit tool being called with invalid arguments resulting in 'invalid_type' errors. Feel free to ignore if this is a distinct issue.
rekram1-node commentedon Jan 6, 2026
dont think any changes were made in this department in many releases, what provider are u using?
brat002 commentedon Jan 6, 2026
I have the issue even with BigPikle:
Output
Assistant (Build · big-pickle · 5.0s)
Error:
johnyvelho commentedon Jan 6, 2026
Same here. Using Z.ai provider with GLM 4.7. I got some messages error containing <tool_call> and the process just stops. Trying to reprocess will keep failing until closing the tui and reopening.
I've also never seen an error like this before 1.1.3
I've also got the following when using opus 4.5 (claude pro/max provider):
this also kills the process and its not possible to continue
rekram1-node commentedon Jan 6, 2026
can anyone send me:
opencode export > session.jsonRun this in ur terminal and send file
jimitshah77 commentedon Jan 7, 2026
@rekram1-node
messages.1:
tool_useids were found withouttool_resultblocks immediately after: toolu_01LVL5ydPYorBqFmTLbUPtrk. Eachtool_useblock must have a correspondingtool_resultblock in the next message.session-ses_4688.md
alikehel commentedon Jan 7, 2026
session-ses_466f.md
rekram1-node commentedon Jan 7, 2026
can you please run the command I sent you? notice that it is a json file? I want the actual json for the session plz!
alikehel commentedon Jan 7, 2026
session.json
I think it only happens when trying to write JSON, notice the last write succeeded because it was just text.
graffhyrum commentedon Jan 8, 2026
session.json
xfhg commentedon Jan 8, 2026
this bug completely destroyed all the workflows , please treat it as high priority, i'll buy you a round 🍺 . Detected crashing on GLM4.7
Session snippet:
--- ## Assistant (Build · glm-4.7 · 6.1s) _Thinking:_ The edit tool is failing consistently. This is very frustrating. Let me try a minimal change - just adding isFormLocked computed to track the refs correctly. Actually, I already added isFormLocked in my last edit (lines 8-18), but the tool is rejecting it. The issue might be that the refs (isCreatingDraft, isSavingDraft, isPublishing) don't exist yet. Let me check if those refs are defined earlier in the file. ``` Tool: grep **Input:** ```json { "path": "REDACTED/new.vue", "pattern": "const isCreatingDraft =" } ``` **Output:** ``` Found 1 matches REDACTED/new.vue: Line 263: const isCreatingDraft = ref(false) ``` ``` --- ## Assistant (Build · glm-4.7 · 46.5s) _Thinking:_ The refs exist at line 263 onwards (isProvidersLoaded at 263, isTypesLoaded at 266, isCategoriesLoaded at 269, isFormLocked at 272). isFormLocked at line 272 is computed. That's after the functions I need to create. Let me add just the isFormLocked computed and then leave functions for later. ``` Tool: edit **Input:** ```json { "filePath": "REDACTED/new.vue", "newString": "const stepCount = 3\n\n// Track loading states explicitly\nconst isProvidersLoaded = ref(false)\nconst isTypesLoaded = ref(false)\nconst isCategoriesLoaded = ref(false)\n\n// Form locking - prevents editing during save operations\nconst isFormLocked = computed(() =>\n isCreatingDraft.value ||\n isSavingDraft.value ||\n isPublishing.value\n)\n\nconst step1Valid = computed(() => {\n if (!isProvidersLoaded.value || !isTypesLoaded.value || !isCategoriesLoaded.value) {\n return false\n }\n return form.name.trim().length > 0 &&\n form.providerId.trim().length > 0 &&\n form.serviceTypeId.trim().length > 0 &&\n form.serviceCategoryId.trim().length > 0\n})" } ``` **Error:** ``` Error: The edit tool was called with invalid arguments: [ { "expected": "string", "code": "invalid_type", "path": [ "oldString" ], "message": "Invalid input: expected string, received undefined" } ]. Please rewrite the input so it satisfies the expected schema. ``` ``` --- ## Assistant (Build · glm-4.7 · 32.9s) ---westito commentedon Jan 8, 2026
rekram1-node commentedon Jan 8, 2026
There was no regression here this is just models failing to call tools (op) and then some of you are discussing an entirely different issue w/ tool use id stuff which is also not a regression in 1.1.3
5 remaining items
VictorNoxx commentedon Jan 26, 2026
Error: The grep tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"pattern"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
still same .... i have wrote detailed instructions how to use tools and no success
GiveMe-A-Name commentedon Jan 28, 2026
me too
brat002 commentedon Feb 4, 2026
Issue still exists
inttay1024-png commentedon Feb 10, 2026
session.json Issue still exists
LeoNardo-LB commentedon Feb 10, 2026
same issue
brat002 commentedon Feb 10, 2026
BTW, I never had the issue in Cline. Sometimes I see something similar in Kilo.
truongvanluan-debug commentedon Mar 16, 2026
issue still exists. session.json show "state"."input": {} for "tool": "write". Would love to have this fixed!
dotmobo commentedon Mar 26, 2026
same here with qwen 3 coder next 80B and the latest opencode
JanAarts commentedon Mar 27, 2026
I am having the same issue. I use qwen3-coder-next:q4_K_M, served by ollama and forwarded to using open-webui (v0.8.11) opencode (1.2.27).
~ Preparing write...
Error: The write tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"filePath"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
Update:
Mitigated the issue by increasing context available to the model (32k -> 128k) but the downside is that the model is much slower now. Most issues arise when context window in opencode is full.
stepankotyk commentedon Mar 28, 2026
start getting same issue with DesktopApp (latest verion) . CLI is working fine.
[
{
"expected": "string",
"code": "invalid_type",
"path": [
"command"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"description"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
log from assistant
"path": {
"cwd": "/Users/stepan/Projects/network projects",
"root": "/"
},
"cost": 0,
"tokens": {
"total": 26199,
"input": 172,
"output": 43,
"reasoning": 29,
"cache": {
"read": 25984,
"write": 0
}
},
"finish": "tool-calls",
"id": "msg_d34ed2318001lh3Ak2SKa6kxCr",
"sessionID": "ses_2cb4732a7ffeBIdGhdVUiC81xX"
},
"parts": [
{
"type": "reasoning",
"text": "The write tool keeps failing because I'm not providing the content parameter. Let me write the globe.js file with the content parameter properly filled in.",
"time": {
"start": 1774709456212,
"end": 1774709456681
},
"id": "prt_d34ed3d54001Iv6kUxJPVnBg8R",
"sessionID": "ses_2cb4732a7ffeBIdGhdVUiC81xX",
"messageID": "msg_d34ed2318001lh3Ak2SKa6kxCr"
},
{
"type": "tool",
"callID": "call_2020bc9e4fe542188fa0c5a0",
"tool": "write",
"state": {
"status": "error",
"input": {},
"error": "The write tool was called with invalid arguments: [\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "content"\n ],\n "message": "Invalid input: expected string, received undefined"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "filePath"\n ],\n "message": "Invalid input: expected string, received undefined"\n }\n].\nPlease rewrite the input so it satisfies the expected schema.",
"time": {
"start": 1774709456595,
"end": 1774709456597
}
},
"id": "prt_d34ed3ed2001RyhYxd9dap8KiJ",
"sessionID": "ses_2cb4732a7ffeBIdGhdVUiC81xX",
"messageID": "msg_d34ed2318001lh3Ak2SKa6kxCr"
}
]
}
UPD: Fixed only by complete reinstall.
github-actions commentedon Jul 3, 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.