Skip to content

fix(llm): preserve compatible tool signatures - #48985

Open
tiaoc wants to merge 2 commits into
anomalyco:devfrom
tiaoc:preserve-tool-signatures
Open

tiaoc wants to merge 2 commits into
anomalyco:devfrom
tiaoc:preserve-tool-signatures

Conversation

@tiaoc

@tiaoc tiaoc commented Sep 14, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #8321

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenAI-compatible providers may attach provider-owned continuation data to streamed tool calls through tool_calls[].extra_content.google.thought_signature. The OpenAI Chat parser previously discarded this field, so canonical tool-call history lost the signature and follow-up requests omitted it.

This change:

  • parses extra_content.google.thought_signature from streamed OpenAI Chat tool-call deltas,
  • stores it as canonical tool-call provider metadata,
  • replays it on subsequent assistant tool calls as extra_content.google.thought_signature.

This keeps the provider extension intact across tool-call continuation for providers that require it with the function call.

How did you verify your code works?

  • Updated the OpenAI Chat stream test to include extra_content.google.thought_signature and verify that it survives tool-call assembly.
  • Added a request-lowering test that verifies historical tool calls replay the signature.

Screenshots / recordings

Not applicable; this is a protocol-level change with no UI.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Support for thought_signature in openai-compatible provider

1 participant