Skip to content

fix(provider): normalize kimi tool schemas for mfjs#37625

Open
StarpTech wants to merge 7 commits into
devfrom
kimi-mfjs-schema
Open

fix(provider): normalize kimi tool schemas for mfjs#37625
StarpTech wants to merge 7 commits into
devfrom
kimi-mfjs-schema

Conversation

@StarpTech

@StarpTech StarpTech commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Project Kimi tool schemas through one model-agnostic compatibility layer so an incompatible custom or MCP tool cannot reject the entire prompt.

Principles

  • preserve schema features accepted by Kimi and adapt only reproduced provider failures
  • keep explicit types authoritative; fallbacks may widen but never narrow valid tool inputs
  • propagate one conservative safety signal so non-monotonic applicators widen when a child changes or references a target that may change
  • separate recursive projection from reference integrity and provider limit enforcement

Testing

  • compare raw schemas with MFJS.sanitize using the generic live compatibility matrix
  • isolate one schema per request with bounded parallelism, timeouts, and filtered reruns
  • cover 29 schema families across Kimi 3, Kimi 2.7 Code, and Kimi 2.6

Result

  • adapt confirmed failures around enums, tuple and boolean items, typed anyOf, dangling required, references, and provider limits
  • preserve accepted features including const, prefixItems, type arrays, nullable, composition, conditionals, and terminating recursive references
  • all 29 projected cases are accepted by all three models

@petterssonjonas

Copy link
Copy Markdown

related issue: #37496

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.

2 participants