Skip to content

fix(openai/codex): 优化 OAuth 失败可观测性与用户提示#509

Open
KevinYoung-Kw wants to merge 1 commit intoop7418:mainfrom
KevinYoung-Kw:fix/openai-codex-oauth-errors
Open

fix(openai/codex): 优化 OAuth 失败可观测性与用户提示#509
KevinYoung-Kw wants to merge 1 commit intoop7418:mainfrom
KevinYoung-Kw:fix/openai-codex-oauth-errors

Conversation

@KevinYoung-Kw
Copy link
Copy Markdown
Contributor

@KevinYoung-Kw KevinYoung-Kw commented Apr 16, 2026

变更说明

  • 持久化最近一次 OpenAI OAuth 失败原因,并通过 /api/openai-oauth/status 返回给前端
  • 解析嵌套错误结构,避免 403 - [object Object] 这类不可读报错
  • 在设置页对常见 Codex/OpenAI OAuth 失败给出可操作提示(例如地区不支持、state 过期)

背景

部分用户在 OAuth token exchange 阶段失败时,只能在回调页看到不直观错误,难以判断下一步操作。本 PR 将错误原因同步到应用内,提高可诊断性和可用性。

验证

  • npm run -s typecheck

Fixes #464

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

@KevinYoung-Kw is attempting to deploy a commit to the op7418's projects Team on Vercel.

A member of the Team first needs to authorize it.

@KevinYoung-Kw
Copy link
Copy Markdown
Contributor Author

KevinYoung-Kw commented Apr 16, 2026

补充复现结果(网络代理场景):

  • 规则代理:✕
  • 全局代理:✕
  • 全局代理 + 增强模式/TUN 模式:✓

结论:当前 OpenAI OAuth token exchange 对网络链路质量较敏感,开启全局代理并使用增强/TUN 后可稳定完成授权。

@KevinYoung-Kw KevinYoung-Kw changed the title fix(openai/codex): show actionable OAuth failure reasons in settings fix(openai/codex): 优化 OAuth 失败可观测性与用户提示 Apr 16, 2026
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.

OpenAI OAuth 登录报错:Token exchange failed: Token exchange failed: 403 - [object Object]

1 participant