From 87fa88ac3d3594fab71994598f534018912ec3d8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 12 Apr 2026 18:56:22 +0100 Subject: [PATCH] fix: use literal runtime import for compaction --- src/context-engine/delegate.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/context-engine/delegate.ts b/src/context-engine/delegate.ts index 66ea59a532e..379ec7d3d21 100644 --- a/src/context-engine/delegate.ts +++ b/src/context-engine/delegate.ts @@ -2,22 +2,18 @@ import type { CompactEmbeddedPiSessionDirect } from "../agents/pi-embedded-runne import { normalizeStructuredPromptSection } from "../agents/prompt-cache-stability.js"; import type { MemoryCitationsMode } from "../config/types.memory.js"; import { buildMemoryPromptSection } from "../plugins/memory-state.js"; -import { importRuntimeModule } from "../shared/runtime-import.js"; import type { ContextEngine, CompactResult, ContextEngineRuntimeContext } from "./types.js"; type CompactRuntimeModule = { compactEmbeddedPiSessionDirect: CompactEmbeddedPiSessionDirect; }; -const COMPACT_RUNTIME_SPEC = ["../agents/pi-embedded-runner/compact.runtime", ".js"] as const; - let compactRuntimePromise: Promise | null = null; function loadCompactRuntime(): Promise { - compactRuntimePromise ??= importRuntimeModule( - import.meta.url, - COMPACT_RUNTIME_SPEC, - ); + // Use a literal specifier so the bundler rewrites the runtime chunk path + // instead of resolving a source-tree path at runtime. + compactRuntimePromise ??= import("../agents/pi-embedded-runner/compact.runtime.js"); return compactRuntimePromise; }