Skip to content

fix(proxy): strip OpenRouter hop-by-hop request headers#1898

Open
yovinchen wants to merge 1 commit intomainfrom
codex/issue-1888-interception-matrix
Open

fix(proxy): strip OpenRouter hop-by-hop request headers#1898
yovinchen wants to merge 1 commit intomainfrom
codex/issue-1888-interception-matrix

Conversation

@yovinchen
Copy link
Copy Markdown
Collaborator

Summary

  • strip hop-by-hop request headers only for Codex requests routed to OpenRouter chat/responses endpoints
  • keep Claude official messages requests unchanged and leave response-side behavior out of this patch
  • add focused unit coverage for the OpenRouter guard and dynamic Connection token stripping

Testing

  • cargo test --manifest-path src-tauri/Cargo.toml should_guard_openrouter_codex_headers_only_for_openrouter_chat_and_responses
  • cargo test --manifest-path src-tauri/Cargo.toml should_strip_openrouter_codex_request_header_covers_static_and_dynamic_hop_by_hop_headers
  • cargo test --manifest-path src-tauri/Cargo.toml rewrite_claude_transform_endpoint_strips_beta_for_chat_completions
  • cargo clippy --manifest-path src-tauri/Cargo.toml --lib -- -W clippy::too_many_arguments

Closes #1888

Scope the guard to Codex OpenRouter chat/responses requests only.

Refs #1888
@yovinchen
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

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

@farion1231
Copy link
Copy Markdown
Owner

Hi, I owe you an apology for the long silence. As the sole maintainer of this project, I've been overwhelmed and fell behind on reviews — but that's on me, not on you. Your contribution matters and I will review this PR. If it needs a rebase, just let me know or I can handle it. Thank you for your time and patience.

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.

OpenRouter provider: anthropic-beta context-management-2025-06-27 should be stripped

2 participants