Files
magpie/internal
ggbdpq 837ea5f565 gateway: a Kimi tool schema with items is an array, not its enum's string, as Gemini's is now (#3867)
yetone, #3867: kimiSchemaType and collectUntypedEnums read an untyped
schema's enum or const before its keywords, so a tool's
{"items":{"type":"string"},"enum":["a","b"]} reached Kimi typed "string"
with items beside it — the shape its Gemini sibling went out in until
d71362af made geminiSchemaType read an object's or array's keywords
(properties, items, keywordType) before its values, and Antigravity
turned that turn away over them.

- collectUntypedEnums: of an untyped node typed from its enum or const,
  its properties or items (keywordType, object or array) say the type
  first; a pattern's or minimum's string or number still loses to the
  values, as before (an integer enum beside a minimum stays integer).
- kimiSchemaType: the same keywords before the enum or const, a $ref's
  target included; the one its branches say unchanged.
- Whether Kimi refuses items on a string is not known (no report of it,
  no real Kimi request tried; #3867 leaves that to a real account); the
  two are kept apart either way, as Gemini's are.

Tests (kimi_schema_test.go): TestKimiToolEnumTypesItemsBeforeEnum, the
issue's shape through kimiToolEnumTypes and a $defs target with items
and a string enum through kimiToolRefTypes, an enum without items or
properties still typed from its values.

Run, in a worktree at upstream/main e056779a:
- go test -tags nogui ./internal/gateway -run
  'TestKimiToolEnumTypesItemsBeforeEnum' -count=1, before the change:
  FAIL (display typed "string" with items beside it, filter "string"
  with properties, the $ref's target "string"); after: ok, and
  TestKimiToolEnumTypes, TestKimiToolRefTypes and TestKimiLockedSampling
  pass as they were.

Fixes #3867

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-01 10:22:56 +08:00
..
…
…
…
…
…