Commit graph

5 commits

Author SHA1 Message Date
tanzhenxin
0eaa5e4561 fix(core): coerce stringified JSON values for anyOf/oneOf schemas (#2839)
Some LLMs serialize array/object values as JSON strings when the schema
uses anyOf/oneOf with mixed types (e.g., Python's `list[str] | None`).
The model returns '["url"]' (a string) instead of ["url"] (an array),
causing Ajv to reject otherwise valid input.

Add fixStringifiedJsonValues() coercion — same pattern as the existing
fixBooleanValues() — that parses stringified arrays/objects back to their
intended type when the schema expects a non-string type.
2026-04-03 23:02:25 +08:00
LaZzyMan
3ae2f8f671 fix: support JSON Schema draft-2020-12 for MCP tools (fixes #1818)
- Add Ajv2020 validator to support draft-2020-12 schemas used by playwright-mcp
- Auto-select validator based on $schema field
- Gracefully skip validation when schema compilation fails
- Add comprehensive tests for JSON Schema version support

Reference: gemini-cli implementation pattern
2026-02-12 16:31:01 +08:00
mingholy.lmh
ac3f7cb8c8 fix: ts erros in test file 2025-12-29 17:20:25 +08:00
Tu Shaokun
0f3e97ea1c fix(core): coerce string boolean values in schema validation
Self-hosted LLMs sometimes return "true"/"false" strings instead of
actual boolean values for tool parameters like `is_background`. This
causes schema validation to fail with type errors.

Fixes #1267
2025-12-17 16:14:02 +08:00
tanzhenxin
eb95c131be
Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00