fix(snapshot): register filesystem tools through explicit overlay
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
normalizedSystemPrompts,
|
||||
refreshFixtureReplacements,
|
||||
stabilizeRefreshLog,
|
||||
unknownToolCallIds,
|
||||
} from '../src/suite.ts'
|
||||
|
||||
/**
|
||||
@@ -278,6 +279,27 @@ describe('headerDeltaCount', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('unknownToolCallIds', () => {
|
||||
it('returns structured UNKNOWN_TOOL call ids and ignores other results', () => {
|
||||
const log = [
|
||||
'{"type":"tool/result","data":{"callId":"missing","error":{"code":"UNKNOWN_TOOL"}}}',
|
||||
'{"type":"tool/result","data":{"callId":"failed","error":{"code":"EXECUTION_FAILED"}}}',
|
||||
'{"type":"tool/result","data":null}',
|
||||
'{"type":"tool/result","data":"invalid"}',
|
||||
'{"type":"tool/result","data":{"error":null}}',
|
||||
'{"type":"tool/result","data":{"error":"invalid"}}',
|
||||
'{"type":"assistant/message","data":{"error":{"code":"UNKNOWN_TOOL"}}}',
|
||||
'{"type":"tool/result","data":{"error":{"code":"UNKNOWN_TOOL"}}}',
|
||||
'',
|
||||
].join('\n')
|
||||
expect(unknownToolCallIds(log)).toEqual(['missing', '<missing callId>'])
|
||||
})
|
||||
|
||||
it('returns no failures for ordinary tool results', () => {
|
||||
expect(unknownToolCallIds('{"type":"tool/result","data":{"callId":"ok"}}\n')).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe('refreshFixtureReplacements', () => {
|
||||
it('maps fresh ids and cwd values to the existing fixture values, skipping non-replacements', () => {
|
||||
const log = (content: string): HarvestedLog => ({ id: 'diagnostic', createdAt: 1, content })
|
||||
|
||||
Reference in New Issue
Block a user