Skip to content

docs(claude): describe tool search behind a gateway for current Claude Code - #8493

Merged
lidge-jun merged 2 commits into
devfrom
codex/7963-tool-search-docs
Nov 10, 2026
Merged

lidge-jun merged 2 commits into
devfrom
codex/7963-tool-search-docs

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Claude Code v2.1.304 and later turn tool search on by default when ANTHROPIC_BASE_URL points to a gateway (Claude Code docs: Tool search through an LLM gateway). OpenCodex still described the old behavior: the #4838 comment in src/cli/claude.ts and the "MCP tool schemas fill the context on turn one" troubleshooting entry said deferral is off behind every ocx claude gateway, and every locale's environment table said ENABLE_TOOL_SEARCH was "off by default", which reads as "tool search is off".

  • The src/cli/claude.ts comment states the version-dependent client default, the translated Chat route's cache cost on each ToolSearch load (Claude Code ToolSearch loads re-miss the prompt cache on translated Chat routes; ocx claude now hits this by default #7963), and that an unset claudeCode.toolSearch leaves the client default in place. The code does not change.
  • The English and Korean troubleshooting entries explain both versions, keep the toolSearch: true re-enable for older clients, and give the supported mitigation for translated Chat routes: export ENABLE_TOOL_SEARCH=false before ocx claude (an exported value always wins, covered by tests/claude-integration/claude-cli.test.ts).
  • The ENABLE_TOOL_SEARCH table 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

  • Docs and comment only; no behavior change, so there is no fail-first test.
  • bun test tests/claude-integration/claude-cli.test.ts (isolated HOME): 74 pass, 0 fail, including the case that a user's own ENABLE_TOOL_SEARCH export wins.
  • bun run typecheck, bun run structure:check, bun run privacy:scan, git diff --check: pass.
  • Layout, file-size ratchet, Lab boundary and structure guards: 87 pass, 0 fail.
  • NOT RUN: docs-site build; bun run test:changed (the only source change is a comment); a live Claude Code session.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Maintainer judgment

  • Value: the troubleshooting entry stops sending users after a default that no longer exists, and names the cache cost and mitigation that Claude Code ToolSearch loads re-miss the prompt cache on translated Chat routes; ocx claude now hits this by default #7963 measured.
  • UX change scope: documentation and one source comment.
  • Regression evidence for existing users: ocx claude environment construction is unchanged; its 74 tests pass.
  • Windows impact: none. export is shown as the shell example; PowerShell users set $env:ENABLE_TOOL_SEARCH, as for every other variable on that page.
  • Verification scope / NOT RUN: see above.

…e Code

Claude Code v2.1.304 turns tool search on by default behind an ANTHROPIC_BASE_URL gateway. Correct the #4838 comment, the troubleshooting entry, and the ENABLE_TOOL_SEARCH table rows, and document the translated Chat cache cost with the ENABLE_TOOL_SEARCH=false mitigation.

Refs #7963
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 10, 2026 18:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T18:45:32.460901Z 8bfd32f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added documentation Improvements or additions to documentation intake: hygiene-blocked Deterministic PR hygiene checks failed labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deterministic hygiene checks failed.

  • missing_coauthor_credit — This pull request says it reimplements, supersedes, carries, or rebases another author's pull request, but no Co-authored-by trailer names that author. Prose in a commit body is not read by anything; the trailer is what GitHub counts. Add it to the description or a commit, or obtain attribution-approved. Paths: #8057.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed.

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft November 10, 2026 18:44
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions github-actions Bot removed the intake: hygiene-blocked Deterministic PR hygiene checks failed label Nov 10, 2026
@github-actions
github-actions Bot marked this pull request as ready for review November 10, 2026 18:46
@lidge-jun
lidge-jun merged commit 6364d98 into dev Nov 10, 2026
25 checks passed
@lidge-jun
lidge-jun deleted the codex/7963-tool-search-docs branch November 10, 2026 18:49
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant