Repository navigation
Conversation
…cache Grok CLI Responses emit type x_search, which Codex/OpenAI serde rejects. Rewrite x_search/x_search_call to web_search on the client-bound stream. GPT-5 Chat Completions reject max_tokens; emit max_completion_tokens on convert and retry once after unsupported_parameter. Protocol capability learning is keyed by session so one client cannot poison another. Anthropic tools without description get a name-based fill for Grok serde.
caidaoli
added a commit
that referenced
this pull request
Oct 16, 2026
…tokens, keep learned protocol on request-scoped misses - xAI Responses: map x_search_call/x_search to web_search_call/web_search unless the client declared x_search itself; SSE event lines follow. - xAI Anthropic Messages: fill missing tools[].description only for cli-chat-proxy.grok.com / api.x.ai hosts. - OpenAI Chat: rename max_tokens to max_completion_tokens for gpt-5/o families before BodyRules; retry once on explicit max_tokens rejection. - Protocol capability cache: a fallback after a local translation miss no longer overwrites the learned protocol. Reworks PR #182 at the root causes. Co-authored-by: ChenYCL <aa34913@gmail.com>
Owner
|
Thanks for this — all four fixes landed in ac80274, reworked at their root causes (you're credited as co-author):
Not ported: hiding internal x_search custom_tool_call traces (CLIProxyAPI f0f13cfd). Closing in favor of that commit. |
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
Four local overlay fixes that belong on official master:
Grok
x_search→web_searchGrok Responses emit
x_search/x_search_call. Codex/OpenAI clients only acceptweb_search,web_search_2025_08_26,function,mcp,file_search,computer_use_preview,code_interpreter. Rewrite those types on the client-bound xAI OAuth Codex stream so serde does not fail.GPT-5
max_completion_tokensAnthropic → OpenAI Chat Completions still copied
max_tokens. Azure GPT-5.x / o-series reject it. Convertgpt-5*/o1*/o3*/o4*tomax_completion_tokens, and retry once onunsupported_parameter+max_tokens.Protocol capability per session
Auto protocol learning is keyed by session (Claude Code session/thread, OpenCode session, Responses execution, then token hash). One desktop session that probed Codex on Grok no longer pins another session.
Missing Claude
tools[].descriptionGrok's CLI proxy requires the key. Fill from
name(ortype) when the field is absent. Existing descriptions stay.Test