Skip to content

fix: preserve message-level thought signatures through inference proxy#5400

Draft
shawnfeldman wants to merge 3 commits intomainfrom
claude/slack-session-zkwP3
Draft

fix: preserve message-level thought signatures through inference proxy#5400
shawnfeldman wants to merge 3 commits intomainfrom
claude/slack-session-zkwP3

Conversation

@shawnfeldman
Copy link
Copy Markdown

@shawnfeldman shawnfeldman commented Apr 9, 2026

Summary

Message-level thought signatures dropped in inference proxy path

ChoiceDelta.extra (containing Gemini thought signatures) is parsed from streaming responses but never transferred to ChatMessage.extra when the assistant message is created. This causes Gemini Flash 3 thought signatures to be lost on round-trips through the inference proxy, leading to INVALID_ARGUMENT errors or degraded results on subsequent turns. Tool-call-level signatures work correctly; only pure text turns are affected.

Changes

  1. generation.py: Added extra field to _LLMGenerationData and collect chunk.delta.extra during streaming
  2. agent_activity.py: Pass the collected extra dict when creating the assistant ChatMessage

Test plan

  • Verify Gemini Flash 3 text-only turns work correctly through the inference proxy without INVALID_ARGUMENT errors
  • Verify tool-call turns continue to work (no regression)
  • Verify non-Gemini models are unaffected (extra dict is empty when no provider-specific data is sent)

Slack thread: https://live-kit.slack.com/archives/C0AG4ANRJ6M/p1775752933657069

https://claude.ai/code/session_01FShocegnZrFbYzv6hxx328

…y path

ChoiceDelta.extra (containing thought signatures) was parsed from streaming
responses but never transferred to ChatMessage.extra when the assistant
message was created. This caused Gemini Flash 3 thought signatures to be
lost on round-trips through the inference proxy, leading to INVALID_ARGUMENT
errors or degraded results on subsequent turns.

https://claude.ai/code/session_01FShocegnZrFbYzv6hxx328
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@chenghao-mou chenghao-mou requested a review from a team April 9, 2026 16:50
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

claude added 2 commits April 9, 2026 17:05
Verify that ChoiceDelta.extra (containing provider-specific metadata like
Gemini thought signatures) is correctly propagated to ChatMessage.extra
when creating assistant messages.

https://claude.ai/code/session_01FShocegnZrFbYzv6hxx328
@shawnfeldman shawnfeldman marked this pull request as draft April 9, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants