@@ -136,7 +136,8 @@ export class SessionService {
136136 }
137137
138138 private async doConnect ( params : ConnectParams ) : Promise < void > {
139- const { task, repoPath, initialPrompt, executionMode, adapter } = params ;
139+ const { task, repoPath, initialPrompt, executionMode, adapter, model } =
140+ params ;
140141 const { id : taskId , latest_run : latestRun } = task ;
141142 const taskTitle = task . title || task . description || "Task" ;
142143
@@ -212,6 +213,7 @@ export class SessionService {
212213 initialPrompt ,
213214 executionMode ,
214215 adapter ,
216+ model ,
215217 ) ;
216218 }
217219 } catch ( error ) {
@@ -357,6 +359,7 @@ export class SessionService {
357359 initialPrompt ?: ContentBlock [ ] ,
358360 executionMode ?: ExecutionMode ,
359361 adapter ?: "claude" | "codex" ,
362+ model ?: string ,
360363 ) : Promise < void > {
361364 if ( ! auth . client ) {
362365 throw new Error ( "Unable to reach server. Please check your connection." ) ;
@@ -405,8 +408,9 @@ export class SessionService {
405408 execution_type : "local" ,
406409 } ) ;
407410
408- // Set the user's preferred model if available
409- const preferredModel = useModelsStore . getState ( ) . getEffectiveModel ( ) ;
411+ // Set the model - use passed model if provided, otherwise use store's effective model
412+ const preferredModel =
413+ model ?? useModelsStore . getState ( ) . getEffectiveModel ( ) ;
410414 if ( preferredModel ) {
411415 await this . setSessionConfigOptionByCategory (
412416 taskId ,
0 commit comments