fix(session-recovery): fix SDK fallback part.tool mapping and nosuchtoolarror typo
This commit is contained in:
@@ -89,7 +89,6 @@ export function detectErrorType(error: unknown): RecoveryErrorType {
|
||||
message.includes("dummy_tool") ||
|
||||
message.includes("unavailable tool") ||
|
||||
message.includes("model tried to call unavailable") ||
|
||||
message.includes("nosuchtoolarror") ||
|
||||
message.includes("nosuchtoolerror") ||
|
||||
message.includes("no such tool")
|
||||
) {
|
||||
|
||||
@@ -51,7 +51,7 @@ async function readPartsFromSDKFallback(
|
||||
return target.parts.map((part) => ({
|
||||
type: part.type === "tool" ? "tool_use" : part.type,
|
||||
id: "callID" in part ? (part as { callID?: string }).callID : part.id,
|
||||
name: "name" in part && typeof part.name === "string" ? part.name : undefined,
|
||||
name: "name" in part && typeof part.name === "string" ? part.name : ("tool" in part && typeof (part as { tool?: unknown }).tool === "string" ? (part as { tool: string }).tool : undefined),
|
||||
}))
|
||||
} catch {
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user