Skip to content

fix(sdk): normalize Responses tool call IDs - #4580

Open
zora-zi wants to merge 1 commit into
OpenHands:mainfrom
zora-zi:fix/issue-4578-responses-tool-call-ids
Open

fix(sdk): normalize Responses tool call IDs#4580
zora-zi wants to merge 1 commit into
OpenHands:mainfrom
zora-zi:fix/issue-4578-responses-tool-call-ids

Conversation

@zora-zi

@zora-zi zora-zi commented Aug 22, 2026

Copy link
Copy Markdown

HUMAN:

I reviewed the changes and test results, and confirmed that incompatible tool-call IDs are normalized while function calls remain paired with their outputs.


AGENT:

Why

Fixes #4578. Tool-call IDs from another provider may be incompatible with the
OpenAI Responses API when conversation history is replayed.

Summary

  • Deterministically encode incompatible IDs for Responses.
  • Use the same encoded call_id for each function call and its output.
  • Preserve compatible IDs and keep parallel calls distinct.

Issue Number

#4578

How to Test

The regression test replays parallel colon-delimited IDs through
LLM.format_messages_for_responses and verifies that calls and outputs remain
paired.

  • Targeted tests: 25 passed
  • LLM tests: 984 passed
  • Pre-commit checks: passed

Video/Screenshots

Not applicable.

Design Doc

Not applicable.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

The encoding uses a provider-specific wire-ID policy. A broader cross-provider
identity design is being drafted.

Co-authored-by: openhands <openhands@all-hands.dev>
@zora-zi
zora-zi marked this pull request as ready for review August 22, 2026 11:30

@enyst enyst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @zora-zi , thank you for the PR!

In the issue, a comment says they cannot reproduce with the same LLMs, Kimi and GPT-5.6. How about you, did you reproduce it?

Separately, the PR uses an algo to make it very different than the original string, which I’m not sure it’s necessary and might cause other problems. Could we keep it to just the issue detected : -> _, if we can replicate it?

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.

[Bug]: Switching to GPT-5.6 fails when history contains colon-delimited tool-call IDs

2 participants