Add "grok" to TOOL_USE_ENFORCEMENT_MODELS for direct xAI usage#5531
Closed
Julientalbot wants to merge 1 commit into
Closed
Add "grok" to TOOL_USE_ENFORCEMENT_MODELS for direct xAI usage#5531Julientalbot wants to merge 1 commit into
Julientalbot wants to merge 1 commit into
Conversation
Grok models via direct xAI endpoint tend to narrate planned actions instead of calling tools immediately. Adding "grok" to TOOL_USE_ENFORCEMENT_MODELS ensures the strict tool-use guidance is injected on every turn, matching the behavior for gpt/gemini models. Tested in production on multiple AaaS client instances.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using Grok models via the direct xAI endpoint (
provider: custom+base_url: https://api.x.ai/v1), the model frequently narrates what it plans to do instead of immediately calling tools.This happens even though
TOOL_USE_ENFORCEMENT_GUIDANCEexists.Proposed fix:
This one-line change (in
agent/prompt_builder.py) makes Grok receive the strict "You MUST use your tools..." instruction on every turn, just like the other models.Already running successfully in production on several AaaS client instances.
Additional context: