From ea096a855b77c83ebb95ee075dff6e89d8f62b7e Mon Sep 17 00:00:00 2001 From: Cosmo Date: Fri, 1 May 2026 11:37:21 +0000 Subject: [PATCH] fix: cast role to string for system check (TS type guard) --- app/api/voice/chat/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/voice/chat/route.ts b/app/api/voice/chat/route.ts index 0c36aae..35942d1 100644 --- a/app/api/voice/chat/route.ts +++ b/app/api/voice/chat/route.ts @@ -55,7 +55,7 @@ function toAnthropicTools(tools: any[]): any[] { function historyToAnthropicMessages(history: HistoryMessage[]): any[] { const result: any[] = [] for (const msg of history) { - if (msg.role === 'system') continue // skip, goes in system field + if ((msg.role as string) === 'system') continue // skip, goes in system field if (msg.role === 'user') { result.push({ role: 'user', content: msg.content || '' }) } else if (msg.role === 'assistant') {