From 84423e6ea1f5a5a2ac4e960c223530bcafcd0901 Mon Sep 17 00:00:00 2001 From: Adam Weidman <65992621+adamfweidman@users.noreply.github.com> Date: Mon, 18 May 2026 11:16:49 -0400 Subject: [PATCH] fix(core): enforce compile-time exhaustiveness in content-utils (#27207) --- packages/core/src/agent/content-utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/agent/content-utils.ts b/packages/core/src/agent/content-utils.ts index 42b0b7fec7..667714d778 100644 --- a/packages/core/src/agent/content-utils.ts +++ b/packages/core/src/agent/content-utils.ts @@ -93,13 +93,16 @@ export function contentPartsToGeminiParts(content: ContentPart[]): Part[] { // References are converted to text for the model result.push({ text: part.text }); break; - default: + default: { + const _exhaustiveCheck: never = part; + void _exhaustiveCheck; debugLogger.warn( `Unhandled ContentPart type: ${JSON.stringify(part)} fallback to serialization`, ); // Serialize unknown ContentPart variants instead of dropping them result.push({ text: JSON.stringify(part) }); break; + } } } return result;