Skip to content

Regression in 1.1.3 #7002

Closed as not planned
Closed as not planned

Description

@brat002

Description

After an upgrade I see many messages like:

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

Tools are different: bash, read, write.

I didn't meet this before.

Plugins

none

OpenCode version

1.1.3

Steps to reproduce

GLM-4.7, MiniMax M2.1

Screenshot and/or share link

Image

Operating System

OSX

Terminal

Ghostty

Activity

  1. github-actions commented on Jan 5, 2026

    @github-actions
    Contributor

    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.

  2. rekram1-node commented on Jan 6, 2026

    @rekram1-node
    Collaborator

    dont think any changes were made in this department in many releases, what provider are u using?

  3. brat002 commented on Jan 6, 2026

    @brat002
    Author

    I have the issue even with BigPikle:

    Output


    Assistant (Build · big-pickle · 5.0s)

    Tool: bash
    
    **Input:**
    ```json
    {
      "bash\n<arg_key>command": "cat > /tmp/fix_exerciseMarkdown.js << 'ENDFILE'\nconst fs = require('fs');\n\nlet exerciseTest = fs.readFileSync('/Users/brat002/projects/lex-platform/__tests__/unit/exerciseMarkdown
    .test.ts', 'utf8');\n\n// Fix getDefaultPrompt() calls\nexerciseTest = exerciseTest.replace(\n  /expect\\(exerciseNode\\.getDefaultPrompt\\(\\)\\)\\.toBe\\(originalPrompt\\);/g,\n  `expect(exerciseNode.getConfig
    ().lessonTopic).toBe(originalPrompt);`\n);\n\nexerciseTest = exerciseTest.replace(\n  /expect\\(exerciseNode\\.getDefaultType\\(\\)\\)\\.toBe\\(originalType\\);/g,\n  `expect(exerciseNode.getConfig().questionTyp
    e).toBe(originalType);`\n);\n\nexerciseTest = exerciseTest.replace(\n  /verificationResults\\.exercisePrompt = child\\.getDefaultPrompt\\(\\);/g,\n  `verificationResults.exercisePrompt = child.getConfig().lesson
    Topic;`\n);\n\nexerciseTest = exerciseTest.replace(\n  /verificationResults\\.exerciseType = child\\.getDefaultType\\(\\);/g,\n  `verificationResults.exerciseType = child.getConfig().questionType;`\n);\n\n// Fix
     $createExerciseNode calls\nexerciseTest = exerciseTest.replace(\n  /\\$createExerciseNode\\('combo', '(.*?)'\\)/g,\n  `$createExerciseNode({questionType: 'combo', lessonTopic: '$1'})`\n);\n\nexerciseTest = exer
    ciseTest.replace(\n  /\\$createExerciseNode\\('answer', '(.*?)'\\)/g,\n  `$createExerciseNode({questionType: 'answer', lessonTopic: '$1'})`\n);\n\nexerciseTest = exerciseTest.replace(\n  /\\$createExerciseNode\\
    ('combo', ''\\)/g,\n  `$createExerciseNode({questionType: 'combo'})`\n);\n\nfs.writeFileSync('/Users/brat002/projects/lex-platform/__tests__/unit/exerciseMarkdown.test.ts', exerciseTest);\nconsole.log('Fixed Exe
    rciseNode API calls');\nENDFILE\nnode /tmp/fix_exerciseMarkdown.js",
      "description": "Create and run fix script for exerciseMarkdown test"
    }
    

    Error:

    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.
    
    
    ---
    
  4. johnyvelho commented on Jan 6, 2026

    @johnyvelho

    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

  5. rekram1-node commented on Jan 6, 2026

    @rekram1-node
    Collaborator

    can anyone send me:

    opencode export > session.json

    Run this in ur terminal and send file

  6. jimitshah77 commented on Jan 7, 2026

    @jimitshah77

    can anyone send me:

    opencode export > session.json

    Run this in ur terminal and send file

    @rekram1-node

    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.

    session-ses_4688.md

  7. alikehel commented on Jan 7, 2026

    @alikehel

    can anyone send me:

    opencode export > session.json

    Run this in ur terminal and send file

    session-ses_466f.md

  8. rekram1-node commented on Jan 7, 2026

    @rekram1-node
    Collaborator

    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!

  9. alikehel commented on Jan 7, 2026

    @alikehel

    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!

    session.json

    I think it only happens when trying to write JSON, notice the last write succeeded because it was just text.

  10. graffhyrum commented on Jan 8, 2026

    @graffhyrum

    can anyone send me:
    opencode export > session.json
    Run this in ur terminal and send file

    @rekram1-node

    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.

    session-ses_4688.md

    session.json

  11. xfhg commented on Jan 8, 2026

    @xfhg

    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)
    
    ---
    
  12. westito commented on Jan 8, 2026

    @westito
  13. rekram1-node commented on Jan 8, 2026

    @rekram1-node
    Collaborator

    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

  14. 5 remaining items

  15. VictorNoxx commented on Jan 26, 2026

    @VictorNoxx

    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

  16. GiveMe-A-Name commented on Jan 28, 2026

    @GiveMe-A-Name

    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

    me too

  17. brat002 commented on Feb 4, 2026

    @brat002
    Author

    Issue still exists

  18. reopened this on Feb 4, 2026
  19. inttay1024-png commented on Feb 10, 2026

    @inttay1024-png

    session.json Issue still exists

  20. LeoNardo-LB commented on Feb 10, 2026

    @LeoNardo-LB

    same issue

  21. brat002 commented on Feb 10, 2026

    @brat002
    Author

    BTW, I never had the issue in Cline. Sometimes I see something similar in Kilo.

  22. truongvanluan-debug commented on Mar 16, 2026

    @truongvanluan-debug

    issue still exists. session.json show "state"."input": {} for "tool": "write". Would love to have this fixed!

  23. dotmobo commented on Mar 26, 2026

    @dotmobo

    same here with qwen 3 coder next 80B and the latest opencode

    Image
  24. JanAarts commented on Mar 27, 2026

    @JanAarts

    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.

  25. stepankotyk commented on Mar 28, 2026

    @stepankotyk

    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.

  26. removed
    bugSomething isn't working
    on May 3, 2026
  27. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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