fix: complete immutable message migration

This commit is contained in:
_Kerman
2026-07-28 14:15:23 +08:00
parent f5ec71f5b1
commit 350c296cff
27 changed files with 231 additions and 60 deletions

View File

@@ -439,9 +439,12 @@ export function unknownToolCallIds(rawLog: string): string[] {
if (record.type !== 'tool/result') return []
const data = record.data
if (data === null || typeof data !== 'object') return []
const { source, error } = data as { source?: 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