diff --git a/apps/web/tests/navigation-panes.e2e.ts b/apps/web/tests/navigation-panes.e2e.ts index e216393423..5e00ec337c 100644 --- a/apps/web/tests/navigation-panes.e2e.ts +++ b/apps/web/tests/navigation-panes.e2e.ts @@ -28,7 +28,7 @@ const SEARCH_EXPECTED = join(SNAPSHOT_DIR, 'search-results.expected.md') const TERMINAL_EXPECTED = join(SNAPSHOT_DIR, 'terminal-card.expected.md') const MODE = webSnapshotMode() const SEED_ID = 'navigation-panes-web-e2e' -const EXPORTED_LOG_FILE = `session.v${String(SESSION_FORMAT_VERSION)}.jsonl` +const EXPORTED_LOG_FILE = 'session.jsonl' // Turn 1 leads with a distinctive word: the session-title fallback takes the // first words of the first message, so the sidebar-search scenario has a diff --git a/apps/web/tests/question-composer.e2e.ts b/apps/web/tests/question-composer.e2e.ts index 29fbf1e146..27b28dce1f 100644 --- a/apps/web/tests/question-composer.e2e.ts +++ b/apps/web/tests/question-composer.e2e.ts @@ -107,7 +107,6 @@ function cancelledFixture(fixture: string): string { message.content[0].isError = true data.error = { name: 'UserQuestionError', - message: 'the user cancelled ask_user_question', code: 'ASK_CANCELLED', } replaced = true diff --git a/apps/web/tests/scaffold.ts b/apps/web/tests/scaffold.ts index 3684817c07..0e6863f5d1 100644 --- a/apps/web/tests/scaffold.ts +++ b/apps/web/tests/scaffold.ts @@ -62,7 +62,7 @@ import type { LlmModelInfo, LlmProviderInfo, LlmResolvedModelInfo, RetryPolicyConfig, StreamChunk, } from '@deepseek-ai/dsh-llm' import type { ReplayHandle } from '@deepseek-ai/dsh-llm-replay' -import { installLlmReplay, parseSessionLog } from '@deepseek-ai/dsh-llm-replay' +import { installLlmReplay, parseSessionLog, parseSessionLogForReplay } from '@deepseek-ai/dsh-llm-replay' import { packChunkRuns, SESSION_FORMAT_VERSION, @@ -671,7 +671,7 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise ( event.type === 'assistant/chunk' || event.type === 'request/header' || event.type === 'tool/call' )) @@ -994,9 +994,10 @@ export function realizeSeedFixture(scaffold: WebScaffold, fixtureText: string, i /** * Parse a committed web seed fixture through the replay reader. * @param fixtureText - session JSONL fixture contents. + * @param fixturePath - exact source path for the closed replay-only alpha-refusal policy. * @returns the original header line, parsed header, and logical events. */ -export function parseSeedFixture(fixtureText: string): { +export function parseSeedFixture(fixtureText: string, fixturePath?: string): { headerLine: string header: Record events: SessionEvent[] @@ -1005,7 +1006,10 @@ export function parseSeedFixture(fixtureText: string): { if (headerLine === undefined) throw new Error('seed fixture has no session header') const header = JSON.parse(headerLine) as Record if (header.type !== 'session') throw new Error('seed fixture must start with a session header') - return { headerLine, header, events: parseSessionLog(fixtureText) } + const events = fixturePath === undefined + ? parseSessionLog(fixtureText) + : parseSessionLogForReplay(fixtureText, fixturePath) + return { headerLine, header, events } } /** @@ -1030,8 +1034,9 @@ export async function seedSession( fixtureText: string, id: string, agentPreset?: string, + fixturePath?: string, ): Promise { - const decoded = parseSeedFixture(realizeSeedFixture(scaffold, fixtureText, id)) + const decoded = parseSeedFixture(realizeSeedFixture(scaffold, fixtureText, id), fixturePath) const events = decoded.events if (events.length === 0) throw new Error('seed fixture has no events') const last = events[events.length - 1]! diff --git a/apps/web/tests/schedule-after.e2e.ts b/apps/web/tests/schedule-after.e2e.ts index 2560b7a886..e27f9becf7 100644 --- a/apps/web/tests/schedule-after.e2e.ts +++ b/apps/web/tests/schedule-after.e2e.ts @@ -610,7 +610,7 @@ describe.skipIf(MODE === 'record')('web e2e: active Schedule catalog', () => { replayFixture: CATALOG_FIXTURE, replayProvidersOnly: true, }) - await seedSession(scaffold, fixture, CATALOG_SESSION_ID, 'standard') + await seedSession(scaffold, fixture, CATALOG_SESSION_ID, 'standard', CATALOG_FIXTURE) const workspace = await scaffold.ctx.workspaceRegistry.create(scaffold.workspaceCwd) await workspace.attachSession(CATALOG_SESSION_ID) diff --git a/packages/session/session-persistence-jsonl/tests/jsonl.spec.ts b/packages/session/session-persistence-jsonl/tests/jsonl.spec.ts index fa5fc2929d..bde9760eaa 100644 --- a/packages/session/session-persistence-jsonl/tests/jsonl.spec.ts +++ b/packages/session/session-persistence-jsonl/tests/jsonl.spec.ts @@ -640,7 +640,7 @@ describe('JsonlSessionPersistence: immutable format generations', () => { const highest = generationLogPath(root, header.cwd, header.id, 4, 'zstd') await writeFile(highest, 'newer') - await expect(ctx.sessionPersistence.list()).rejects.toThrow(highest) + await expect(ctx.sessionPersistence.list()).rejects.toThrow(JSON.stringify(highest)) }) it('surfaces a file occupying the targeted Session-directory path', async () => {