Skip to content

[codex] dedupe remote control account header - #29893

Merged
shuo-openai merged 2 commits into
mainfrom
dev/shuo/dedupe-remote-control-account-header
Jun 24, 2026
Merged

[codex] dedupe remote control account header#29893
shuo-openai merged 2 commits into
mainfrom
dev/shuo/dedupe-remote-control-account-header

Conversation

@shuo-openai

@shuo-openai shuo-openai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Why

Remote-control HTTP requests applied the authentication headers and then appended ChatGPT-Account-ID again with reqwest::RequestBuilder::header. Since reqwest appends, the wire request could contain the same header twice. Intermediaries may coalesce duplicate values into uuid,uuid, which is not a valid account ID.

What changed

  • Build remote-control request authentication headers in one place.
  • Apply provider headers first, then use HeaderMap::insert for the explicit account ID. This preserves the current account-ID precedence and all other authentication headers while ensuring exactly one account header is sent.
  • Preserve duplicate HTTP headers in the test harness and assert exactly one account header for enroll, refresh, list, and revoke requests.

Validation

Added focused coverage for:

  • Adding the explicit account header when the auth provider omits it.
  • Replacing multiple provider-supplied account values, including a differently cased header name.
  • Preserving authorization and routing headers while replacing only the account header.
  • Rejecting invalid account header values before sending a request.
  • Emitting exactly one account header for enroll, refresh, list, and revoke requests.
  • Maintaining header uniqueness across unauthorized recovery, retry, and error-response paths.
  • Emitting exactly one installation header for enroll and refresh requests.

Checks run:

  • just test -p codex-app-server-transport request_headers: 3 passed
  • just test -p codex-app-server-transport remote_control_http_mode: 6 passed
  • just test -p codex-app-server-transport clients_tests: 6 passed
  • just test -p codex-app-server-transport: 123 passed
  • cargo test -p codex-app-server-transport: 123 passed
  • just clippy -p codex-app-server-transport
  • just fmt-check
  • bazel test //codex-rs/app-server-transport:app-server-transport-unit-tests

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@shuo-openai
shuo-openai marked this pull request as ready for review June 24, 2026 19:55
@shuo-openai
shuo-openai marked this pull request as draft June 24, 2026 20:55
@shuo-openai
shuo-openai marked this pull request as ready for review June 24, 2026 22:05
@shuo-openai

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 24, 2026
@shuo-openai
shuo-openai merged commit bb05c1f into main Jun 24, 2026
31 of 32 checks passed
@shuo-openai
shuo-openai deleted the dev/shuo/dedupe-remote-control-account-header branch June 24, 2026 22:06
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants