From 0214e3fc775459171634c1d076c6e52cfb23e8b2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 13 May 2026 23:16:44 +0000 Subject: [PATCH] fix(context): fix accidental mutation in snapshotGenerator --- packages/core/src/context/utils/snapshotGenerator.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/core/src/context/utils/snapshotGenerator.ts b/packages/core/src/context/utils/snapshotGenerator.ts index e8cb8cf439..b017ed3a0c 100644 --- a/packages/core/src/context/utils/snapshotGenerator.ts +++ b/packages/core/src/context/utils/snapshotGenerator.ts @@ -10,6 +10,9 @@ import { LlmRole } from '../../telemetry/llmRole.js'; import { formatNodesForLlm } from './formatNodesForLlm.js'; import { randomUUID } from 'node:crypto'; import { isRecord } from '../../utils/markdownUtils.js'; +import type { LiveInbox } from '../pipeline/inbox.js'; +import type { ContextEngineState } from '../../services/chatRecordingTypes.js'; +import { debugLogger } from '../../utils/debugLogger.js'; function isStringArray(value: unknown): value is string[] { return ( @@ -80,10 +83,6 @@ export function findLatestSnapshotBaseline( return undefined; } -import type { LiveInbox } from '../pipeline/inbox.js'; -import type { ContextEngineState } from '../../services/chatRecordingTypes.js'; -import { debugLogger } from '../../utils/debugLogger.js'; - export const SnapshotStateHelper = { exportState(nodes: readonly ConcreteNode[]): ContextEngineState { const baseline = findLatestSnapshotBaseline(nodes);