mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
feat: add diagnostic logging for GLM model detection
- Add console logging in getGlmModelOptions() to show when a GLM model is detected - Log model ID being used in LM Studio and OpenAI-compatible providers - Log parallel_tool_calls value being applied - Helps users verify GLM detection is working correctly Addresses issue #11071 where users cannot verify if GLM detection is functioning
This commit is contained in:
parent
1379ba4cd9
commit
2c5d905aeb
3 changed files with 13 additions and 0 deletions
|
|
@ -79,6 +79,7 @@ export abstract class BaseOpenAiCompatibleProvider<ModelName extends string>
|
|||
// Get model-specific options for GLM models (applies Z.ai optimizations)
|
||||
// This allows third-party GLM models via OpenAI-compatible endpoints to benefit
|
||||
// from the same optimizations used by Z.ai
|
||||
console.log(`[${this.providerName}] Using model ID: "${model}"`)
|
||||
const glmOptions = getGlmModelOptions(model)
|
||||
|
||||
// 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>
|
|||
? (metadata?.parallelToolCalls ?? false)
|
||||
: (metadata?.parallelToolCalls ?? true)
|
||||
|
||||
console.log(`[${this.providerName}] parallel_tool_calls set to: ${parallelToolCalls}`)
|
||||
|
||||
// Convert messages with GLM-specific handling when applicable
|
||||
// mergeToolResultText prevents GLM models from dropping reasoning_content
|
||||
const convertedMessages = convertToOpenAiMessages(messages, {
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ export class LmStudioHandler extends BaseProvider implements SingleCompletionHan
|
|||
): ApiStream {
|
||||
// Get model-specific options for GLM models (applies Z.ai optimizations)
|
||||
const modelId = this.getModel().id
|
||||
console.log(`[LM Studio] Using model ID: "${modelId}"`)
|
||||
const glmOptions = getGlmModelOptions(modelId)
|
||||
|
||||
// Convert messages with GLM-specific handling when applicable
|
||||
|
|
@ -96,6 +97,8 @@ export class LmStudioHandler extends BaseProvider implements SingleCompletionHan
|
|||
? (metadata?.parallelToolCalls ?? false)
|
||||
: (metadata?.parallelToolCalls ?? true)
|
||||
|
||||
console.log(`[LM Studio] parallel_tool_calls set to: ${parallelToolCalls}`)
|
||||
|
||||
const params: OpenAI.Chat.ChatCompletionCreateParamsStreaming & { draft_model?: string } = {
|
||||
model: modelId,
|
||||
messages: openAiMessages,
|
||||
|
|
|
|||
|
|
@ -72,6 +72,13 @@ export interface GlmModelOptions {
|
|||
export function getGlmModelOptions(modelId: string): GlmModelOptions {
|
||||
const isGlm = isGlmModel(modelId)
|
||||
|
||||
// Log GLM model detection result for diagnostics
|
||||
if (isGlm) {
|
||||
console.log(`[GLM Detection] ✓ GLM model detected: "${modelId}"`)
|
||||
console.log(`[GLM Detection] - mergeToolResultText: true`)
|
||||
console.log(`[GLM Detection] - disableParallelToolCalls: true`)
|
||||
}
|
||||
|
||||
return {
|
||||
mergeToolResultText: isGlm,
|
||||
disableParallelToolCalls: isGlm,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue