fix: 修复类型问题

This commit is contained in:
claude-code-best
2026-04-10 17:34:01 +08:00
parent e70319e8f5
commit ff03fe7fcb
18 changed files with 70 additions and 56 deletions

View File

@@ -14,6 +14,7 @@ import {
normalizeContentFromAPI,
normalizeMessagesForAPI,
} from '../../../utils/messages.js'
import type { SDKAssistantMessageError } from '../../../entrypoints/agentSdkTypes.js'
import type { SystemPrompt } from '../../../utils/systemPromptType.js'
import type { ThinkingConfig } from '../../../utils/thinking.js'
import type { Options } from '../claude.js'
@@ -186,7 +187,7 @@ export async function* queryModelGemini(
yield createAssistantAPIErrorMessage({
content: `API Error: ${errorMessage}`,
apiError: 'api_error',
error: (error instanceof Error ? error : new Error(String(error))) as Error,
error: (error instanceof Error ? error : new Error(String(error))) as unknown as SDKAssistantMessageError,
})
}
}