Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(openai): 支持 OAuth 账号级强制 Codex CLI 身份 - #4015

#4015
Open
alfadb wants to merge 1 commit into
Wei-Shaw:mainWei-Shaw/sub2api:mainfrom
alfadb:fix/openai-oauth-codex-identityalfadb/sub2api:fix/openai-oauth-codex-identityCopy head branch name to clipboard
Open

feat(openai): 支持 OAuth 账号级强制 Codex CLI 身份#4015
alfadb wants to merge 1 commit into
Wei-Shaw:mainWei-Shaw/sub2api:mainfrom
alfadb:fix/openai-oauth-codex-identityalfadb/sub2api:fix/openai-oauth-codex-identityCopy head branch name to clipboard

Conversation

@alfadb

@alfadb alfadb commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

背景

#3984 已在 OpenAI OAuth 请求的最终出站阶段自动配对 User-Agent、originator 和最低 version,解决身份错配问题。但现有 gateway.force_codex_cli 是全局静态配置,无法按账号灰度控制;部分部署需要只将特定 OAuth 账号固定为 Codex CLI 身份,同时让其他账号继续保留 codex-tui 等官方客户端身份。

方案

#3984 的关系

本 PR 不替换或回退 #3984。开关关闭时完全沿用 #3984 的自动身份配对;开关开启时只增加账号级的 Codex CLI User-Agent 覆盖,随后仍由 #3984 做统一终态校验。

兼容性

  • 配置保存在现有 accounts.extra JSON 中,无需数据库迁移。
  • 字段缺失等价于关闭,默认行为不变。
  • 关闭开关时删除该键,不写入冗余的 false

验证

  • go test ./internal/service/...
  • go test ./internal/pkg/openai/...
  • golangci-lint run ./...
  • Create/Edit Account Modal Vitest:35 个测试通过
  • pnpm typecheck
  • pnpm lint:check
  • pnpm build
  • 实际 OpenAI OAuth 账号在全局 force_codex_cli=false、账号开关开启时调用 gpt-5.6-luna/v1/responses 返回 HTTP 200;该结果作为端到端行为验证,不等同于出站 header 抓包。

@alfadb
alfadb force-pushed the fix/openai-oauth-codex-identity branch 13 times, most recently from b581a7f to 034daa0 Compare July 19, 2026 02:08
@alfadb
alfadb force-pushed the fix/openai-oauth-codex-identity branch 15 times, most recently from 8cd74f0 to 0b3f01a Compare July 26, 2026 00:38
@alfadb
alfadb force-pushed the fix/openai-oauth-codex-identity branch 2 times, most recently from 5b6bb55 to 6188f64 Compare July 28, 2026 02:16
@alfadb
alfadb force-pushed the fix/openai-oauth-codex-identity branch from 6188f64 to b80fedf Compare July 29, 2026 01:19
@alfadb
alfadb force-pushed the fix/openai-oauth-codex-identity branch from b80fedf to 24a7de4 Compare July 29, 2026 01:51
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.