You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5070175
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: structure/04_transports-and-sidecars.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1093,6 +1093,21 @@ the shared Ark hostname is too broad because the two endpoint families reject op
1093
1093
1094
1094
## Chat structured-output compatibility
1095
1095
1096
+
First-party Kimi and Moonshot Chat destinations normalize a `$ref` with sibling keywords because
1097
+
their wire rejects that valid JSON Schema 2020-12 shape. Inlining preserves conjunction semantics:
1098
+
`required` members are unioned, lower numeric bounds take the maximum, upper numeric bounds take the
1099
+
minimum, and overlapping `properties` recurse with the same rules. The walk remains depth-, node-,
1100
+
and expansion-bounded. Unresolvable or cyclic references keep the existing bare-`$ref` fallback,
1101
+
and unrelated OpenAI-compatible providers retain the caller's schema unchanged.
1102
+
1103
+
[Decision Log]
1104
+
- 목적과 의도: Make Moonshot's compatibility rewrite remove rejected sibling `$ref` shapes without silently weakening a tool schema.
1105
+
- 기존 구현 및 제약 조건: The target and sibling both apply under JSON Schema 2020-12, but a shallow shared-property merge let sibling bounds replace stricter target bounds; Moonshot still requires the local bounded rewrite.
1106
+
- 검토한 주요 대안: Keep shallow sibling precedence; emit `allOf`; intersect only top-level bounds; recursively compose the supported set-valued and ordered assertions.
1107
+
- 선택한 방식: Reuse the existing bound and required intersection rules recursively for overlapping object properties inside the first-party destination gate.
1108
+
- 다른 대안 대신 이 방식을 선택한 이유: Shallow precedence weakens constraints, while a new `allOf` wire shape needs separate provider evidence; recursive composition fixes the demonstrated loss without broadening normalization to custom providers.
1109
+
- 장점, 단점 및 영향: Looser siblings cannot relax nested constraints and tighter siblings still narrow them; non-ordered conflicting keywords retain the existing sibling precedence and are not treated as a complete JSON Schema algebra.
1110
+
1096
1111
The `openai-chat` adapter translates Responses `text.format` and Chat Completions
1097
1112
`response_format` through one internal format, then emits `response_format` on the upstream chat
1098
1113
wire. That remains the default because silently returning prose breaks clients that requested a
0 commit comments