This repository was archived by the owner on May 15, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export abstract class BaseOpenAiCompatibleProvider<ModelName extends string>
7979 // Get model-specific options for GLM models (applies Z.ai optimizations)
8080 // This allows third-party GLM models via OpenAI-compatible endpoints to benefit
8181 // from the same optimizations used by Z.ai
82+ console . log ( `[${ this . providerName } ] Using model ID: "${ model } "` )
8283 const glmOptions = getGlmModelOptions ( model )
8384
8485 // Centralized cap: clamp to 20% of the context window (unless provider-specific exceptions apply)
@@ -98,6 +99,8 @@ export abstract class BaseOpenAiCompatibleProvider<ModelName extends string>
9899 ? ( metadata ?. parallelToolCalls ?? false )
99100 : ( metadata ?. parallelToolCalls ?? true )
100101
102+ console . log ( `[${ this . providerName } ] parallel_tool_calls set to: ${ parallelToolCalls } ` )
103+
101104 // Convert messages with GLM-specific handling when applicable
102105 // mergeToolResultText prevents GLM models from dropping reasoning_content
103106 const convertedMessages = convertToOpenAiMessages ( messages , {
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export class LmStudioHandler extends BaseProvider implements SingleCompletionHan
4545 ) : ApiStream {
4646 // Get model-specific options for GLM models (applies Z.ai optimizations)
4747 const modelId = this . getModel ( ) . id
48+ console . log ( `[LM Studio] Using model ID: "${ modelId } "` )
4849 const glmOptions = getGlmModelOptions ( modelId )
4950
5051 // Convert messages with GLM-specific handling when applicable
@@ -96,6 +97,8 @@ export class LmStudioHandler extends BaseProvider implements SingleCompletionHan
9697 ? ( metadata ?. parallelToolCalls ?? false )
9798 : ( metadata ?. parallelToolCalls ?? true )
9899
100+ console . log ( `[LM Studio] parallel_tool_calls set to: ${ parallelToolCalls } ` )
101+
99102 const params : OpenAI . Chat . ChatCompletionCreateParamsStreaming & { draft_model ?: string } = {
100103 model : modelId ,
101104 messages : openAiMessages ,
Original file line number Diff line number Diff line change @@ -72,6 +72,13 @@ export interface GlmModelOptions {
7272export function getGlmModelOptions ( modelId : string ) : GlmModelOptions {
7373 const isGlm = isGlmModel ( modelId )
7474
75+ // Log GLM model detection result for diagnostics
76+ if ( isGlm ) {
77+ console . log ( `[GLM Detection] ✓ GLM model detected: "${ modelId } "` )
78+ console . log ( `[GLM Detection] - mergeToolResultText: true` )
79+ console . log ( `[GLM Detection] - disableParallelToolCalls: true` )
80+ }
81+
7582 return {
7683 mergeToolResultText : isGlm ,
7784 disableParallelToolCalls : isGlm ,
You can’t perform that action at this time.
0 commit comments