@@ -21,6 +21,8 @@ interface UseWarmTaskOptions {
2121 runtimeAdapter ?: string | null ;
2222 model ?: string | null ;
2323 reasoningEffort ?: string | null ;
24+ sandboxEnvironmentId ?: string | null ;
25+ customImageId ?: string | null ;
2426}
2527
2628export function useWarmTask ( {
@@ -32,6 +34,8 @@ export function useWarmTask({
3234 runtimeAdapter,
3335 model,
3436 reasoningEffort,
37+ sandboxEnvironmentId,
38+ customImageId,
3539} : UseWarmTaskOptions ) : void {
3640 const enabled = useFeatureFlag ( TASKS_PREWARM_SANDBOX_FLAG ) ;
3741 const client = useOptionalAuthenticatedClient ( ) ;
@@ -44,6 +48,8 @@ export function useWarmTask({
4448 const normalizedRuntimeAdapter = runtimeAdapter ?? null ;
4549 const normalizedModel = model ?? null ;
4650 const normalizedReasoningEffort = reasoningEffort ?? null ;
51+ const normalizedSandboxEnvironmentId = sandboxEnvironmentId ?? null ;
52+ const normalizedCustomImageId = customImageId ?? null ;
4753 const eligible =
4854 enabled &&
4955 isCloud &&
@@ -59,6 +65,8 @@ export function useWarmTask({
5965 runtimeAdapter : normalizedRuntimeAdapter ,
6066 model : normalizedModel ,
6167 reasoningEffort : normalizedReasoningEffort ,
68+ sandboxEnvironmentId : normalizedSandboxEnvironmentId ,
69+ customImageId : normalizedCustomImageId ,
6270 } ) } `
6371 : null ;
6472
@@ -84,6 +92,8 @@ export function useWarmTask({
8492 const warmRuntimeAdapter = normalizedRuntimeAdapter ;
8593 const warmModel = normalizedModel ;
8694 const warmReasoningEffort = normalizedReasoningEffort ;
95+ const warmSandboxEnvironmentId = normalizedSandboxEnvironmentId ;
96+ const warmCustomImageId = normalizedCustomImageId ;
8797 debounceRef . current = setTimeout ( ( ) => {
8898 debounceRef . current = null ;
8999 lastWarmedKeyRef . current = key ;
@@ -95,6 +105,10 @@ export function useWarmTask({
95105 runtime_adapter : warmRuntimeAdapter ,
96106 model : warmModel ,
97107 reasoning_effort : warmReasoningEffort ,
108+ ...( warmSandboxEnvironmentId
109+ ? { sandbox_environment_id : warmSandboxEnvironmentId }
110+ : { } ) ,
111+ ...( warmCustomImageId ? { custom_image_id : warmCustomImageId } : { } ) ,
98112 } )
99113 . then ( ( warm ) => {
100114 if ( warm ) {
@@ -105,6 +119,8 @@ export function useWarmTask({
105119 runtimeAdapter : warmRuntimeAdapter ,
106120 model : warmModel ,
107121 reasoningEffort : warmReasoningEffort ,
122+ sandboxEnvironmentId : warmSandboxEnvironmentId ,
123+ customImageId : warmCustomImageId ,
108124 } ) ,
109125 { taskId : warm . task_id , runId : warm . run_id } ,
110126 ) ;
@@ -127,5 +143,7 @@ export function useWarmTask({
127143 normalizedRuntimeAdapter ,
128144 normalizedModel ,
129145 normalizedReasoningEffort ,
146+ normalizedSandboxEnvironmentId ,
147+ normalizedCustomImageId ,
130148 ] ) ;
131149}
0 commit comments