Repository navigation
fix(opencode): sanitize unknown MCP schema formats before jsonSchema() - #20747
sureshpatel66 wants to merge 1 commit into
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Linked issue added: Fixes #20749. For CI context: the remaining failing check is unit (linux), and its log points to test/memory/abort-leak.test.ts (memory: abort controller leak > webfetch does not leak memory over many invocations). This appears unrelated to the MCP schema-format sanitizer changes in this PR. I ran the targeted checks locally on this branch:
|
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Summary
Strip nonstandard JSON Schema format values from MCP tool input schemas before passing them to ai/jsonSchema().
What changed
stripUnknownFormats()helper for MCP schemasformatvalues beforejsonSchema(...)Why
Some MCP providers return nonstandard schema formats such as
uint64,google-datetime, andpath, which trigger AJV warnings. This keeps standard format validation while removing unsupported provider-specific format annotations.Testing
bun test test/mcp/schema.test.tsbun run typecheckbun run buildFixes #20749