bug(core): Fix spewie getter in hookTranslator.ts (#16108)

This commit is contained in:
joshualitt
2026-01-08 10:12:11 -08:00
committed by GitHub
parent 97ad3d97cb
commit 660368f249

View File

@@ -12,6 +12,7 @@ import type {
FunctionCallingConfig,
} from '@google/genai';
import { DEFAULT_GEMINI_FLASH_MODEL } from '../config/models.js';
import { getResponseText } from '../utils/partUtils.js';
/**
* Decoupled LLM request format - stable across Gemini CLI versions
@@ -267,7 +268,7 @@ export class HookTranslatorGenAIv1 extends HookTranslator {
*/
toHookLLMResponse(sdkResponse: GenerateContentResponse): LLMResponse {
return {
text: sdkResponse.text,
text: getResponseText(sdkResponse) ?? undefined,
candidates: (sdkResponse.candidates || []).map((candidate) => {
// Extract text parts from the candidate
const textParts =