Skip to content

Conversation

@grahfmusic
Copy link

@grahfmusic grahfmusic commented Feb 10, 2026

Summary

  • LLMs sometimes output replaceAll as a string ("false"/"true") instead of a boolean, causing opencode's Go binary to reject it with expected boolean, received string
  • Adds pre-execution coercion in tool-execute-before.ts, following the existing pattern used for the task tool's subagent_type coercion

Error being fixed

← Edit lib/ui.py [replaceAll=false]
Error: The edit tool was called with invalid arguments: [
  {
    "expected": "boolean",
    "code": "invalid_type",
    "path": ["replaceAll"],
    "message": "Invalid input: expected boolean, received string"
  }
]

Change

if (input.tool === "edit") {
  if (typeof output.args.replaceAll === "string") {
    output.args.replaceAll = output.args.replaceAll === "true"
  }
}

Summary by cubic

Coerce the edit tool’s replaceAll argument from "true"/"false" strings to a boolean before execution. Prevents the Go binary’s schema error: “expected boolean, received string.”

Written for commit f1be1fc. Summary will update on new commits.

LLMs sometimes output replaceAll as a string ("false"/"true") instead
of a boolean. opencode's Go binary does strict schema validation and
rejects the string type with 'expected boolean, received string'.

Add pre-execution coercion in tool-execute-before, following the
existing pattern used for the task tool's subagent_type.
@github-actions
Copy link
Contributor

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA).

To sign the CLA, please comment on this PR with:

I have read the CLA Document and I hereby sign the CLA

This is a one-time requirement. Once signed, all your future contributions will be automatically accepted.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Cannot be 100% sure no regressions: coercion logic doesn't handle 'false' string case (only checks === 'true'), missing validation for other falsy string values, and no tests visible to verify edgeケース

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant