fix(client): address trajectory review feedback

This commit is contained in:
_Kerman
2026-07-28 22:16:45 +08:00
parent 62dd2ab38e
commit f942c30f4b
14 changed files with 116 additions and 18 deletions

View File

@@ -229,10 +229,11 @@ function deriveRequests(events: readonly SessionEvent[]): readonly RequestView[]
continue
}
if (sourceEvent.type === 'request/header') {
const tools: unknown = sourceEvent.data.header.tools
const prompt: ConversationPromptSnapshot = {
config: sourceEvent.data.header.config,
system: sourceEvent.data.header.system ?? '',
tools: sourceEvent.data.header.tools ?? [],
tools: Array.isArray(tools) ? tools as ToolSchema[] : [],
}
const change = promptChange(activePrompt, prompt, sourceEvent)
activePrompt = prompt

View File

@@ -111,14 +111,15 @@ describe('inspectRequests', () => {
it('treats a scrubbed durable-fixture tool catalog as unavailable', () => {
const snapshot = inspectRequests(entriesOf([
at(0, 'request/header', {
at(0, 'step/start', { turn: 1, step: 1 }),
at(1, 'request/header', {
reason: 'initial',
header: {
config: { provider: 'fake', model: 'model' },
tools: '{{tools}}',
},
}),
at(1, 'tool/call', {
at(2, 'tool/call', {
turn: 1,
step: 1,
callId: 'call-1',
@@ -128,5 +129,6 @@ describe('inspectRequests', () => {
]))
expect(snapshot.callSchemas).toEqual(new Map())
expect(snapshot.requests[0]?.prompt?.tools).toEqual([])
})
})