Repository navigation
fix(ai): preserve Gemini tool-call IDs in captures - #5087
Merged
Merged
Conversation
Contributor
Author
|
@greptileai review |
Contributor
|
The PR appears safe to merge. Reviews (1) · Last reviewed commit: "fix(ai): retain Gemini tool call IDs in ..." |
6 tasks done
marandaneto
approved these changes
Sep 24, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
The code looks good; no qualifying findings. Verdict: correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Gemini returns IDs for function calls, but
@posthog/aiomits them from$ai_output_choicesin both non-streaming and streaming generations. The live-provider cassettes in #5037 recordcall_649034andcall_388245; replaying them against the previous formatter reproduced the omission. This is the output-ID half of #5085.Changes
@posthog/aipatch changeset.The replay assertion failed for both tool-call cases before the fix and passes afterward (5/5). The package build, type check, 1,024 unit tests, 275 offline cassette tests, and package lint pass. No provider request or response behavior changes.
The automated draft #5086 also covers this issue. This PR isolates the output-ID change and its cassette proof; the follow-up-input fix is being reviewed separately.
Release info Sub-libraries affected
Libraries affected
Checklist
@posthog/aipatch changeset🤖 Agent context
Autonomy: Human-driven (agent-assisted)
I directed the scope and reviewed the implementation with Codex. We used Vitest, the existing Gemini replay harness, and GitHub CLI. The first signed commit contains the failing test; the second contains the fix. No agent session link is shared because this private work session also includes unrelated workspace context. GitHub would not allow assigning my external account to this PR.