← Back to PRs

#15767: Fix: Gemini REQUIRED_FIELD_MISSING on corrupted toolResults

by janhcla open 2026-02-13 21:23 View on GitHub →
stale size: S
... <!-- 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