Add per-account custom User-Agent override for OpenAI OAuth accounts - #6294
Open
JnyRoad wants to merge 2 commits into
Open
Add per-account custom User-Agent override for OpenAI OAuth accounts#6294JnyRoad wants to merge 2 commits into
JnyRoad wants to merge 2 commits into
Conversation
New OpenAI OAuth accounts left without a custom User-Agent used to share one hardcoded UA constant across every account, making all outbound Codex traffic look identical regardless of the underlying ChatGPT account. Assign each account a deterministic (OS;arch)+ terminal combination from a built-in pool, keyed by account ID, on creation only; existing accounts are unaffected unless edited. Also expose a per-account custom User-Agent field on the OpenAI OAuth edit form, mirroring the existing plan_type override pattern: non-empty overrides the pool assignment, clearing it removes the credential key. originator/version reconstruction is untouched — both paths only ever produce the (OS;arch)+terminal segment of the UA string. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
|
All contributors have signed the CLA. ✅ |
Per-account automatic User-Agent assignment on account creation conflicted with the existing global `openai_codex_user_agent` setting: once an account had a non-empty credentials.user_agent, the account level value always took priority over the global one in resolveCodexOutboundIdentity, silently making the global setting ineffective for any account created after this landed. Keep a single global UA as the source of truth, with the per-account manual override on the edit form (added earlier in this branch) as the only supported per-account exception. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Author
I have read the CLA Document and I hereby sign the CLA |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
plan_typemanual-override pattern: a non-empty value overrides the globalopenai_codex_user_agentsetting for that one account (only contributing client name/OS/arch/terminal —originator/versionare still reconstructed by the existingresolveCodexOutboundIdentitylogic, untouched by this change); clearing it removes theuser_agentcredential key and falls back to the global setting.openai_codex_user_agentsetting for every newly created account (account-level always wins over global inresolveCodexOutboundIdentity). A single global UA governing all accounts, with this manual per-account override as the only exception, is the intended behavior.Test plan
go build ./...andgo vet ./...cleango test ./internal/service/...— full package, 0 failuresvitest run— 246 files / 1771 tests, 0 failures🤖 Generated with Claude Code