Skip to content

🪑 fix: Keep Gemini Function Calls in Place During Fallback Replay - #735

Merged
danny-avila merged 1 commit into
mainfrom
lia/gemini-inline-function-call-order
Nov 23, 2026
Merged

danny-avila merged 1 commit into
mainfrom
lia/gemini-inline-function-call-order

Conversation

@lia-by-librechat

Copy link
Copy Markdown
Contributor

Fixes #725. Supersedes #726. Thanks to @roman-redl for the live reproducer and the in-place replay approach.

Gemini grounding can wrap client function calls between a native toolCall and toolResponse. Fallback replay used to append those calls after the native response. Keep them in their original slots using the parsed calls and stored signatures. Reserve explicit IDs first, then fill ID-less slots by name in parsed order. Drop unmatched native mirrors and append unused parsed calls. Leave exact replay and cross-provider tool_use deduplication unchanged.

Regression coverage includes complete and split responses, repeated and mixed IDs, unmatched mirrors, unused calls, signatures, and cross-provider history.

Reserve native slots by ID before filling name-only slots. Preserve exact replay and cross-provider deduplication.

Thanks to roman-redl for identifying #725 and proposing in-place replay in #726.
@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Review head: 207007d1e8e2b2af13c2e67616c62a79a2d0fbe6. Restores Gemini client call positions during fallback replay, prioritizes explicit IDs over ID-less matches, and preserves signature policy and foreign tool replay. Includes focused regression coverage for #725.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T14:27:58.351699Z 207007d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 207007d1e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lia-by-librechat lia-by-librechat Bot changed the title 🪡 fix: Preserve Gemini Function Call Order During Fallback Replay 🪑 fix: Keep Gemini Function Calls in Place During Fallback Replay Nov 23, 2026
@danny-avila
danny-avila merged commit 1e1ba8f into main Nov 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants