Skip to content

fix: address tool/plugin issues #11413, #11130, #11436#11465

Closed
lailoo wants to merge 2 commits into
anomalyco:devfrom
lailoo:fix/tool-issues-11413-11130-11436
Closed

fix: address tool/plugin issues #11413, #11130, #11436#11465
lailoo wants to merge 2 commits into
anomalyco:devfrom
lailoo:fix/tool-issues-11413-11130-11436

Conversation

@lailoo

@lailoo lailoo commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes three tool/plugin related issues:

#11413 - question tool schema causes 400 with Gemini

Problem: The question tool's JSON Schema contains non-standard fields (ref, $schema) from Zod's .meta() that Gemini API rejects.

Fix: Updated sanitizeGemini function in transform.ts to skip these non-standard fields when preparing schemas for Gemini.

#11130 - plugins silently fail with bad syntax

Problem: Duplicate keys in opencode.json (e.g., two "plugin" entries) are silently ignored, with the second value overwriting the first.

Fix: Added duplicate key detection using jsonc-parser's visit function. Now throws a helpful error message suggesting array syntax:

Duplicate key "plugin" at line 3, column 3. Use an array for multiple values, e.g. "plugin": ["value1", "value2"]

#11436 - file has been modified since it was last read

Problem: False positive errors when file mtime differs from read time by only a few milliseconds (e.g., 14ms difference) due to filesystem timestamp precision.

Fix: Added 100ms tolerance to the file modification time check in time.ts.

Testing

  • bun run typecheck passes

Files Changed

  • packages/opencode/src/provider/transform.ts - Gemini schema sanitization
  • packages/opencode/src/config/config.ts - Duplicate key detection
  • packages/opencode/src/file/time.ts - File time tolerance

…malyco#11436

- fix(provider): remove non-standard JSON Schema fields (ref, $schema) for Gemini compatibility (anomalyco#11413)
- fix(config): detect and report duplicate keys in config files with helpful error message (anomalyco#11130)
- fix(file): add 100ms tolerance to file modification time check to prevent false positives (anomalyco#11436)
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

…11436 fixes

- test(transform): add tests for Gemini schema sanitization removing ref and $schema fields
- test(config): add tests for duplicate key detection in config files
- test(file): add tests for FileTime.assert 100ms tolerance
@lailoo lailoo closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant