Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/server/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export async function getVSCodeModel(
selectedModelId = modelManager.getOpenAIModelId()
} else if (provider === 'anthropic') {
selectedModelId = modelManager.getAnthropicModelId()
} else if (provider === 'claude') {
selectedModelId = modelManager.getClaudeCodeBackgroundModelId()
Comment on lines +51 to +52

Copilot AI Jan 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The choice to always use Background model for vscode-lm-proxy with Claude provider may not align with all use cases. Consider documenting why Background model is the default choice rather than Thinking model, or consider making this configurable. This is consistent with how OpenAI and Anthropic providers work (they each have a single default), but the Claude provider has two distinct model types (Background vs Thinking).

Copilot uses AI. Check for mistakes.
}

if (!selectedModelId) {
Expand All @@ -56,11 +58,17 @@ export async function getVSCodeModel(
}

// providerが'claude'の場合は、モデルIDに含まれる文字列を元にモデルを分岐
if (provider === 'claude') {
if (provider === 'claude' && modelId !== 'vscode-lm-proxy') {
if (modelId.includes('haiku')) {
selectedModelId = modelManager.getClaudeCodeBackgroundModelId()
const backgroundModel = modelManager.getClaudeCodeBackgroundModelId()
if (backgroundModel) {
selectedModelId = backgroundModel
}
} else if (modelId.includes('sonnet') || modelId.includes('opus')) {
selectedModelId = modelManager.getClaudeCodeThinkingModelId()
const thinkingModel = modelManager.getClaudeCodeThinkingModelId()
if (thinkingModel) {
selectedModelId = thinkingModel
}
Comment on lines +63 to +71

Copilot AI Jan 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The null-checking added here is good defensive programming. However, if these methods return null, selectedModelId retains its previous value (the original modelId), which will likely fail at line 78-80 when calling vscode.lm.selectChatModels(). Consider throwing an error with a clear message when the required model configuration is missing, rather than silently continuing with an invalid model ID.

Copilot uses AI. Check for mistakes.
}
}

Expand Down
Loading