Skip to content

fix(bot): replay Gemini tool-call thought signatures - #5880

Draft
ehz0ah wants to merge 1 commit into
volcengine:mainfrom
ehz0ah:fix/gemini-thought-signature-replay
Draft

ehz0ah wants to merge 1 commit into
volcengine:mainfrom
ehz0ah:fix/gemini-thought-signature-replay

Conversation

@ehz0ah

@ehz0ah ehz0ah commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve provider-owned Gemini tool-call state through the VLM and VikingBot response models
  • replay that state in main-agent and subagent assistant history
  • cover LiteLLM native fields, Google OpenAI-compatible extra_content, top-level gateway signatures, and streamed tool calls

Why

Gemini thinking models require each tool-call thought signature to be echoed in later requests. OpenViking reduced tool calls to id, name, and arguments, so the signature was lost before the tool result was sent back.

This matches the repeated HTTP 400 reported in DeerFlow issue bytedance/deer-flow#1180 and the source-backed fix in bytedance/deer-flow#6631. OpenViking has its own verified carrier gap, so this change is an original implementation for OpenViking rather than copied external code.

A pinned before-fix probe measured 0/1 signature survival and 0/1 next-request acceptance. The post-fix probe preserves all three supported carriers and passes both the LiteLLM native transform and an OpenAI SDK mock HTTP boundary.

Testing

  • 35 passed across focused tool-call, Gemini, streaming, and VLM adapter suites
  • Ruff lint and formatting checks passed for the changed surfaces
  • post-fix probe: 13/13 assertions, 3/3 signature carriers preserved, 2/2 replay boundaries accepted

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant