diff --git a/extensions/acpx/src/runtime.ts b/extensions/acpx/src/runtime.ts index 9502203298d..8077c453080 100644 --- a/extensions/acpx/src/runtime.ts +++ b/extensions/acpx/src/runtime.ts @@ -12,11 +12,18 @@ import { type AcpRuntimeHandle, type AcpRuntimeOptions, type AcpRuntimeStatus, - type AcpSessionRecord, - type AcpSessionStore, } from "acpx/runtime"; import type { AcpRuntime } from "../runtime-api.js"; +type AcpSessionRecord = Record & { + name?: string; +}; + +type AcpSessionStore = { + load(sessionId: string): Promise; + save(record: AcpSessionRecord): Promise; +}; + type ResetAwareSessionStore = AcpSessionStore & { markFresh: (sessionKey: string) => void; }; @@ -34,7 +41,7 @@ function createResetAwareSessionStore(baseStore: AcpSessionStore): ResetAwareSes }, async save(record: AcpSessionRecord): Promise { await baseStore.save(record); - const sessionName = record.name.trim(); + const sessionName = typeof record.name === "string" ? record.name.trim() : ""; if (sessionName) { freshSessionKeys.delete(sessionName); }