Skip to content

fix(xai): reject invalid x_search handle filters#103393

Merged
steipete merged 1 commit into
mainfrom
codex/fix-xai-handle-filters
Jul 10, 2026
Merged

fix(xai): reject invalid x_search handle filters#103393
steipete merged 1 commit into
mainfrom
codex/fix-xai-handle-filters

Conversation

@steipete

@steipete steipete commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Closes #103378

What Problem This Solves

Fixes an issue where users combining allowed_x_handles and excluded_x_handles, or supplying more than 20 handles, would send an invalid x_search request 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

  • Official xAI contract: X Search filters and fixed-source SDK validation.
  • 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.
  • Fresh structured autoreview — clean; no accepted or actionable findings.
  • Blacksmith Testbox infrastructure stopped during checkout before executing the focused command: run 29069861898. The local run above is the documented unavailable-provider fallback; PR CI remains the authoritative hosted gate.
  • No paid live xAI request was made; the invalid shapes are rejected deterministically before provider I/O.

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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: xai size: S maintainer Maintainer-authored PR labels Jul 10, 2026
@steipete
steipete requested a review from a team as a code owner July 10, 2026 06:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

docs Improvements or additions to documentation extensions: xai maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: x_search accepts invalid handle filter combinations

1 participant