fix(desktop): restore garbled Chinese text in codex-oauth-ipc.ts (#202)#231
Merged
hqhq1025 merged 3 commits intoOpenCoworkAI:mainfrom Apr 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Findings
- [Minor] Add regression assertions for the restored localized strings — this PR fixes user-visible mojibake at
apps/desktop/src/main/codex-oauth-ipc.ts:43andapps/desktop/src/main/codex-oauth-ipc.ts:181, but the existing tests only assert the provider config shape withoutnameatapps/desktop/src/main/codex-oauth-ipc.test.ts:189and use a broad/ChatGPT.*ID/match atapps/desktop/src/main/codex-oauth-ipc.test.ts:306. The exact strings repaired here can regress again without failing CI.
Suggested fix:expect(fakeCachedConfig?.providers['chatgpt-codex']).toMatchObject({ name: 'ChatGPT 订阅', wire: 'openai-codex-responses', baseUrl: 'https://chatgpt.com/backend-api', }); await expect(handlers.get('codex-oauth:v1:login')?.()).rejects.toThrow( 'Codex 登录成功但无法读取 ChatGPT 账户 ID,请重试登录。', );
Summary
- Review mode: initial
- 1 minor issue found: this fix restores the literals, but CI still would not fail if those exact localized strings became mojibake again.
docs/VISION.mdanddocs/PRINCIPLES.md: Not found in repo/docs.
Testing
- Not run (automation). Suggested coverage: extend
apps/desktop/src/main/codex-oauth-ipc.test.tsto assert the exact provider name and null-account error message literals.
open-codesign Bot
| if (tokenSet.accountId === null) { | ||
| throw new CodesignError( | ||
| 'Codex 鐧诲綍鎴愬姛浣嗘棤娉曡鍙?ChatGPT 璐︽埛 ID锛岃閲嶈瘯鐧诲綍銆?', | ||
| 'Codex 登录成功但无法读取 ChatGPT 账户 ID,请重试登录。', |
Contributor
There was a problem hiding this comment.
[Minor] This restores the message, but there is still no exact regression assertion for it. The current test only checks /ChatGPT.*ID/ at apps/desktop/src/main/codex-oauth-ipc.test.ts:306, so the same mojibake could return without failing CI.
Suggested fix:
await expect(handlers.get('codex-oauth:v1:login')?.()).rejects.toThrow(
'Codex 登录成功但无法读取 ChatGPT 账户 ID,请重试登录。',
);
Contributor
There was a problem hiding this comment.
Findings
- None.
Summary
- Review mode: follow-up after new commits
- No issues found in the added or modified lines for this update. The follow-up diff closes the prior regression-coverage gap by asserting the restored provider name and the exact localized null-account error message.
docs/VISION.mdanddocs/PRINCIPLES.md: Not found in repo/docs.- Residual risk: the mojibake fixes in comments at
apps/desktop/src/main/codex-oauth-ipc.ts:47,apps/desktop/src/main/codex-oauth-ipc.ts:93, andapps/desktop/src/main/codex-oauth-ipc.ts:278are non-functional and not separately test-covered.
Testing
- Not run (automation). Existing Vitest coverage in
apps/desktop/src/main/codex-oauth-ipc.test.ts:191andapps/desktop/src/main/codex-oauth-ipc.test.ts:307now covers the restored user-visible strings.
open-codesign Bot
Contributor
There was a problem hiding this comment.
Findings
- None.
Summary
- Review mode: follow-up after new commits
- No issues found in the added or modified lines for this update. The linked issue's acceptance criteria appear satisfied in the public diff: the provider label is restored at
apps/desktop/src/main/codex-oauth-ipc.ts:43, the user-facing null-account error message is restored atapps/desktop/src/main/codex-oauth-ipc.ts:181, and the remaining mojibake comments called out in #202 are corrected atapps/desktop/src/main/codex-oauth-ipc.ts:47,apps/desktop/src/main/codex-oauth-ipc.ts:93, andapps/desktop/src/main/codex-oauth-ipc.ts:278. - The follow-up diff versus the last bot-reviewed commit only reformats the existing assertion at
apps/desktop/src/main/codex-oauth-ipc.test.ts:307. - Residual risk: the comment-only fixes are not separately test-covered, but the user-visible strings are covered by assertions at
apps/desktop/src/main/codex-oauth-ipc.test.ts:189andapps/desktop/src/main/codex-oauth-ipc.test.ts:307.
Testing
- Not run in automation environment (
pnpmunavailable on PATH). Static review only.
open-codesign Bot
Collaborator
|
Thanks for fixing the mojibake in the Codex OAuth strings and adding regression coverage. I merged this into main after the formatting fix and fresh CI passed. |
GoDiao
added a commit
to GoDiao/blog-source
that referenced
this pull request
Apr 27, 2026
PR #231 merged: fix garbled Chinese text in codex-oauth-ipc.ts OpenCoworkAI/open-codesign#231 - Add open-codesign card to Projects page OSS grid - Add open-codesign row to homepage OSS list - Add en/zh i18n strings - Download project social preview image Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes mojibake (garbled text) in
apps/desktop/src/main/codex-oauth-ipc.tscaused byUTF-8 text being incorrectly decoded as GBK then re-saved as UTF-8.
ChatGPT 璁㈤槄toChatGPT 订阅鈥?→—) in 3 code commentsCloses #202
Changes
apps/desktop/src/main/codex-oauth-ipc.ts— 5 string replacements, no logic changes.Test plan
ChatGPT 订阅