Skip to content

Add Anthropic web-search bridge for Responses providers#2034

Open
linzj wants to merge 1 commit intofarion1231:mainfrom
linzj:fix/claude-web-search-responses-bridge
Open

Add Anthropic web-search bridge for Responses providers#2034
linzj wants to merge 1 commit intofarion1231:mainfrom
linzj:fix/claude-web-search-responses-bridge

Conversation

@linzj
Copy link
Copy Markdown

@linzj linzj commented Apr 13, 2026

Summary

  • bridge Anthropic web_search tools to OpenAI Responses web_search_call requests
  • round-trip web search history/results across request, non-streaming response, and SSE streaming paths
  • preserve web search usage accounting and reject unsupported constraints instead of widening behavior

Scope

This is not limited to codex_oauth. It affects every Claude provider configured with api_format = "openai_responses", because both request/response transforms and streaming handlers are selected by API format.

Notes

  • forced Anthropic tool_choice for web_search falls back to auto
  • empty allowed_domains are omitted instead of being sent as an empty Responses filter array
  • unsupported blocked_domains and max_uses now fail fast instead of being silently widened or ignored
  • Responses requests only include supported web search fields (web_search_call.action.sources)
  • SSE streaming now emits server_tool_use for non-query web search actions and deduplicates added/done tool-use emission

@farion1231
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb1682fd3b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/proxy/providers/transform_responses.rs Outdated
Comment thread src-tauri/src/proxy/providers/transform_responses.rs Outdated
Comment thread src-tauri/src/proxy/providers/streaming_responses.rs Outdated
@linzj linzj force-pushed the fix/claude-web-search-responses-bridge branch from 55319f6 to aa52da8 Compare April 13, 2026 03:20
@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@farion1231
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa52da83dc

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/proxy/providers/transform_responses.rs Outdated
Comment thread src-tauri/src/proxy/providers/transform_responses.rs
Comment thread src-tauri/src/proxy/providers/streaming_responses.rs Outdated
Bridge Anthropic web_search tools, history replay, non-streaming responses, and SSE streaming onto OpenAI Responses web_search_call handling. Preserve usage accounting, keep non-query action metadata round-trippable across request replay and streaming, and tolerate Codex OAuth max_uses while still failing fast for generic Responses providers.

Scope: this change applies to every Claude provider configured with api_format=openai_responses, not just codex_oauth, because the transform and streaming handlers are selected by API format.
@linzj linzj force-pushed the fix/claude-web-search-responses-bridge branch from aa52da8 to 28580da Compare April 13, 2026 04:33
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.

2 participants