Repository navigation
fix(oauth): use PI-Desktop in ChatGPT sign-in - #2653
Conversation
There was a problem hiding this comment.
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.
|
已合入 |
概要
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 场景。未使用真实账号登录。