Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 27, 2026

Related GitHub Issue

Closes: #11011

Description

This PR addresses the issue where kie.ai (and similar OpenAI-compatible providers using Gemini 3 Pro) fails to work properly because the OpenAI provider adds strict: true and schema modifications that these providers do not support.

Key implementation details:

  • Added a new openAiStrictToolMode setting to the OpenAI provider settings schema
  • Modified convertToolsForOpenAI() in base-provider.ts to accept a useStrictMode parameter
  • When strict mode is disabled, tool definitions are passed through without modifications (no strict: true, no additionalProperties: false, no required array modifications)
  • The setting defaults to true (enabled) for backward compatibility with standard OpenAI API
  • Added a checkbox in the OpenAI-Compatible settings UI to toggle this setting

Trade-offs:

  • Opted for a simple boolean toggle rather than more granular control, as this covers the common use case of providers that support standard OpenAI function calling but not strict mode

Test Procedure

  1. All existing tests pass (48 openai.spec.ts tests, 15 base-provider.spec.ts tests)
  2. Type checking passes across all packages
  3. Manual testing can be performed by:
    • Configure an OpenAI-Compatible provider pointing to kie.ai
    • Disable the "Enable strict tool mode" checkbox
    • Verify that tool calls work correctly

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - This is a settings addition. The new checkbox appears in the OpenAI-Compatible provider settings panel.

Documentation Updates

  • No documentation updates are required.
  • Yes, documentation updates are required. (The new setting should be documented for users configuring OpenAI-compatible providers like kie.ai)

Additional Notes

The kie.ai API documentation shows it supports standard OpenAI function calling with the tools array format, but does not support OpenAI's strict mode. This setting allows users to disable strict mode for such providers while maintaining backward compatibility for standard OpenAI API usage.


Important

Introduces openAiStrictToolMode setting to handle OpenAI-compatible providers not supporting strict mode, with UI and internationalization updates.

  • Behavior:
    • Adds openAiStrictToolMode setting to OpenAI provider settings schema in provider-settings.ts.
    • Modifies convertToolsForOpenAI() in base-provider.ts to accept useStrictMode parameter, bypassing strict mode modifications when disabled.
    • Defaults to true for backward compatibility.
    • Adds UI checkbox in OpenAICompatible.tsx to toggle this setting.
  • Internationalization:
    • Updates settings.json in multiple locales (e.g., tr, vi, zh-CN, zh-TW) to include translations for the new setting.
  • Testing:
    • All existing tests pass, including 48 in openai.spec.ts and 15 in base-provider.spec.ts.
    • Manual testing instructions provided for OpenAI-Compatible providers.

This description was created by Ellipsis for bf97532. You can customize this summary. It will automatically update as commits are pushed.

This adds a new setting `openAiStrictToolMode` that allows users to disable
OpenAI strict mode for tool definitions. When strict mode is disabled:
- No `strict: true` is added to tool definitions
- No schema modifications (additionalProperties: false, all required) are made

This is useful for providers like kie.ai that use the Gemini 3 Pro model
and do not support OpenAI's strict mode for function calling.

The setting defaults to true for backward compatibility.

Closes #11011
@roomote
Copy link
Contributor Author

roomote bot commented Jan 27, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found.

The implementation correctly adds an openAiStrictToolMode setting that allows users to disable OpenAI strict mode for tool definitions. This enables compatibility with providers like kie.ai that don't support strict mode.

Verified:

  • Type definition properly added to Zod schema
  • Setting defaults to true for backward compatibility
  • Setting applied in all 4 code paths (streaming/non-streaming, regular/O3)
  • UI checkbox and i18n strings properly added
  • All 17 locale translations added correctly (ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph
Copy link
Collaborator

@roomote fix the translations

@roomote
Copy link
Contributor Author

roomote bot commented Jan 28, 2026

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issues. All local checks passed.

View commit | Revert commit

@hannesrudolph
Copy link
Collaborator

@roomote mark ready for review

@roomote
Copy link
Contributor Author

roomote bot commented Jan 28, 2026

Fixaroo Clock   See task on Roo Cloud

Marked PR as ready for review.

@roomote roomote bot marked this pull request as ready for review January 28, 2026 16:00
@roomote roomote bot requested review from cte, jr and mrubens as code owners January 28, 2026 16:00
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Documentation Improvements or additions to documentation Enhancement New feature or request labels Jan 28, 2026
@roomote
Copy link
Contributor Author

roomote bot commented Jan 28, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found.

The implementation correctly adds an openAiStrictToolMode setting that allows users to disable OpenAI strict mode for tool definitions. This enables compatibility with providers like kie.ai that don't support strict mode.

Verified:

  • Type definition properly added to Zod schema
  • Setting defaults to true for backward compatibility
  • Setting applied in all 4 code paths (streaming/non-streaming, regular/O3)
  • UI checkbox and i18n strings properly added
  • All 17 locale translations added correctly

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

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

Labels

Documentation Improvements or additions to documentation Enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Gemini 3 error on kie.ai

2 participants