fix(stream): match Command Code CLI transport behavior

This commit is contained in:
Patrick Wozniak
2026-08-25 15:54:18 +02:00
parent 349e50f829
commit c51a790530
9 changed files with 426 additions and 85 deletions
+4 -3
View File
@@ -26,6 +26,7 @@ import {
getModelsTimeoutMs,
inputModalitiesForModel,
loadCommandCodeModels,
MODEL_EFFORTS,
thinkingMetadataForModel,
type CommandCodeModel,
} from "./src/models.ts"
@@ -37,7 +38,7 @@ import { createCommandCodeRuntime } from "./src/runtime.ts"
import { createCommandCodeTransportRouter } from "./src/transport.ts"
function commandCodeHeaders(): Record<string, string> | undefined {
if (process.env.COMMANDCODE_ZDR === "1") {
if (process.env.CMD_ZDR === "1" || process.env.COMMANDCODE_ZDR === "1") {
return { "x-cmd-zdr": "1" }
}
return undefined
@@ -52,7 +53,7 @@ function createProviderConfig(
return {
name: "Command Code",
baseUrl: apiBase,
apiKey: getConfiguredApiKey() ?? "$COMMANDCODE_API_KEY",
apiKey: getConfiguredApiKey() ?? "$COMMAND_CODE_API_KEY",
api: "commandcode-custom",
streamSimple: streamCommandCode,
headers,
@@ -79,7 +80,7 @@ function createProviderConfig(
? {
supportsStore: false,
supportsDeveloperRole: false,
supportsReasoningEffort: true,
supportsReasoningEffort: MODEL_EFFORTS[model.id] !== undefined,
maxTokensField: "max_tokens",
}
: {