mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-14 20:10:36 -07:00
fix(core): enforce compile-time exhaustiveness in content-utils (#27207)
This commit is contained in:
@@ -93,13 +93,16 @@ export function contentPartsToGeminiParts(content: ContentPart[]): Part[] {
|
|||||||
// References are converted to text for the model
|
// References are converted to text for the model
|
||||||
result.push({ text: part.text });
|
result.push({ text: part.text });
|
||||||
break;
|
break;
|
||||||
default:
|
default: {
|
||||||
|
const _exhaustiveCheck: never = part;
|
||||||
|
void _exhaustiveCheck;
|
||||||
debugLogger.warn(
|
debugLogger.warn(
|
||||||
`Unhandled ContentPart type: ${JSON.stringify(part)} fallback to serialization`,
|
`Unhandled ContentPart type: ${JSON.stringify(part)} fallback to serialization`,
|
||||||
);
|
);
|
||||||
// Serialize unknown ContentPart variants instead of dropping them
|
// Serialize unknown ContentPart variants instead of dropping them
|
||||||
result.push({ text: JSON.stringify(part) });
|
result.push({ text: JSON.stringify(part) });
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user