#15767: Fix: Gemini REQUIRED_FIELD_MISSING on corrupted toolResults
stale
size: S
Cluster:
Error Handling in Agent Tools
...
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds a new Vitest repro test that constructs a conversation with a `toolResult` missing `toolName` and asserts that `convertMessages()` produces a `functionResponse` with `name: undefined`, matching the Gemini `REQUIRED_FIELD_MISSING` failure mode.
The test follows the existing pattern of `google-shared.*.test.ts` regression checks intended to lock down message/tool conversion behavior for Google/Gemini providers, but it currently imports conversion logic from `@mariozechner/pi-ai/dist/...` rather than from repo-local code.
<h3>Confidence Score: 2/5</h3>
- Not safe to merge as-is; the added test is likely to fail in CI due to an unresolvable module import in a clean checkout.
- Confidence is reduced because the new test imports `@mariozechner/pi-ai/dist/providers/google-shared.js`, which cannot be resolved without installing deps and relies on a dependency’s internal `dist/` layout. In environments where dependencies aren’t present (or the dependency’s packaging changes), this will fail at import time and break the test suite. The remainder of the change is isolated to a new test file.
- src/providers/google-shared.repro-missing-name.test.ts
<sub>Last reviewed commit: 29fe2f0</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#12877: fix: backfill empty toolName on toolResult messages for Gemini comp...
by aldoeliacim · 2026-02-09
79.3%
#4445: fix: resolve Antigravity "unsupported version" and tool_use schema ...
by harry2690 · 2026-01-30
77.5%
#15143: fix(transcript-repair): validate tool call id and name to prevent G...
by GreyC · 2026-02-13
77.3%
#10372: Fix google-gemini-cli-auth to work on Windows
by omribahumi · 2026-02-06
75.7%
#22214: fix(tools): sanitize google-antigravity schemas for Gemini-compatib...
by Kansodata · 2026-02-20
75.6%
#15301: Feat/gemini overflow and tags
by divisonofficer · 2026-02-13
75.3%
#12487: fix(agents): strip orphaned tool_result when tool_use is sanitized ...
by skylarkoo7 · 2026-02-09
74.6%
#21835: fix: apply schema cleaning for google-antigravity in normalizeToolP...
by ephraimm · 2026-02-20
74.5%
#22321: fix: sanitize tool schemas for all Cloud Code Assist providers
by Sr-0w · 2026-02-21
74.4%
#17841: fix(google): include 'google' provider in tool schema sanitization
by zerone0x · 2026-02-16
74.2%