From d958d9fac616c2328031817543e89fb4e2ece70e Mon Sep 17 00:00:00 2001 From: Dudu-0223 Date: Tue, 14 Jul 2026 21:27:41 +0800 Subject: [PATCH] test(snapshot): fold unknown-tool check into fixture guard --- packages/support/acp-snapshot/src/suite.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/packages/support/acp-snapshot/src/suite.ts b/packages/support/acp-snapshot/src/suite.ts index 752a6e0af9..7e141c32f2 100644 --- a/packages/support/acp-snapshot/src/suite.ts +++ b/packages/support/acp-snapshot/src/suite.ts @@ -600,7 +600,7 @@ export function defineAcpSnapshotSuite(options: SnapshotSuiteOptions): void { } }) - it('every committed JSONL omits system prompts and only pinning fixtures keep other header bulk', async () => { + it('every committed JSONL has valid tool results and canonical header storage', async () => { // System prompts always live in the readable Markdown artifact. Header // pins keep tool schemas/prefixes in JSONL; every other fixture tokenizes // all header bulk. Fixed-point checks make both storage rules fail loud. @@ -612,6 +612,8 @@ export function defineAcpSnapshotSuite(options: SnapshotSuiteOptions): void { ] for (const file of files) { const fixture = await readFile(join(dir, file), 'utf8') + expect(unknownToolCallIds(fixture), `${scenario.name}/${file} contains UNKNOWN_TOOL`) + .toEqual([]) expect(scrubSystemPrompts(fixture), `${scenario.name}/${file} carries an unscrubbed system prompt`) .toEqual(fixture) if (scenario.pinsHeader === true) { @@ -624,20 +626,5 @@ export function defineAcpSnapshotSuite(options: SnapshotSuiteOptions): void { } } }) - - it('no committed session fixture accepts UNKNOWN_TOOL', async () => { - for (const scenario of scenarios) { - const dir = join(snapshotsDir, scenario.name) - const files = [ - 'session.jsonl', - ...Array.from({ length: scenario.childSessions ?? 0 }, (_, i) => `session.${i + 1}.jsonl`), - ] - for (const file of files) { - const fixture = await readFile(join(dir, file), 'utf8') - expect(unknownToolCallIds(fixture), `${scenario.name}/${file} contains UNKNOWN_TOOL`) - .toEqual([]) - } - } - }) }) }