Skip to content

Commit 68fd714

Browse files
Integrate Vertex AI model name conversion into Claude Code provider
- Import and use getClaudeCodeModelId function in Claude Code handler - Check CLAUDE_CODE_USE_VERTEX environment variable at runtime - Convert model names to @Date format when Vertex AI is enabled - Ensures proper model name formatting for Vertex AI compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 16620b5 commit 68fd714

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api/providers/claude-code.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Anthropic } from "@anthropic-ai/sdk"
2-
import { claudeCodeDefaultModelId, type ClaudeCodeModelId, claudeCodeModels, type ModelInfo } from "@roo-code/types"
2+
import { claudeCodeDefaultModelId, type ClaudeCodeModelId, claudeCodeModels, type ModelInfo, getClaudeCodeModelId } from "@roo-code/types"
33
import { type ApiHandler } from ".."
44
import { ApiStreamUsageChunk, type ApiStream } from "../transform/stream"
55
import { runClaudeCode } from "../../integrations/claude-code/run"
@@ -20,11 +20,12 @@ export class ClaudeCodeHandler extends BaseProvider implements ApiHandler {
2020
// Filter out image blocks since Claude Code doesn't support them
2121
const filteredMessages = filterMessagesForClaudeCode(messages)
2222

23+
const useVertex = process.env.CLAUDE_CODE_USE_VERTEX === "true"
2324
const claudeProcess = runClaudeCode({
2425
systemPrompt,
2526
messages: filteredMessages,
2627
path: this.options.claudeCodePath,
27-
modelId: this.getModel().id,
28+
modelId: getClaudeCodeModelId(this.getModel().id as ClaudeCodeModelId, useVertex),
2829
maxOutputTokens: this.options.claudeCodeMaxOutputTokens,
2930
})
3031

0 commit comments

Comments
 (0)