Skip to content

fix(responses): preserve caller User-Agent through auth materialization - #591

Open
luvs01 wants to merge 7 commits into
devfrom
codex/propose-fix-for-user-agent-fallback-issue
Open

luvs01 wants to merge 7 commits into
devfrom
codex/propose-fix-for-user-agent-fallback-issue

Conversation

@luvs01

@luvs01 luvs01 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Production request paths materialize a filtered Headers set from FORWARD_HEADERS which omitted User-Agent, so the new adapter-level fallback could not see the caller fingerprint in real HTTP/Chat/WebSocket flows.
  • The change restores the documented behaviour: preserve the caller User-Agent as a single non-credential fallback while keeping provider-configured headers authoritative.

Description

  • Add `

Codex Task


Devin Review

devin-ai-integration Bot and others added 2 commits September 20, 2026 13:22
…forwarded role (lidge-jun#5334 follow-up)

lidge-jun#5334 made the developer wire role tri-state: an undeclared destination folds
it to system. Two suites asserting role:"developer" on the Chat wire were
missed because they are about tool-result repair ordering and document parts,
not role selection — declare the destination, per the convention the change
established.

Verified: both files fail on dev@600075d2 with system-for-developer wire roles
and pass with the declaration.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: fc98a28b-7b79-48bc-a9c9-f295fb901667


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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T01:22:34.910610Z 1074d31 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 the bug Something isn't working label Sep 21, 2026
@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 3 potential issues.

Devin Review

Comment thread src/adapters/openai-responses/passthrough.ts
Comment thread src/adapters/openai-responses/passthrough.ts
"session_id",
"session-id",
"thread-id",
"user-agent",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Explicit security review is required

This changes the shared header set used by Codex authentication materialization. Repository policy requires explicit security review for authentication-boundary changes before merge.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Acknowledged — this touches the shared allowlist consumed by auth materialization, so it needs the explicit security review per MAINTAINERS.md before merge. Leaving this thread open for the maintainer; the fix commit narrows the semantics so user-agent is fallback-only wherever it overlays configured headers.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits September 21, 2026 01:41
…user-agent-fallback-issue

Co-Authored-By: Epinephrine <luvs01@hanmail.net>

# Conflicts:
#	tests/adapters/openai/openai-chat-dangling-toolcalls.test.ts
#	tests/responses/chat-inline-document-bytes.test.ts
…ed caller value

A caller User-Agent now reaches the canonical forward path through auth
materialization, but the generic FORWARD_HEADERS overlay wrote it after
provider.headers, replacing or duplicating a configured value. Apply it
through applyCallerUserAgentFallback only, shared by the web-search and
vision sidecar replays, so a configured provider header wins
case-insensitively and the caller fingerprint fills only the gap.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
devin-ai-integration[bot]

This comment was marked as resolved.

…d relays

The standalone search, images, live, and context-history relays overlay
materialized auth headers after configured provider headers, so the caller
User-Agent newly retained by FORWARD_HEADERS replaced the configured
fingerprint there too. Skip the name in each overlay and defer to
applyCallerUserAgentFallback, which now also accepts a Headers target for
the context relay. Sidecar tests cover configured precedence and caller
fallback; a wiring guard pins all four relays to the shared helper.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
devin-ai-integration[bot]

This comment was marked as resolved.

…nd audio sends

Compact's FORWARD_HEADERS overlays and the audio upstream both write the
materialized caller header set without ever merging provider.headers, so the
allowlist addition sent the caller fingerprint even when the provider config
carries a User-Agent of its own. Extend the shared fallback with a provider
header oracle so those paths keep the configured value; the caller User-Agent
still fills the name when the provider leaves it unset.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
devin-ai-integration[bot]

This comment was marked as resolved.

The native compact fallback only ran while materializing a Codex account, so
a canonical API-key provider sent neither the configured nor the caller
User-Agent. Apply the fallback after the auth-mode branch against the final
compactProvider so every compact send gets the same precedence. The record
branch of applyCallerUserAgentFallback also returned early on an existing
User-Agent even when a configured provider value was supplied; it now evicts
stale duplicates and writes the configured value, matching the Headers shape.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant