Skip to content

Normalize long tool call IDs in agent requests#9396

Open
qaijuang wants to merge 1 commit intowarpdotdev:masterfrom
qaijuang:tool-call-id-normalization
Open

Normalize long tool call IDs in agent requests#9396
qaijuang wants to merge 1 commit intowarpdotdev:masterfrom
qaijuang:tool-call-id-normalization

Conversation

@qaijuang
Copy link
Copy Markdown

Description

What: Normalize over-limit tool call IDs on outbound multi-agent requests.

Why: GLM-5 and Kimi can emit tool call IDs longer than the OpenAI Responses API allows, which causes 400s and unrecoverable agent sessions.

How: Build the request first, then hash over-limit tool call IDs down to a stable tc_... form across task history tool calls, tool call results, action results, and running-command references. Add focused request-builder regression tests for over-limit, at-limit, and stability behavior.

Fixes #8997

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @xosnrdev on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@qaijuang qaijuang force-pushed the tool-call-id-normalization branch from c1dd1d3 to 170f59f Compare April 29, 2026 11:40
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @qaijuang on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@qaijuang
Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @qaijuang on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

The cla-bot has been summoned, and re-checked this pull request!

@qaijuang qaijuang force-pushed the tool-call-id-normalization branch from 170f59f to ebfadec Compare April 29, 2026 11:50
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @qaijuang on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@qaijuang
Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

The cla-bot has been summoned, and re-checked this pull request!

@qaijuang qaijuang marked this pull request as ready for review April 29, 2026 11:54
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@qaijuang

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I approved this pull request. No matching stakeholder was found for the changed files, so no human reviewers were requested.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR extracts request construction, then normalizes over-limit external tool call IDs in the fully assembled outbound multi-agent request. The normalization is stable, bounded to the downstream limit, and covers task-history tool calls/results plus current user-input tool result and running-command references.

Concerns

  • No blocking correctness or security concerns found in the inlined diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool call IDs from GLM-5/Kimi models exceed OpenAI's 64-character limit

1 participant