Skip to content

fix(openai/codex): OAuth 失败可观测性 - #673

Open
KevinYoung-Kw wants to merge 1 commit into
op7418:mainfrom
KevinYoung-Kw:fix/openai-oauth-errors-v067
Open

KevinYoung-Kw wants to merge 1 commit into
op7418:mainfrom
KevinYoung-Kw:fix/openai-oauth-errors-v067

Conversation

@KevinYoung-Kw

Copy link
Copy Markdown
Contributor

Summary

  • #464:token exchange 遇到 { error: { message } } 时不再变成 403 - [object Object]
  • /api/openai-oauth/status 上暴露 oauthError(persist lastError),设置页能看到失败原因。
  • 地区不支持 / state 过期用真实 i18n 提示,不复用 #509 里的 t('nav.chats') === '对话' 嗅探。
  • 不引入并发 pendingOAuthByState;最新 main 的单槽 pendingOAuth 已够用。
  • 旧 PR 不改。

Test plan

  • npx tsc --noEmit
  • src/__tests__/unit/openai-oauth-error.test.ts(6/6)
  • 模拟嵌套 error JSON,确认设置页展示可读文案而不是 [object Object]
  • 过期 state / 地区限制能看到对应中英文 hint

Fixes #464

Expand token-exchange errors so `{error:{message}}` is not `[object Object]`, persist lastError on status, and show region/expired-state hints via i18n. Fixes op7418#464.
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

@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.

@github-actions github-actions Bot added area:ui PR/issue 影响面: ui area:tests PR/issue 影响面: tests labels Aug 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests PR/issue 影响面: tests area:ui PR/issue 影响面: ui

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