feat(client): add trajectory timing overview

This commit is contained in:
_Kerman
2026-07-28 16:28:57 +08:00
parent 40c29495af
commit 1d4a6149cc
39 changed files with 716 additions and 592 deletions

View File

@@ -150,8 +150,11 @@ function deriveCallSchemas(
}
for (const event of events) {
if (event.type === 'request/header') {
const tools: unknown = event.data.header.tools
active = new Map(
(event.data.header.tools ?? []).map(schema => [schema.name, schema]),
Array.isArray(tools)
? (tools as ToolSchema[]).map(schema => [schema.name, schema])
: [],
)
continue
}

View File

@@ -105,4 +105,25 @@ describe('inspectRequests', () => {
expect(snapshot.callSchemas.get('nested')?.name).toBe('read')
})
it('treats a scrubbed durable-fixture tool catalog as unavailable', () => {
const snapshot = inspectRequests(entriesOf([
at(0, 'request/header', {
reason: 'initial',
header: {
config: { provider: 'fake', model: 'model' },
tools: '{{tools}}',
},
}),
at(1, 'tool/call', {
turn: 1,
step: 1,
callId: 'call-1',
name: 'read',
arguments: '{}',
}),
]))
expect(snapshot.callSchemas).toEqual(new Map())
})
})