Repository navigation
docs(claude): describe tool search behind a gateway for current Claude Code - #8493
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
Contributor
✅ READY
Hygiene✅ Deterministic PR hygiene checks passed. |
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Merged
3 tasks done
lidge-jun
added a commit
that referenced
this pull request
Nov 10, 2026
…ds (opt-in dispatcher) (#8502) Maintainer carry of #8057 by @Gudals0320 onto current dev. On a translated openai-chat route every client ToolSearch load rewrites the tool catalog and the tool-name nudge in the system message, so the next request re-misses the provider prompt cache for the whole conversation. The new opt-in claudeCode.chatToolDispatchModels (same selector grammar, validation, salvage and provider-ID migration as appendOnlyToolLoadingModels) applies only on a direct openai-chat physical adapter: the catalog carries one stable use_loaded_tool dispatcher from the first request, loaded definitions ride the ToolSearch result as text, history is re-encoded deterministically, and dispatcher calls are rewritten to the named tool on both parse paths. Absent, empty or unlisted configuration sends byte-identical requests. Changes on top of #8057: - Every well-formed {name, arguments?} dispatcher call is rewritten to the tool it names, so a deferred tool that was never loaded, or an undeclared name, reaches Claude Code by its real name instead of as use_loaded_tool. Malformed, extra-key, incomplete, empty-name and self-named calls still pass through. - toolSearch, appendOnlyToolLoadingModels and chatToolDispatchModels move to src/types/claude-tool-loading.ts, which OcxClaudeCodeConfig extends, so src/types/config.ts shrinks instead of crossing its 2,000-line cap. - An allowed-tools restriction sends the request unprojected; the shared selector helpers get neutral names. - The Chat-routes docs build on #8493's troubleshooting text and name the opt-in next to the ENABLE_TOOL_SEARCH=false mitigation. Closes #7963 Co-authored-by: Gudals0320 <255312450+Gudals0320@users.noreply.github.com>
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
Claude Code v2.1.304 and later turn tool search on by default when
ANTHROPIC_BASE_URLpoints to a gateway (Claude Code docs: Tool search through an LLM gateway). OpenCodex still described the old behavior: the #4838 comment insrc/cli/claude.tsand the "MCP tool schemas fill the context on turn one" troubleshooting entry said deferral is off behind everyocx claudegateway, and every locale's environment table saidENABLE_TOOL_SEARCHwas "off by default", which reads as "tool search is off".src/cli/claude.tscomment states the version-dependent client default, the translated Chat route's cache cost on eachToolSearchload (Claude Code ToolSearch loads re-miss the prompt cache on translated Chat routes;ocx claudenow hits this by default #7963), and that an unsetclaudeCode.toolSearchleaves the client default in place. The code does not change.toolSearch: truere-enable for older clients, and give the supported mitigation for translated Chat routes: exportENABLE_TOOL_SEARCH=falsebeforeocx claude(an exported value always wins, covered bytests/claude-integration/claude-cli.test.ts).ENABLE_TOOL_SEARCHtable row in all seven locales now says OpenCodex does not inject it by default and Claude Code's own default applies.This is option 3 of the owner decision on #7963. The opt-in Chat dispatcher (option 1, based on the closed contributor PR #8057, with author credit) is a separate PR, so this PR does not close the issue.
Refs #7963
Verification
bun test tests/claude-integration/claude-cli.test.ts(isolatedHOME): 74 pass, 0 fail, including the case that a user's ownENABLE_TOOL_SEARCHexport wins.bun run typecheck,bun run structure:check,bun run privacy:scan,git diff --check: pass.bun run test:changed(the only source change is a comment); a live Claude Code session.Checklist
Maintainer judgment
ocx claudenow hits this by default #7963 measured.ocx claudeenvironment construction is unchanged; its 74 tests pass.exportis shown as the shell example; PowerShell users set$env:ENABLE_TOOL_SEARCH, as for every other variable on that page.