Skip to content

fix(translation): preserve OpenAI function tool strict#441

Merged
icebear0828 merged 1 commit intoicebear0828:devfrom
d-demand-priv:fix/openai-tool-strict-default
May 7, 2026
Merged

fix(translation): preserve OpenAI function tool strict#441
icebear0828 merged 1 commit intoicebear0828:devfrom
d-demand-priv:fix/openai-tool-strict-default

Conversation

@d-demand-priv
Copy link
Copy Markdown
Contributor

Summary

  • Accept and preserve strict on OpenAI-compatible function tool definitions.
  • Default translated OpenAI function tools and legacy functions to strict: false when the client does not specify it.
  • Add unit coverage for default non-strict behavior and explicit strict: true preservation.

Why

OpenAI Responses-style tool handling can normalize omitted strict into strict schema behavior. That can make previously optional tool schema properties mandatory, which breaks MCP-style tools that intentionally use optional fields or mutually exclusive request modes.

This keeps strict mode available for clients that explicitly request it, while preserving non-strict compatibility for OpenAI chat/function tools by default.

Test plan

  • npm test -- tests/unit/translation/tool-format.test.ts

Co-authored-by: Cursor <cursoragent@cursor.com>
@icebear0828 icebear0828 force-pushed the fix/openai-tool-strict-default branch from f66a619 to e0f625a Compare May 7, 2026 16:38
@icebear0828 icebear0828 merged commit 7af1bf3 into icebear0828:dev May 7, 2026
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