@@ -48,6 +48,7 @@ import { classifyCloudLogAppend } from "./cloudLogGap";
4848import { CloudLogGapReconciler } from "./cloudLogGapReconciler" ;
4949import { CloudRunIdleTracker } from "./cloudRunIdleTracker" ;
5050import {
51+ type CloudRuntimeOptions ,
5152 getCloudPrAuthorshipMode ,
5253 getCloudRunSource ,
5354 getCloudRuntimeOptions ,
@@ -2589,6 +2590,7 @@ export class SessionService {
25892590 } ;
25902591
25912592 let updatedTask : Task ;
2593+ let runtimeOptions : CloudRuntimeOptions ;
25922594 try {
25932595 const artifactIds = await this . d . h . uploadTaskStagedAttachments (
25942596 authCredentials . client ,
@@ -2625,7 +2627,7 @@ export class SessionService {
26252627 previousStatus : session . cloudStatus ,
26262628 } ) ;
26272629
2628- const runtimeOptions = getCloudRuntimeOptions ( session , previousRun ) ;
2630+ runtimeOptions = getCloudRuntimeOptions ( session , previousRun ) ;
26292631
26302632 // Backend derives the snapshot from resumeFromRunId and restores the sandbox.
26312633 updatedTask = await authCredentials . client . runTaskInCloud (
@@ -2635,6 +2637,7 @@ export class SessionService {
26352637 adapter : runtimeOptions . adapter ,
26362638 model : runtimeOptions . model ,
26372639 reasoningLevel : runtimeOptions . reasoningLevel ,
2640+ initialPermissionMode : runtimeOptions . initialPermissionMode ,
26382641 resumeFromRunId : session . taskRunId ,
26392642 pendingUserMessage : transport . messageText ,
26402643 pendingUserArtifactIds :
@@ -2693,6 +2696,8 @@ export class SessionService {
26932696 ) ?. currentValue ;
26942697 const initialModel =
26952698 newRun . model ?? ( typeof priorModel === "string" ? priorModel : undefined ) ;
2699+ const initialReasoningEffort =
2700+ newRun . reasoning_effort ?? runtimeOptions . reasoningLevel ;
26962701 this . watchCloudTask (
26972702 session . taskId ,
26982703 newRun . id ,
@@ -2705,6 +2710,8 @@ export class SessionService {
27052710 initialModel ,
27062711 undefined ,
27072712 resumeFromEntryCount ,
2713+ undefined ,
2714+ initialReasoningEffort ,
27082715 ) ;
27092716
27102717 this . d . queryClient . invalidateQueries ( { queryKey : [ "tasks" ] } ) ;
@@ -3217,6 +3224,7 @@ export class SessionService {
32173224 apiHost : string ,
32183225 adapter : Adapter ,
32193226 initialModel ?: string ,
3227+ initialReasoningEffort ?: string ,
32203228 ) : Promise < void > {
32213229 const cacheKey = `${ apiHost } ::${ adapter } ` ;
32223230 let entry = this . previewConfigOptionsCache . get ( cacheKey ) ;
@@ -3260,6 +3268,16 @@ export class SessionService {
32603268 return { ...opt , currentValue : initialModel } ;
32613269 }
32623270 }
3271+ if (
3272+ opt . category === "thought_level" &&
3273+ opt . type === "select" &&
3274+ typeof initialReasoningEffort === "string"
3275+ ) {
3276+ const flat = flattenSelectOptions ( opt . options ) ;
3277+ if ( flat . some ( ( o ) => o . value === initialReasoningEffort ) ) {
3278+ return { ...opt , currentValue : initialReasoningEffort } ;
3279+ }
3280+ }
32633281 return opt ;
32643282 } ) ;
32653283
@@ -3298,6 +3316,7 @@ export class SessionService {
32983316 taskDescription ?: string ,
32993317 resumeFromEntryCount ?: number ,
33003318 runStatus ?: TaskRunStatus ,
3319+ initialReasoningEffort ?: string ,
33013320 ) : ( ) => void {
33023321 const taskRunId = runId ;
33033322
@@ -3337,6 +3356,7 @@ export class SessionService {
33373356 apiHost ,
33383357 adapter ,
33393358 initialModel ,
3359+ initialReasoningEffort ,
33403360 ) ;
33413361 }
33423362 return ( ) => { } ;
@@ -3428,6 +3448,7 @@ export class SessionService {
34283448 apiHost ,
34293449 adapter ,
34303450 initialModel ,
3451+ initialReasoningEffort ,
34313452 ) ;
34323453
34333454 if ( shouldHydrateSession ) {
@@ -4104,6 +4125,8 @@ export class SessionService {
41044125 const adapter =
41054126 task . latest_run ?. runtime_adapter === "codex" ? "codex" : "claude" ;
41064127 const initialModel = task . latest_run ?. model ?? undefined ;
4128+ const initialReasoningEffort =
4129+ task . latest_run ?. reasoning_effort ?? undefined ;
41074130
41084131 return this . watchCloudTask (
41094132 task . id ,
@@ -4118,6 +4141,7 @@ export class SessionService {
41184141 task . description ?? undefined ,
41194142 undefined ,
41204143 task . latest_run ?. status ,
4144+ initialReasoningEffort ,
41214145 ) ;
41224146 }
41234147
0 commit comments