Skip to content

Commit 6200190

Browse files
currentsuspectOpenClaude (mimo-v2.5-pro)
andcommitted
fix: move bodyContainsImages above stableStringify comment
The helper was inserted between the stableStringify rationale comment and the serializeBody function it describes, making the comment appear to document bodyContainsImages. Move it above the comment so the comment remains adjacent to serializeBody. Co-Authored-By: OpenClaude (mimo-v2.5-pro) <openclaude@gitlawb.com>
1 parent f07fbf1 commit 6200190

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/services/api/openaiShim.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,15 +2112,6 @@ class OpenAIShimMessages {
21122112
return false
21132113
}
21142114

2115-
// WHY: byte-identity required for implicit prefix caching in
2116-
// OpenAI/Kimi/DeepSeek. stableStringify sorts object keys at every
2117-
// depth so spurious insertion-order differences across rebuilds of
2118-
// `body` (spread-merge, conditional assignments above) don't bust
2119-
// the provider's prefix hash.
2120-
//
2121-
// Local backends do not implement prefix caching, so the deep key-sort
2122-
// is pure CPU overhead per request (issue #1016). Drop to the native
2123-
// `JSON.stringify` fast path when the fast-path config opts out.
21242115
const bodyContainsImages = (): boolean => {
21252116
if (request.transport === 'responses') {
21262117
const responsesBody = buildResponsesBody()
@@ -2140,6 +2131,15 @@ class OpenAIShimMessages {
21402131
})
21412132
}
21422133

2134+
// WHY: byte-identity required for implicit prefix caching in
2135+
// OpenAI/Kimi/DeepSeek. stableStringify sorts object keys at every
2136+
// depth so spurious insertion-order differences across rebuilds of
2137+
// `body` (spread-merge, conditional assignments above) don't bust
2138+
// the provider's prefix hash.
2139+
//
2140+
// Local backends do not implement prefix caching, so the deep key-sort
2141+
// is pure CPU overhead per request (issue #1016). Drop to the native
2142+
// `JSON.stringify` fast path when the fast-path config opts out.
21432143
const serializeBody = (): string => {
21442144
const payload =
21452145
request.transport === 'responses' ? buildResponsesBody() : body

0 commit comments

Comments
 (0)