@@ -12,11 +12,8 @@ import {
1212 normalizeVerboseLevel ,
1313 registerAgentRunContext ,
1414 resolveBootstrapWarningSignaturesSeen ,
15- resolveFastModeState ,
16- resolveNestedAgentLane ,
1715 resolveSessionTranscriptPath ,
1816 runCliAgent ,
19- runEmbeddedPiAgent ,
2017 runWithModelFallback ,
2118} from "./run-execution.runtime.js" ;
2219import { resolveCronFallbacksOverride } from "./run-fallback-policy.js" ;
@@ -30,10 +27,17 @@ import { isLikelyInterimCronMessage } from "./subagent-followup-hints.js";
3027
3128type AgentTurnPayload = Extract < CronJob [ "payload" ] , { kind : "agentTurn" } > | null ;
3229type CronPromptRunResult = Awaited < ReturnType < typeof runCliAgent > > ;
30+ type CronEmbeddedRuntime = typeof import ( "./run-embedded.runtime.js" ) ;
3331type CronSubagentRegistryRuntime = typeof import ( "./run-subagent-registry.runtime.js" ) ;
3432
33+ let cronEmbeddedRuntimePromise : Promise < CronEmbeddedRuntime > | undefined ;
3534let cronSubagentRegistryRuntimePromise : Promise < CronSubagentRegistryRuntime > | undefined ;
3635
36+ async function loadCronEmbeddedRuntime ( ) {
37+ cronEmbeddedRuntimePromise ??= import ( "./run-embedded.runtime.js" ) ;
38+ return await cronEmbeddedRuntimePromise ;
39+ }
40+
3741async function loadCronSubagentRegistryRuntime ( ) {
3842 cronSubagentRegistryRuntimePromise ??= import ( "./run-subagent-registry.runtime.js" ) ;
3943 return await cronSubagentRegistryRuntimePromise ;
@@ -135,6 +139,8 @@ export function createCronPromptExecutor(params: {
135139 ) ;
136140 return result ;
137141 }
142+ const { resolveFastModeState, resolveNestedAgentLane, runEmbeddedPiAgent } =
143+ await loadCronEmbeddedRuntime ( ) ;
138144 const result = await runEmbeddedPiAgent ( {
139145 sessionId : params . cronSession . sessionEntry . sessionId ,
140146 sessionKey : params . agentSessionKey ,
0 commit comments