Skip to content

Detect Gemini functionCall and Claude tool_use, backfill tool_call IDs, and broaden tool-sieve detection#180

Merged
CJackHwang merged 2 commits intodevfrom
codex/integrate-gemini-claude-openai-into-ds2api
Mar 31, 2026
Merged

Detect Gemini functionCall and Claude tool_use, backfill tool_call IDs, and broaden tool-sieve detection#180
CJackHwang merged 2 commits intodevfrom
codex/integrate-gemini-claude-openai-into-ds2api

Conversation

@CJackHwang
Copy link
Copy Markdown
Owner

Motivation

  • Improve detection and parsing of additional tool-call syntaxes emitted by different models (Gemini functionCall, Claude tool_use, and variants).
  • Ensure tool-result messages can be associated with their originating tool call by backfilling or generating stable tool_call_id values.
  • Make the streaming tool-sieve more robust to different keyword spellings and payload shapes so tool calls are not missed.

Description

  • Add a lightweight tool-call state in internal/adapter/claude with tool_call_state.go and helper utilities in handler_helpers_misc.go to generate and track call_claude_* IDs and safely extract string values.
  • Update internal/adapter/claude/handler_utils.go to thread the state through normalizeClaude* functions so assistant tool_use blocks get assigned IDs and subsequent tool_result blocks can reuse inferred IDs or names.
  • Extend Gemini conversion in internal/adapter/gemini/convert_messages.go to generate call_gemini_* IDs and backfill function response callId from the last call seen by name.
  • Broaden tool-call detection keywords in the streaming tool-sieve and parsing layers by adding `

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ds2api Ready Ready Preview, Comment Mar 31, 2026 5:51pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfca84c2c7

ℹ️ 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".

@CJackHwang CJackHwang merged commit 3900aae into dev Mar 31, 2026
3 checks passed
@CJackHwang CJackHwang deleted the codex/integrate-gemini-claude-openai-into-ds2api branch March 31, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant