Skip to content

Commit 4024e6e

Browse files
fihaaadeclaude
andcommitted
fix(schema): keep openai-compatible compatibility flags from config
Model.Compatibility omitted supportsStore, supportsUsageInStreaming, and supportsStrictMode, so config decoding dropped them even though the openai-chat protocol honors them. Strict gateways that reject `store` could not be configured. Fixes anomalyco#52617 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 22e771f commit 4024e6e

6 files changed

Lines changed: 69 additions & 0 deletions

File tree

‎packages/client/src/promise/generated/types.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,9 @@ export type ModelCompatibility = {
639639
maxTokensField?: ModelMaxTokensField
640640
requireFinishReason?: boolean
641641
requireAssistantAfterTool?: boolean
642+
supportsStore?: boolean
643+
supportsUsageInStreaming?: boolean
644+
supportsStrictMode?: boolean
642645
supportsPromptCacheKey?: boolean
643646
cacheFormat?: ModelCacheFormat
644647
supportsThinkingBlockBinding?: boolean
@@ -651,6 +654,9 @@ export type ProviderCompatibility = {
651654
maxTokensField?: ModelMaxTokensField
652655
requireFinishReason?: boolean
653656
requireAssistantAfterTool?: boolean
657+
supportsStore?: boolean
658+
supportsUsageInStreaming?: boolean
659+
supportsStrictMode?: boolean
654660
supportsPromptCacheKey?: boolean
655661
cacheFormat?: ModelCacheFormat
656662
}

‎packages/core/test/config/provider.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,9 @@ describe("ConfigProviderPlugin.Plugin", () => {
955955
requireFinishReason: false,
956956
supportsEffortUpdates: false,
957957
supportsThinkingBlockBinding: false,
958+
supportsStore: false,
959+
supportsUsageInStreaming: false,
960+
supportsStrictMode: false,
958961
},
959962
capabilities: { tools: true, input: ["text"], output: ["text"] },
960963
disabled: true,
@@ -1063,6 +1066,9 @@ describe("ConfigProviderPlugin.Plugin", () => {
10631066
requireFinishReason: false,
10641067
supportsEffortUpdates: false,
10651068
supportsThinkingBlockBinding: false,
1069+
supportsStore: false,
1070+
supportsUsageInStreaming: false,
1071+
supportsStrictMode: false,
10661072
})
10671073
expect(model.capabilities).toEqual({ tools: true, input: ["text"], output: ["text"] })
10681074
expect(model.enabled).toBe(false)

‎packages/protocol/openapi.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16824,6 +16824,15 @@
1682416824
"requireAssistantAfterTool": {
1682516825
"type": "boolean"
1682616826
},
16827+
"supportsStore": {
16828+
"type": "boolean"
16829+
},
16830+
"supportsUsageInStreaming": {
16831+
"type": "boolean"
16832+
},
16833+
"supportsStrictMode": {
16834+
"type": "boolean"
16835+
},
1682716836
"supportsPromptCacheKey": {
1682816837
"type": "boolean"
1682916838
},
@@ -17929,6 +17938,15 @@
1792917938
"requireAssistantAfterTool": {
1793017939
"type": "boolean"
1793117940
},
17941+
"supportsStore": {
17942+
"type": "boolean"
17943+
},
17944+
"supportsUsageInStreaming": {
17945+
"type": "boolean"
17946+
},
17947+
"supportsStrictMode": {
17948+
"type": "boolean"
17949+
},
1793217950
"supportsPromptCacheKey": {
1793317951
"type": "boolean"
1793417952
},

‎packages/schema/src/model-compatibility.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export const Compatibility = Schema.Struct({
2424
maxTokensField: MaxTokensField.pipe(optional),
2525
requireFinishReason: Schema.Boolean.pipe(optional),
2626
requireAssistantAfterTool: Schema.Boolean.pipe(optional),
27+
supportsStore: Schema.Boolean.pipe(optional),
28+
supportsUsageInStreaming: Schema.Boolean.pipe(optional),
29+
supportsStrictMode: Schema.Boolean.pipe(optional),
2730
supportsPromptCacheKey: Schema.Boolean.pipe(optional),
2831
/** Prompt-cache marker syntax the endpoint accepts. Overrides the route default; both send `cache_control`, and `alibaba` skips tool definitions. */
2932
cacheFormat: CacheFormat.pipe(optional),

‎services/www/openapi.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16824,6 +16824,15 @@
1682416824
"requireAssistantAfterTool": {
1682516825
"type": "boolean"
1682616826
},
16827+
"supportsStore": {
16828+
"type": "boolean"
16829+
},
16830+
"supportsUsageInStreaming": {
16831+
"type": "boolean"
16832+
},
16833+
"supportsStrictMode": {
16834+
"type": "boolean"
16835+
},
1682716836
"supportsPromptCacheKey": {
1682816837
"type": "boolean"
1682916838
},
@@ -17929,6 +17938,15 @@
1792917938
"requireAssistantAfterTool": {
1793017939
"type": "boolean"
1793117940
},
17941+
"supportsStore": {
17942+
"type": "boolean"
17943+
},
17944+
"supportsUsageInStreaming": {
17945+
"type": "boolean"
17946+
},
17947+
"supportsStrictMode": {
17948+
"type": "boolean"
17949+
},
1793217950
"supportsPromptCacheKey": {
1793317951
"type": "boolean"
1793417952
},

‎services/www/public/openapi.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16824,6 +16824,15 @@
1682416824
"requireAssistantAfterTool": {
1682516825
"type": "boolean"
1682616826
},
16827+
"supportsStore": {
16828+
"type": "boolean"
16829+
},
16830+
"supportsUsageInStreaming": {
16831+
"type": "boolean"
16832+
},
16833+
"supportsStrictMode": {
16834+
"type": "boolean"
16835+
},
1682716836
"supportsPromptCacheKey": {
1682816837
"type": "boolean"
1682916838
},
@@ -17929,6 +17938,15 @@
1792917938
"requireAssistantAfterTool": {
1793017939
"type": "boolean"
1793117940
},
17941+
"supportsStore": {
17942+
"type": "boolean"
17943+
},
17944+
"supportsUsageInStreaming": {
17945+
"type": "boolean"
17946+
},
17947+
"supportsStrictMode": {
17948+
"type": "boolean"
17949+
},
1793217950
"supportsPromptCacheKey": {
1793317951
"type": "boolean"
1793417952
},

0 commit comments

Comments
 (0)