@@ -21,6 +21,10 @@ const COMMAND_CODE_MODEL_ALIASES: Readonly<Record<string, string>> = {
2121 "glm-5.2" : "zai-org/GLM-5.2" ,
2222} ;
2323
24+ function canonicalCommandCodeModelId ( modelId : string ) : string {
25+ return Object . hasOwn ( COMMAND_CODE_MODEL_ALIASES , modelId ) ? COMMAND_CODE_MODEL_ALIASES [ modelId ] ! : modelId ;
26+ }
27+
2428/** Flatten tool-result content for the text-only wire output, keeping an `[image]` marker per image part in content order. */
2529function toolResultText ( content : string | OcxContentPart [ ] ) : string {
2630 if ( typeof content === "string" ) return content ;
@@ -318,7 +322,7 @@ function supportedCommandCodeEffort(provider: OcxProviderConfig, modelId: string
318322 // Compatibility ids (deepseek-v4-flash / glm-5.2) must resolve to their canonical
319323 // Command Code id before the effort lookup, or legacy requests silently lose the
320324 // reasoning effort because the official table is keyed by the canonical ids.
321- const canonicalId = COMMAND_CODE_MODEL_ALIASES [ modelId ] ?? modelId ;
325+ const canonicalId = canonicalCommandCodeModelId ( modelId ) ;
322326 const supported = commandCodeReasoningEfforts ( canonicalId ) ?? configuredReasoningEfforts ( provider , canonicalId ) ;
323327 if ( ! supported ) return undefined ;
324328 // Command Code's official profiles describe xhigh and ultra as the CLI labels that map to
@@ -347,7 +351,7 @@ export function createCommandCodeAdapter(provider: OcxProviderConfig): ProviderA
347351 config : await commandCodeConfig ( cwd ) , memory : "" , taste : null , skills : null ,
348352 permissionMode : "standard" , mode : "agent" ,
349353 params : {
350- model : COMMAND_CODE_MODEL_ALIASES [ parsed . modelId ] ?? parsed . modelId ,
354+ model : canonicalCommandCodeModelId ( parsed . modelId ) ,
351355 messages : wireMessages ( parsed . context . messages ) ,
352356 tools : wireTools ( tools ) ,
353357 system,
0 commit comments