Skip to content

Fix/minimax-tool-call-id-string: Coerce all tool call IDs to strings regardless of the model/provider#5816

Merged
kevinvandijk merged 5 commits intoKilo-Org:mainfrom
evanjacobson:fix/minimax-tool-call-id-string
Feb 13, 2026
Merged

Fix/minimax-tool-call-id-string: Coerce all tool call IDs to strings regardless of the model/provider#5816
kevinvandijk merged 5 commits intoKilo-Org:mainfrom
evanjacobson:fix/minimax-tool-call-id-string

Conversation

@evanjacobson
Copy link
Contributor

Context

I discovered this error when asking Kilo CLI to summarize a different PR's changes (screenshot attached). Interestingly, when I asked it to retry, the issue did not occur again.

Some providers (e.g. MiniMax via Kilo's OpenRouter provider) return tool call id as a number instead of a string, violating the OpenAI-compatible spec. This causes downstream failures when the ID is expected to be a string.

Implementation

Rather than patching individual provider handlers (whack-a-mole), the fix coerces id to a string in NativeToolCallParser.processRawChunk() -- the shared entry point that all providers flow through. This ensures any provider returning a non-string ID is normalized before the value propagates further.

  • Destructure id as rawId and apply String() coercion when non-null
  • Added tests covering numeric coercion, string pass-through, and undefined handling

Screenshots

example of the error

How to Test

  • Use a the default/free MiniMax model via Kilo Gateway (or any provider that returns numeric tool call IDs)
  • Trigger a tool-use conversation (e.g. ask the model to read a file)
  • Confirm the tool call completes without an Expected id to be a string error

Or run the unit tests:

npm test -- NativeToolCallParser

Get in Touch

@ evan.discorb

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 0fc6ecc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Collaborator

@kevinvandijk kevinvandijk left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

2 participants