Skip to content

Commit ff9b6ee

Browse files
authored
fix(desktop): restore codex oauth Chinese text
Restores mojibake Chinese text in the Codex OAuth provider and adds regression assertions for the localized strings.
1 parent 45ef5fd commit ff9b6ee

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

apps/desktop/src/main/codex-oauth-ipc.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ describe('codex-oauth:v1:login', () => {
188188
expect(writeConfigMock).toHaveBeenCalledTimes(2);
189189
expect(fakeCachedConfig?.providers['chatgpt-codex']).toMatchObject({
190190
id: 'chatgpt-codex',
191+
name: 'ChatGPT 订阅',
191192
wire: 'openai-codex-responses',
192193
baseUrl: 'https://chatgpt.com/backend-api',
193194
defaultModel: 'gpt-5.3-codex',
@@ -303,7 +304,9 @@ describe('codex-oauth:v1:login', () => {
303304
});
304305

305306
await register();
306-
await expect(handlers.get('codex-oauth:v1:login')?.()).rejects.toThrow(/ChatGPT.*ID/);
307+
await expect(handlers.get('codex-oauth:v1:login')?.()).rejects.toThrow(
308+
'Codex 登录成功但无法读取 ChatGPT 账户 ID,请重试登录。',
309+
);
307310
expect(closeMock).toHaveBeenCalledTimes(1);
308311
expect(writeConfigMock).not.toHaveBeenCalled();
309312

apps/desktop/src/main/codex-oauth-ipc.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export { CHATGPT_CODEX_PROVIDER_ID };
4040

4141
const CHATGPT_CODEX_PROVIDER: ProviderEntry = {
4242
id: CHATGPT_CODEX_PROVIDER_ID,
43-
name: 'ChatGPT 璁㈤槄',
43+
name: 'ChatGPT 订阅',
4444
builtin: false,
4545
wire: 'openai-codex-responses',
4646
// pi-ai's openai-codex-responses wire appends `/codex/responses` itself, so
47-
// we store the bare base. Do not add `/codex` here 鈥?it'd produce
47+
// we store the bare base. Do not add `/codex` here it'd produce
4848
// `/codex/codex/responses`.
4949
baseUrl: 'https://chatgpt.com/backend-api',
5050
defaultModel: 'gpt-5.3-codex',
@@ -90,7 +90,7 @@ export function getCodexTokenStore(): CodexTokenStore {
9090
return tokenStoreSingleton;
9191
}
9292

93-
/** Test-only reset hook 鈥?vitest resets module state between test cases. */
93+
/** Test-only reset hook vitest resets module state between test cases. */
9494
export function __resetCodexTokenStoreForTests(): void {
9595
tokenStoreSingleton = null;
9696
activeLoginAbortController = null;
@@ -178,7 +178,7 @@ async function runLoginFlow(abortController: AbortController): Promise<CodexOAut
178178
const tokenSet: TokenSet = await exchangeCode(code, pkce.verifier, server.redirectUri);
179179
if (tokenSet.accountId === null) {
180180
throw new CodesignError(
181-
'Codex 鐧诲綍鎴愬姛浣嗘棤娉曡鍙?ChatGPT 璐︽埛 ID锛岃閲嶈瘯鐧诲綍銆?',
181+
'Codex 登录成功但无法读取 ChatGPT 账户 ID,请重试登录。',
182182
ERROR_CODES.PROVIDER_ERROR,
183183
{ cause: null },
184184
);
@@ -275,7 +275,7 @@ async function runLogout(): Promise<CodexOAuthStatus> {
275275
* `chatgpt-codex` with Phase 1's stale `wire`/`baseUrl`, overwrite with the
276276
* Phase 2 canonical values so the first generate after upgrade works without
277277
* requiring a manual re-login. No-op when the entry is absent or already
278-
* canonical. Safe to call on every boot 鈥?writes only when state diverges.
278+
* canonical. Safe to call on every boot writes only when state diverges.
279279
*
280280
* Phase 1 released the card in "coming soon" disabled mode, so this migration
281281
* only fires for users who ran this feat branch directly; zero writes on

0 commit comments

Comments
 (0)