Skip to content

Rename experimental tool_calls fields to camelCase - #42

Merged
SamSamskies merged 3 commits into
mainfrom
rename-tool-calls-camelcase
Aug 14, 2026
Merged

Rename experimental tool_calls fields to camelCase#42
SamSamskies merged 3 commits into
mainfrom
rename-tool-calls-camelcase

Conversation

@SamSamskies

Copy link
Copy Markdown
Owner

Summary

  • Rename page-facing experimental tool_calls / tool_call_id to toolCalls / toolCallId so they match toolChoice and the rest of the IPA surface.
  • Keep provider request/response wire formats snake_case.
  • Reject leftover OpenAI-style snake_case aliases on both the experimental and stable paths so tool history is not silently stripped during normalization.

Test plan

  • npm test — especially test/validate.test.js and provider tool round-trip tests
  • Paste the README experimental.request snippet in DevTools and confirm done.message.toolCalls / toolCallId work
  • Confirm tool_calls / tool_call_id on window.inference.request and experimental.request fail with invalid_request and a rename hint

Made with Cursor

SamSamskies and others added 3 commits August 14, 2026 08:41
Match toolChoice and the rest of the IPA surface with toolCalls / toolCallId before the first release; keep provider wire formats snake_case.

Co-authored-by: Cursor <cursoragent@cursor.com>
Implemented a new function to reject OpenAI-style snake_case aliases for tool_calls and tool_call_id, providing clear error messages for users. Updated the validation logic to incorporate this check, ensuring that these fields fail loudly instead of being silently stripped during normalization. Added corresponding tests to verify the correct rejection behavior and error messaging for these legacy fields.
Enhanced the validation logic in `rejectStableToolFields` to include a check for legacy snake_case tool fields, specifically `tool_calls` and `tool_call_id`. This update ensures that these fields are properly rejected, providing clear error messages to users. Additionally, new tests have been added to verify the rejection behavior for these legacy fields, ensuring robust validation in the stable path.
@SamSamskies
SamSamskies merged commit 91c2340 into main Aug 14, 2026
1 check passed
@SamSamskies
SamSamskies deleted the rename-tool-calls-camelcase branch August 14, 2026 13:53
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.

1 participant