diff --git a/src/agents/pi-embedded-runner/compact.runtime.ts b/src/agents/pi-embedded-runner/compact.runtime.ts new file mode 100644 index 00000000000..33c4ed7066a --- /dev/null +++ b/src/agents/pi-embedded-runner/compact.runtime.ts @@ -0,0 +1 @@ +export { compactEmbeddedPiSessionDirect } from "./compact.js"; diff --git a/src/context-engine/legacy.ts b/src/context-engine/legacy.ts index ba05c9e8b8d..ab2eeff9b7f 100644 --- a/src/context-engine/legacy.ts +++ b/src/context-engine/legacy.ts @@ -69,9 +69,9 @@ export class LegacyContextEngine implements ContextEngine { customInstructions?: string; legacyParams?: Record; }): Promise { - // Import dynamically to avoid circular dependencies + // Import through a dedicated runtime boundary so the lazy edge remains effective. const { compactEmbeddedPiSessionDirect } = - await import("../agents/pi-embedded-runner/compact.js"); + await import("../agents/pi-embedded-runner/compact.runtime.js"); // legacyParams carries the full CompactEmbeddedPiSessionParams fields // set by the caller in run.ts. We spread them and override the fields