Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@codegoddy
Copy link

Context

This PR fixes issue #5189 where Cerebras API returns an error when tools have mixed strict parameter values. The error occurs because some tools (MCP tools) have strict: true while others don't have the parameter set, causing Cerebras to reject the request with: "All tools must have the same value for the 'strict' parameter."

Implementation

The fix ensures all tools sent to Cerebras have strict: false by modifying the convertToolsForOpenAI method in src/api/providers/cerebras.ts. This approach:

  • Sets strict: false for all tools regardless of their source (native or MCP)
  • Maintains compatibility with Cerebras API requirements
  • Follows the same pattern used by other providers that don't support strict mode

Key changes:

  • Modified convertToolsForOpenAI to explicitly set strict: false on all tool definitions
  • Added comprehensive test coverage to verify the fix works correctly
  • Tests confirm that both native and MCP tools are handled consistently

Screenshots

before after
N/A - Error occurred during API call N/A - Fix prevents error, no UI changes

How to Test

  1. Configure Kilo Code to use Cerebras as the API provider
  2. Set up at least one MCP server with tools (or use any scenario where MCP tools are available)
  3. Attempt to use a tool in a conversation that would trigger tool calling
  4. Before the fix: You would see an error about mixed strict parameter values
  5. After the fix: Tool calling should work without errors

Alternatively, run the test suite:

cd src
pnpm test api/providers/__tests__/cerebras.spec.ts

##Get in touch

Discord:@codegoddy


This PR description provides all the necessary context for reviewers to understand the issue, the solution, and how to verify it works correctly.

- Remove strict parameter from Cerebras tool definitions to fix error
- Add test coverage for tool calling functionality
- Fixes Kilo-Org#5189
@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2026

🦋 Changeset detected

Latest commit: 2c71597

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

@tris
Copy link

tris commented Jan 20, 2026

dup of #5193?

@codegoddy
Copy link
Author

codegoddy commented Jan 20, 2026

@tris Yes, looks like it.

@codegoddy codegoddy closed this Jan 20, 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