test(snapshot): fold unknown-tool check into fixture guard

This commit is contained in:
Dudu-0223
2026-07-14 21:27:41 +08:00
parent 4afc701e98
commit d958d9fac6

View File

@@ -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([])
}
}
})
})
}