add claude code model selection (opus, sonnet, haiku)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 20:58:31 +00:00
co-authored by Claude Opus 4.6
parent c972553f22
commit d5fd3f58b1
4 changed files with 23 additions and 17 deletions
+8
View File
@@ -31,6 +31,7 @@ type ClaudeCodeParams = {
username: string;
prompt: string;
sessionKey: string;
model?: string;
};
type ClaudeCodeResult = {
@@ -151,6 +152,9 @@ export async function sendClaudeCode(params: ClaudeCodeParams): Promise<ClaudeCo
const claudeArgs = [CLAUDE_BIN, '-p', prompt, '--dangerously-skip-permissions', '--output-format', 'json'];
const subModel = params.model?.split('/')[1];
if (subModel) claudeArgs.push('--model', subModel);
const existingSession = claudeCodeSessions.get(sessionKey);
if (existingSession) {
claudeArgs.push('--resume', existingSession);
@@ -268,6 +272,7 @@ type ClaudeCodeStreamingParams = {
prompt: string;
sessionKey: string;
cwd?: string;
model?: string;
onEvent: (event: PiEvent) => void;
};
@@ -293,6 +298,9 @@ export async function sendClaudeCodeStreaming(params: ClaudeCodeStreamingParams)
'--include-partial-messages',
];
const subModel = params.model?.split('/')[1];
if (subModel) claudeArgs.push('--model', subModel);
const existingSession = claudeCodeSessions.get(sessionKey);
if (existingSession) {
claudeArgs.push('--resume', existingSession);