fix(xai): reject invalid x_search handle filters#103393
Merged
Merged
Conversation
This was referenced Jul 10, 2026
Contributor
Author
|
Merged via squash.
|
This was referenced Jul 10, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 10, 2026
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.
Closes #103378
What Problem This Solves
Fixes an issue where users combining
allowed_x_handlesandexcluded_x_handles, or supplying more than 20 handles, would send an invalidx_searchrequest to xAI and receive a provider-side failure.Why This Change Was Made
The xAI plugin now publishes the provider's 20-handle limit in the tool schema and validates both the limit and mutual exclusion at the plugin-owned input boundary before network I/O. The core tool registry and provider-routing behavior are unchanged.
User Impact
Invalid X Search handle filters now fail immediately with a clear tool-input error. Models also see the constraints in the schema, reducing invalid billed-tool attempts.
Evidence
pnpm test extensions/xai/x-search.test.ts extensions/xai/index.test.ts— 61/61 passed on Node 22.23.1.pnpm check:changed --timed— extension and extension-test typechecks, changed-file lint, import-cycle checks, and repository policy guards passed.Release Note Context
AI-assisted: implemented and reviewed with Codex. I inspected the code paths, tests, documentation, and upstream xAI contract and understand the change.