Files
adnaan d521a537e2 feat(i18n): carry main-process provider-auth errors as codes, not Chinese prose
The five remaining Chinese-only strings all live in the main process, where
there is no interface language to read: `resolveAuthForConfig` only ever sees
an `LLMConfig`, and the two OpenAI OAuth sites fire from `server.once("error")`
and a `setTimeout` callback with no request context at all. So the main process
throws a reason code and the renderer turns it into words at the display site —
the same shape `securityReasonText.ts` uses for `ExecutionReason`.

The code rides inside `Error.message` because it has to cross five different
IPC shapes and three of them drop a custom `code` field: `healthCheck:testModel`
returns `{success, error}`, `llm:generateObject` rejects and Electron stringifies
only the message, and `credentials:oauth:login` does send `code` but the preload
return type omits it. The message is the one thing all five deliver verbatim.

`mapAISDKError` needed a guard: its keyword fallback lowercases the message and
matches `includes("timeout")`, which `oauthLoginTimeout` satisfies — after which
`toAppError` swaps the whole message for "Request timed out" and the code is gone
before the renderer sees it. That fallback exists for unstructured messages, so
it now steps aside for structured ones. The new test walks every code through
`toAppError` rather than restating the keyword list, so a future `...Network` or
`...Fetch` code cannot reintroduce this quietly.

With this, the Chinese-only guard in noInlineBilingual reaches zero.
2026-09-02 12:28:52 +08:00
..