Skip to content

feat(codex): use standalone endpoint for forced web search#53

Open
mulfyx wants to merge 1 commit into
raine:mainfrom
mulfyx:feat/codex-standalone-web-search
Open

feat(codex): use standalone endpoint for forced web search#53
mulfyx wants to merge 1 commit into
raine:mainfrom
mulfyx:feat/codex-standalone-web-search

Conversation

@mulfyx

@mulfyx mulfyx commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route Claude Code's forced web_search_20250305 subrequests through Codex's standalone alpha/search endpoint
  • preserve the resolved request model and omit search reasoning, while forwarding non-empty domain filters
  • translate standalone search responses into Anthropic server_tool_use and web_search_tool_result blocks with web-search usage accounting
  • keep automatic hosted-search requests on the full Responses API, where the model can still decide whether to invoke the tool

Why

Claude Code executes WebSearch as a forced follow-up request. Sending that request through the regular Responses path forces Lite-lane models such as Luna onto a full-lane Sol request because Responses Lite does not support hosted tools.

The current Codex CLI handles this case with a dedicated search endpoint instead. This change follows that contract for forced search requests while preserving the existing Responses behavior for automatic hosted search.

Upstream references

Validation

  • cargo fmt --check
  • cargo test
  • end-to-end Claude Code WebSearch call using the Luna route, confirming alpha/search, unchanged model selection, omitted reasoning, and Anthropic web-search usage accounting

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant