feat: forward x_search time range and image search in console provider - #892
Open
0xlinn wants to merge 2 commits into
Open
feat: forward x_search time range and image search in console provider#8920xlinn wants to merge 2 commits into
0xlinn wants to merge 2 commits into
Conversation
Console path normalizeConsoleTools currently strips every x_search field except type/enable_video_understanding and every web_search field except type/enable_image_understanding, dropping from_date/to_date and enable_image_search that clients legitimately send. - web_search: pass through enable_image_search (image search toggle) - x_search: pass through from_date/to_date (YYYY-MM-DD) with format and order validation; invalid values are dropped instead of erroring, matching the console provider's tolerate-and-drop style. The cli provider already validates these fields the same way. Behavior is unchanged for requests that do not set the new fields.
…forwarding Add table-style subtests for normalizeConsoleTools: - forward enable_image_search on web_search; omit when unset - strip unknown web_search fields - forward valid x_search from_date/to_date - drop invalid formats and inverted ranges - keep single-sided from_date Keeps Console's tolerate-and-drop style (unlike CLI which returns 400).
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.
Summary
The Console provider path (
normalizeConsoleToolsinbackend/internal/infra/provider/console/normalize.go) currently strips everyx_searchfield excepttype/enable_video_understanding, and everyweb_searchfield excepttype/enable_image_understanding. Clients that send the official xAI fieldsfrom_date/to_date(X search time bounds) andenable_image_search(image search toggle) silently lose them.Changes
web_search: pass throughenable_image_search(official xAI Web Search tool field, see https://docs.x.ai/developers/tools/web-search)x_search: pass throughfrom_date/to_date(official xAI X Search fields, YYYY-MM-DD) with:from_date>to_date, both are dropped to avoid an upstream 400The
cliprovider already validates these exact fields (responses_tool_types.gonormalizeXSearchTool), so this brings the Console path closer to the same wire contract.Compatibility
No behavior change for requests that do not set the new fields: existing tools are normalized exactly as before (defaults
enable_image_understanding: true,enable_video_understanding: trueunchanged). Invalid values are dropped, never passed upstream.Notes / residual risk
allowed_domains/excluded_domains/allowed_x_handles/excluded_x_handles(out of scope for this PR).