Skip to content

fix(oauth): use PI-Desktop in ChatGPT sign-in - #2653

Merged
vastsa merged 2 commits into
vastsa:mainfrom
Linuxdazhao:fix/chatgpt-consent-app-name
Dec 1, 2026
Merged

vastsa merged 2 commits into
vastsa:mainfrom
Linuxdazhao:fix/chatgpt-consent-app-name

Conversation

@Linuxdazhao

Copy link
Copy Markdown
Contributor

概要

openai 入口发起 Sign in with ChatGPT 时,将应用名提示从默认的 Pi 改为 PI-Desktop。安装 ID、凭据存储和旧 openai-codex 线路不变。

Closes #2652

验证

  • 基线 325167720383,候选 0b3b71ea9796:pnpm check:pr-base 通过。
  • pnpm --filter @pi-desktop/desktop typecheck 和 git diff --check 通过。
  • E2E-OAUTH-pi-installation-identity-and-standalone-load 的三份离线测试共 45 项通过。独立打包测试捕获实际 SDK 发出的授权 URL:修复前为 Pi,修复后为 PI-Desktop。

已更新凭据存储规范和对应 E2E 场景。未使用真实账号登录。

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

AIUO CodePilot · Preliminary review

Diff-only preliminary review: the change adds `agentName: "PI-Desktop"` to the openai OAuth options and asserts the resulting `agent_name_hint` query parameter in the standalone bundle test, plus doc updates. One concern is that the production code conditions the option on `session.vendorId === "openai"` while the test asserts the hint after `login("openai")`, without evidence in the diff that the assertion covers the legacy Codex path or other vendors remaining unchanged. No tools, tests, or runtime verification were performed.

  • low apps/desktop/electron/main/oauth\.ts:961: The app-name hint is applied via a conditional spread keyed only on `session.vendorId === "openai"`. If the legacy Codex flow (which the spec says must remain unchanged) also routes through this same `VendorOAuth` call path with `vendorId === "openai"`, the hint could be injected there unintentionally. The diff does not show a guard distinguishing the ChatGPT sign-in path from the legacy Codex path. Verify that this code path is unreachable for legacy Codex or that Codex uses a different vendor id/flow.
    Evidence: \.\.\.\(session\.vendorId === "openai" ? \{ agentName: "PI\-Desktop" \} : \{\}\),
  • low apps/desktop/test/oauth\-standalone\-bundle\.test\.mjs:165: The new assertion only checks the `openai` login case. Given the spec change claims the legacy Codex flow is unchanged, consider also asserting that the Codex (or non-openai) authorization URL does not carry `agent_name_hint=PI-Desktop`, so a regression that spreads the hint onto other flows would be caught.
    Evidence: assert\.equal\(authorization\.searchParams\.get\("agent\_name\_hint"\), "PI\-Desktop"\);

Head: 0b3b71e
Base: 3251677
CI: pending; mergeable: true.

Validation: code/tests NOT EXECUTED. Diff-only preliminary analysis; not approval. Human review and repository gates remain required.

@vastsa
vastsa merged commit 71d952f into vastsa:main Dec 1, 2026
6 checks passed
@vastsa

vastsa commented Dec 1, 2026

Copy link
Copy Markdown
Owner

已合入 71d952fed6。最新集成候选的 6 项 GitHub 检查和 45 项离线 OAuth 测试通过;只调整 ChatGPT 的授权页应用名,未使用真实账号登录。谢谢!

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.

[Bug] Sign in with ChatGPT 授权请求把 PI-Desktop 标成 Pi

2 participants