@@ -27,7 +27,7 @@ import { getTestWorkerUrl, WranglerDevRunner } from './helpers/wrangler-runner';
2727import {
2828 createSandboxId ,
2929 createTestHeaders ,
30- createBaseImageHeaders ,
30+ createPythonImageHeaders ,
3131 cleanupSandbox
3232} from './helpers/test-fixtures' ;
3333import type { CodeContext , ExecutionResult } from '@repo/shared' ;
@@ -64,7 +64,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
6464
6565 test ( 'should create and list code contexts' , async ( ) => {
6666 currentSandboxId = createSandboxId ( ) ;
67- const headers = createTestHeaders ( currentSandboxId ) ;
67+ const headers = createPythonImageHeaders ( currentSandboxId ) ;
6868
6969 // Create Python context
7070 const pythonCtxResponse = await fetch (
@@ -112,7 +112,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
112112
113113 test ( 'should delete code context' , async ( ) => {
114114 currentSandboxId = createSandboxId ( ) ;
115- const headers = createTestHeaders ( currentSandboxId ) ;
115+ const headers = createPythonImageHeaders ( currentSandboxId ) ;
116116
117117 // Create context
118118 const createResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -154,7 +154,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
154154
155155 test ( 'should execute simple Python code' , async ( ) => {
156156 currentSandboxId = createSandboxId ( ) ;
157- const headers = createTestHeaders ( currentSandboxId ) ;
157+ const headers = createPythonImageHeaders ( currentSandboxId ) ;
158158
159159 // Create Python context
160160 const ctxResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -185,7 +185,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
185185
186186 test ( 'should maintain Python state across executions' , async ( ) => {
187187 currentSandboxId = createSandboxId ( ) ;
188- const headers = createTestHeaders ( currentSandboxId ) ;
188+ const headers = createPythonImageHeaders ( currentSandboxId ) ;
189189
190190 // Create context
191191 const ctxResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -228,7 +228,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
228228
229229 test ( 'should handle Python errors gracefully' , async ( ) => {
230230 currentSandboxId = createSandboxId ( ) ;
231- const headers = createTestHeaders ( currentSandboxId ) ;
231+ const headers = createPythonImageHeaders ( currentSandboxId ) ;
232232
233233 // Create context
234234 const ctxResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -267,7 +267,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
267267
268268 test ( 'should execute simple JavaScript code' , async ( ) => {
269269 currentSandboxId = createSandboxId ( ) ;
270- const headers = createBaseImageHeaders ( currentSandboxId ) ;
270+ const headers = createTestHeaders ( currentSandboxId ) ;
271271
272272 // Create JavaScript context
273273 const ctxResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -297,7 +297,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
297297
298298 test ( 'should maintain JavaScript state across executions' , async ( ) => {
299299 currentSandboxId = createSandboxId ( ) ;
300- const headers = createBaseImageHeaders ( currentSandboxId ) ;
300+ const headers = createTestHeaders ( currentSandboxId ) ;
301301
302302 // Create context
303303 const ctxResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -337,7 +337,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
337337
338338 test ( 'should handle JavaScript errors gracefully' , async ( ) => {
339339 currentSandboxId = createSandboxId ( ) ;
340- const headers = createBaseImageHeaders ( currentSandboxId ) ;
340+ const headers = createTestHeaders ( currentSandboxId ) ;
341341
342342 // Create context
343343 const ctxResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -375,7 +375,7 @@ describe('Code Interpreter Workflow (E2E)', () => {
375375
376376 test ( 'should stream Python execution output' , async ( ) => {
377377 currentSandboxId = createSandboxId ( ) ;
378- const headers = createTestHeaders ( currentSandboxId ) ;
378+ const headers = createPythonImageHeaders ( currentSandboxId ) ;
379379
380380 // Create context
381381 const ctxResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -457,7 +457,7 @@ for i in range(3):
457457
458458 test ( 'should process data in Python and consume in JavaScript' , async ( ) => {
459459 currentSandboxId = createSandboxId ( ) ;
460- const headers = createTestHeaders ( currentSandboxId ) ;
460+ const headers = createPythonImageHeaders ( currentSandboxId ) ;
461461
462462 // Create Python context
463463 const pythonCtxResponse = await fetch (
@@ -528,7 +528,7 @@ console.log('Sum:', sum);
528528
529529 test ( 'should isolate variables between contexts' , async ( ) => {
530530 currentSandboxId = createSandboxId ( ) ;
531- const headers = createTestHeaders ( currentSandboxId ) ;
531+ const headers = createPythonImageHeaders ( currentSandboxId ) ;
532532
533533 // Create two Python contexts
534534 const ctx1Response = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -583,7 +583,7 @@ console.log('Sum:', sum);
583583
584584 test ( 'should maintain isolation across many contexts (12+)' , async ( ) => {
585585 currentSandboxId = createSandboxId ( ) ;
586- const headers = createBaseImageHeaders ( currentSandboxId ) ;
586+ const headers = createTestHeaders ( currentSandboxId ) ;
587587
588588 // Create 12 contexts
589589 const contexts : CodeContext [ ] = [ ] ;
@@ -653,7 +653,7 @@ console.log('Sum:', sum);
653653
654654 test ( 'should maintain state isolation with concurrent context execution' , async ( ) => {
655655 currentSandboxId = createSandboxId ( ) ;
656- const headers = createBaseImageHeaders ( currentSandboxId ) ;
656+ const headers = createTestHeaders ( currentSandboxId ) ;
657657
658658 // Create contexts sequentially
659659 const contexts : CodeContext [ ] = [ ] ;
@@ -734,7 +734,7 @@ console.log('Sum:', sum);
734734
735735 test ( 'should prevent concurrent execution on same context' , async ( ) => {
736736 currentSandboxId = createSandboxId ( ) ;
737- const headers = createBaseImageHeaders ( currentSandboxId ) ;
737+ const headers = createTestHeaders ( currentSandboxId ) ;
738738
739739 // Create single context
740740 const ctxResponse = await fetch ( `${ workerUrl } /api/code/context/create` , {
@@ -896,7 +896,8 @@ console.log('Sum:', sum);
896896
897897 test ( 'should return helpful error when Python unavailable on base image' , async ( ) => {
898898 currentSandboxId = createSandboxId ( ) ;
899- const headers = createBaseImageHeaders ( currentSandboxId ) ;
899+ // Use default headers (base image, no Python) to test Python-not-available error
900+ const headers = createTestHeaders ( currentSandboxId ) ;
900901
901902 // Try to create Python context on base image (no Python installed)
902903 const response = await fetch ( `${ workerUrl } /api/code/context/create` , {
0 commit comments