@@ -86,7 +86,7 @@ export async function runProgrammaticStep(
8686
8787 // Run with either a generator or a sandbox.
8888 let generator = runIdToGenerator [ agentState . runId ]
89- let sandbox = sandboxManager . getSandbox ( agentState . runId )
89+ let sandbox = sandboxManager . getSandbox ( { runId : agentState . runId } )
9090
9191 // Check if we need to initialize a generator
9292 if ( ! generator && ! sandbox ) {
@@ -113,18 +113,18 @@ export async function runProgrammaticStep(
113113
114114 if ( typeof template . handleSteps === 'string' ) {
115115 // Initialize QuickJS sandbox for string-based generator
116- sandbox = await sandboxManager . getOrCreateSandbox (
117- agentState . runId ,
118- template . handleSteps ,
119- {
116+ sandbox = await sandboxManager . getOrCreateSandbox ( {
117+ runId : agentState . runId ,
118+ generatorCode : template . handleSteps ,
119+ initialInput : {
120120 agentState,
121121 prompt,
122122 params,
123123 logger : streamingLogger ,
124124 } ,
125- undefined , // config
126- streamingLogger , // pass the streaming logger instance for internal use
127- )
125+ config : undefined , // config
126+ logger : streamingLogger , // pass the streaming logger instance for internal use
127+ } )
128128 } else {
129129 // Initialize native generator
130130 generator = template . handleSteps ( {
@@ -362,7 +362,7 @@ export async function runProgrammaticStep(
362362 if ( endTurn ) {
363363 if ( sandbox ) {
364364 // Clean up QuickJS sandbox if execution is complete
365- sandboxManager . removeSandbox ( agentState . runId )
365+ sandboxManager . removeSandbox ( { runId : agentState . runId } )
366366 }
367367 delete runIdToGenerator [ agentState . runId ]
368368 runIdToStepAll . delete ( agentState . runId )
0 commit comments