Merge branch 'master' into worktree/dedupe-snapshot-contracts

This commit is contained in:
Tianyi Cui
2026-07-28 21:08:38 +08:00
committed by GitHub
588 changed files with 12212 additions and 3944 deletions

View File

@@ -519,9 +519,15 @@ export function unknownToolCallIds(rawLog: string): string[] {
if (record.type !== 'tool/result') return []
const data = record.data
if (data === null || typeof data !== 'object') return []
const { callId, error } = data as { callId?: unknown; error?: unknown }
const { message, error } = data as { message?: unknown; error?: unknown }
if (error === null || typeof error !== 'object') return []
if ((error as { code?: unknown }).code !== 'UNKNOWN_TOOL') return []
const source = typeof message === 'object' && message !== null
? (message as { source?: unknown }).source
: undefined
const callId = typeof source === 'object' && source !== null
? (source as { callId?: unknown }).callId
: undefined
return [typeof callId === 'string' ? callId : '<missing callId>']
})
}