replaceAll error when value is omitted or not boolean causes invalid_type error #655

Open
opened 2026-02-16 17:27:44 -05:00 by yindo · 9 comments
Owner

Originally created by @shirokun20 on GitHub (Jul 12, 2025).

Originally assigned to: @rekram1-node on GitHub.

🐛 Bug Report: replaceAll causes invalid_type error when omitted or not boolean

Description

When using replaceAll in an Opencode rule, an error occurs if the field is present but left undefined or not explicitly set to a boolean value (true or false).

Error output:

{
  "code": "invalid_type",
  "expected": "boolean",
  "received": "undefined",
  "path": ["replaceAll"],
  "message": "Required"
}

🖥️ Environment

  • Opencode Version: v0.2.33
  • OS: macOS 15.5
Originally created by @shirokun20 on GitHub (Jul 12, 2025). Originally assigned to: @rekram1-node on GitHub. # 🐛 Bug Report: `replaceAll` causes `invalid_type` error when omitted or not boolean ## Description When using `replaceAll` in an Opencode rule, an error occurs if the field is present but left undefined or not explicitly set to a boolean value (`true` or `false`). Error output: ```json { "code": "invalid_type", "expected": "boolean", "received": "undefined", "path": ["replaceAll"], "message": "Required" } ``` ## 🖥️ Environment - **Opencode Version**: v0.2.33 - **OS**: macOS 15.5
Author
Owner

@shirokun20 commented on GitHub (Jul 12, 2025):

How to fix that?

@shirokun20 commented on GitHub (Jul 12, 2025): How to fix that?
Author
Owner

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

what model?

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

@shirokun20 commented on GitHub (Jul 14, 2025):

Open AI

@shirokun20 commented on GitHub (Jul 14, 2025): Open AI
Author
Owner

@shirokun20 commented on GitHub (Jul 15, 2025):

finish fix?

@shirokun20 commented on GitHub (Jul 15, 2025): finish fix?
Author
Owner

@nacholupotti commented on GitHub (Jul 16, 2025):

Same error here

@nacholupotti commented on GitHub (Jul 16, 2025): Same error here
Author
Owner

@ahirner commented on GitHub (Nov 24, 2025):

On 1.0.98 and gemini 3 pro preview I get:

Edit <file in question> [replaceAll=false]
The edit tool was called with invalid arguments: [
  {
    "expected": "boolean",
    "code": "invalid_type",
    "path": [
      "replaceAll"
    ],
    "message": "Invalid input: expected boolean, received string"
  }
].
Please rewrite the input so it satisfies the expected schema.

It would proceed leaving replaceAll out and actually do something. Happends ca. 50% of the time.

@ahirner commented on GitHub (Nov 24, 2025): On 1.0.98 and gemini 3 pro preview I get: ``` Edit <file in question> [replaceAll=false] The edit tool was called with invalid arguments: [ { "expected": "boolean", "code": "invalid_type", "path": [ "replaceAll" ], "message": "Invalid input: expected boolean, received string" } ]. Please rewrite the input so it satisfies the expected schema. ``` It would proceed leaving `replaceAll` out and actually do something. Happends ca. 50% of the time.
Author
Owner

@gugahoi commented on GitHub (Dec 15, 2025):

Same here using Gemini 3 Pro Preview through GitHub Copilot. It eventually figures things out but it wastes a lot of time with this problem and it happens multiple times per prompt.

@gugahoi commented on GitHub (Dec 15, 2025): Same here using Gemini 3 Pro Preview through GitHub Copilot. It eventually figures things out but it wastes a lot of time with this problem and it happens multiple times per prompt.
Author
Owner

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

ill add a fix for this

@rekram1-node commented on GitHub (Dec 15, 2025): ill add a fix for this
Author
Owner

@julioocamargoo commented on GitHub (Feb 5, 2026):

Hi! Just reporting that the error is still happening on latest version. It also occurred here when using gemini-pro-preview through GitHub Copilot. Same behavior others have mentioned: It happens occasionally during interactions, but it manages to work around it.

@julioocamargoo commented on GitHub (Feb 5, 2026): Hi! Just reporting that the error is still happening on latest version. It also occurred here when using gemini-pro-preview through GitHub Copilot. Same behavior others have mentioned: It happens occasionally during interactions, but it manages to work around it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#655