Skip to content

fix(opencode): reorder write tool schema to declare filePath before c…#29943

Open
RheagalFire wants to merge 1 commit into
anomalyco:devfrom
RheagalFire:fix/write-tool-field-order
Open

fix(opencode): reorder write tool schema to declare filePath before c…#29943
RheagalFire wants to merge 1 commit into
anomalyco:devfrom
RheagalFire:fix/write-tool-field-order

Conversation

@RheagalFire
Copy link
Copy Markdown

Issue for this PR

Closes #29940

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Reorders the write tool schema to declare filePath before content. Local models generate fields in declaration order, so when writing large files they can exhaust their token
budget on content and never produce filePath, causing a schema error.

Suggested by @strasharo in #26419.
Related: #18108

How did you verify your code works?

Verified the schema change compiles and the field order is correct. The fix is a single line swap with no behavioral change for models that generate all fields.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.

Write tool schema field ordering causes truncation failures with local models

1 participant