agent: Claude Desktop 4.23118.0's gateway window still has no Chinese (xwoffice)

xwoffice on Discord: "Claude Desktop 接入以后界面会变成英文 取消了又恢复成中文".
Nothing changes in behaviour; this records that the cause is still
Desktop's, in the newest release too.

On magpie, Desktop runs in its 3p mode, whose window is its bundled UI.
Read from Desktop 4.23118.0 (darwin RELEASES.json currentRelease,
published 11-05, downloaded and unpacked, not run):
- Resources/ion-dist.asar's i18n has en-US de-DE fr-FR ko-KR ja-JP es-419
  es-ES it-IT hi-IN pt-BR id-ID, no zh. Its supported list in
  assets/v1/shared-99 and shared-67 is the same 11, and the window maps
  navigator.languages onto them, else en-US, then calls
  electronIntl.requestLocaleChange with that pick on mount.
- app.asar's resources/frame/shell/i18n/frame-shell has the same 11.
- app.asar's resources/i18n has zh-Hans and zh-Hant, for the signed-in
  (claude.ai) window only. So disconnecting brings Chinese back.
magpie carries the signed-in "locale" into Claude-3p/config.json
(desktopCarryLocale), but Desktop writes its own pick over it at every
start. Nothing magpie can write keeps Chinese there, and magpie doesn't
patch Anthropic's signed app. Chinese readers are told so on the
Agents row and in the switch-on notice since v0.1.2123 (4b4c4a806).

Changed: desktopCarryLocale's comment and docs/subsystems/agent-wiring.md
name 4.23118.0 among the versions read.

Run: gofmt -l internal/agent/claudedesktop.go clean. Comment and doc
only, so no build, test or tag.
Not tried: starting a real Desktop 4.23118.0 in 3p mode; the mechanism
is from its shipped code. Windows' 4.23118.0 bundle not read.

Reported-by: xwoffice (Discord)
This commit is contained in:
yetone
2026-11-06 16:35:54 +08:00
parent 978284dd69
commit b020ae1022
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ something else shows up as drift.
- Claude Desktop's tiers also write magpie's profile's `inferenceModels` (`desktopSyncModels` in [`claudedesktop_models.go`](../../internal/agent/claudedesktop_models.go)), the list `gateway.DesktopInferenceModels` gives (see [gateway routing](gateway-routing.md)): on a tier's `Set`, as Desktop comes on magpie, and on the agent's `Sync`, so a provider saved or removed reaches it through `SyncCatalog`. Desktop 4.4212 reads no `/v1/models` while such a list has no bare tier word as a name (`adminListObviatesDiscovery` in its app.asar) and names an entry by its `labelOverride`, else its catalog's name, else the id, so every entry carries the `display_name` `/v1/models` gives its row as `labelOverride`; without it every `mythos-magpie-<number>` read as that id once a tier was picked (chengming0v0 on Discord, `TestDesktopInferenceModelsNamed`), and a catalog-named Claude model reads as that name too ("Opus 5.5 · <provider>") while the list is written. It is written through temp-and-rename and only when it changed, and taken away when no tier is picked. The list is magpie's only while its hash is one magpie recorded (`desktopModelsMark` in the stash, the next hash recorded before each write); any other list, the user's own or one carried from their own gateway profile, is never written over or taken away. A pick that runs as a Claude model (`behavesAs`) is told its own window in Claude Code's `modelSettings` (`claudeBudget.behaves`), since Claude Code would otherwise run it at that Claude model's. Desktop reads the list as it starts. Not tried against a real Desktop 4.29 or later; a Desktop below 2 (no mythos word) is given the mythos ids `/v1/models` gives 2 and up. `TestClaudeDesktopModelsList`.
- Claude Desktop's "subagent effort" (`desktopSubagentEffortField`, `settings.DesktopSubagentEffort`) is also Quiet and Live. Default keeps the effort the request asks for, including disabled thinking; it never selects a new default. A picked level works independently of the subagent model: no model pick, the same model and an unavailable model pick all still take the effort. While wired, the field offers the selected model's levels, or the standard levels when its model is inherited or unavailable; a model marked reasonless offers none. The stored pick survives model changes. A disconnected preference can be saved or cleared without connecting Desktop or showing restart advice, so profile restoration and Disconnect can restore a value saved before connecting; reconnect returns to the last live pick. `subEffortTitle` gives Desktop the Claude Code default explanation; Codex's default meaning is unchanged. The gateway fits each attempt to its actual model and preserves fixed group-member efforts (see [gateway routing](gateway-routing.md)).
- Claude Desktop picks its userData in its main process before any window opens: while a 3p configuration is applied and `deploymentMode` isn't `"1p"`, it is `Claude-3p` (Desktop 2.7032's `index.pre.js`, `app.setPath("userData", …-3p)`). So turning Desktop onto magpie shows none of the chats, projects and Code sessions of the Anthropic sign-in, which stay in `Claude` (xgddm88 on X: 之前的工程和会话记录全没了). magpie writes nothing in `Claude` but `deploymentMode` in its `claude_desktop_config.json`, and reads its `config.json` for the language; Off brings that history back. A row not yet connected says so before it is turned on (`CONNECT_BEFORE` in `app.js`), the opened row once it is on (`CONNECT_COST`), and the notice after each change (`noticeClaudedesktop3`, `noticeClaudedesktop4`; `TestClaudeDesktopKeepsTheSignedInHistory`, `desktop-history.test.cjs`). Opus beside the gateway's other models in that mode comes from a Claude subscription added in magpie. With `disableDeploymentModeChooser` unset Desktop's login screen would offer Claude.ai sign-in too; magpie still seeds it (as CC Switch does), so the way back is Off. The drift check asks Desktop's own question (`desktop3p`, `m4` in 4.4212's and 2.7032's `index.pre.js`): Desktop is off magpie only when Claude-3p's `deploymentMode` is `"1p"` and the applied profile leaves the chooser on. The `Claude` folder's `deploymentMode` isn't read, and Desktop 4.4212 deletes Claude-3p's itself (a stored `"1p"` with no claude.ai sign-in is dropped at start, `deploymentMode written { mode: undefined }`), so a missing one is still magpie (dev_quj on X; `TestClaudeDesktopModeAsDesktopReadsIt`).
- Claude Desktop's 3p mode runs in a userData of its own (`Claude-3p`), whose `config.json` (Desktop's own settings, not `claude_desktop_config.json`) starts with no `locale`, so Desktop on magpie came up in the system's language rather than the one picked signed in with Anthropic (memory and Osal on Discord). Turning Desktop onto magpie copies that one key, `locale`, from the signed-in userData's `config.json` (`Claude`, `%APPDATA%\Claude` on Windows, the first set's before the others) into `Claude-3p/config.json` when that file is missing or a JSON object without one (`desktopCarryLocale` in [`claudedesktop.go`](../../internal/agent/claudedesktop.go)); only a name Desktop takes for a catalog is carried. A `locale` already in `Claude-3p`, Desktop's or set by hand, is never written over, and no other key of that file is ever written. Off removes the file only when magpie made it and it still holds nothing but the language carried (`TestClaudeDesktopCarriesTheLanguage`, `TestClaudeDesktopKeepsThe3pLanguage`, `TestClaudeDesktopUserEditsThenReapply`). Desktop shows the language only where its 3p window has that catalog: the window is Desktop's bundled UI (`Resources/ion-dist`, 11 catalogs and no Chinese in 2.7032, 2.9939, 3.6556.2 and 4.4212.0 (packed as `Resources/ion-dist.asar` there), while 3.6556.2's main process has `zh-Hans` and `zh-Hant` for the signed-in window). On every start that window asks the main process for its own pick (`requestLocaleChange`: its localStorage, else `navigator.languages` mapped onto its 11, else `en-US`), and the main process writes it into `Claude-3p/config.json`. So a Chinese `locale` there, carried or set by hand, is `en-US` again after each start, written by Desktop and not by magpie (Dx25 on Discord, Windows); nothing magpie writes can keep it. So the GUI says it to a Chinese reader: Claude Desktop's opened row on Agents has a line that Desktop on magpie is Anthropic's gateway window, with no Chinese, and that its Chinese comes back once disconnected, and the switch-on notice says the same in Chinese (GZXYMH on X, `desktop-lang.test.cjs`).
- Claude Desktop's 3p mode runs in a userData of its own (`Claude-3p`), whose `config.json` (Desktop's own settings, not `claude_desktop_config.json`) starts with no `locale`, so Desktop on magpie came up in the system's language rather than the one picked signed in with Anthropic (memory and Osal on Discord). Turning Desktop onto magpie copies that one key, `locale`, from the signed-in userData's `config.json` (`Claude`, `%APPDATA%\Claude` on Windows, the first set's before the others) into `Claude-3p/config.json` when that file is missing or a JSON object without one (`desktopCarryLocale` in [`claudedesktop.go`](../../internal/agent/claudedesktop.go)); only a name Desktop takes for a catalog is carried. A `locale` already in `Claude-3p`, Desktop's or set by hand, is never written over, and no other key of that file is ever written. Off removes the file only when magpie made it and it still holds nothing but the language carried (`TestClaudeDesktopCarriesTheLanguage`, `TestClaudeDesktopKeepsThe3pLanguage`, `TestClaudeDesktopUserEditsThenReapply`). Desktop shows the language only where its 3p window has that catalog: the window is Desktop's bundled UI (`Resources/ion-dist`, 11 catalogs and no Chinese in 2.7032, 2.9939, 3.6556.2, 4.4212.0 and 4.23118.0 (11-05; packed as `Resources/ion-dist.asar` from 4.4212.0; 4.23118.0's `frame-shell` catalogs in `app.asar` are the same 11), while 3.6556.2's main process has `zh-Hans` and `zh-Hant` for the signed-in window). On every start that window asks the main process for its own pick (`requestLocaleChange`: its localStorage, else `navigator.languages` mapped onto its 11, else `en-US`), and the main process writes it into `Claude-3p/config.json`. So a Chinese `locale` there, carried or set by hand, is `en-US` again after each start, written by Desktop and not by magpie (Dx25 on Discord, Windows); nothing magpie writes can keep it. So the GUI says it to a Chinese reader: Claude Desktop's opened row on Agents has a line that Desktop on magpie is Anthropic's gateway window, with no Chinese, and that its Chinese comes back once disconnected, and the switch-on notice says the same in Chinese (GZXYMH on X, `desktop-lang.test.cjs`).
- Claude Desktop's sessions (Code and Cowork, `claude-code-sessions` and `local-agent-mode-sessions`) are kept in the userData Desktop runs in, keyed by account and organization (the claude.ai login signed in; in 3p the install id in `ant-did` and the profile's organization, both stable). So on magpie, in `Claude-3p`, the sessions made signed in with Anthropic are out of sight but untouched in `Claude`, and they show again when Desktop is switched back (lambdua on X: "切换账号,对话都不见"); claude.ai chats live on Anthropic's servers and 3p never shows them. magpie never writes or removes a session. Desktop imports them itself (Settings → Import: the signed-in userData, `~/.claude/projects`, other `Claude*` folders), copying under new ids and leaving the originals, but in 3p only when the profile's policy `claudeAiImport.enabled` is true (off by default, 3p only, from 1.28929.0). magpie's profile gets `"claudeAiImport":{"enabled":true,"bannerBehavior":"detect"}` once per folder set (`desktopSeedImport`, marked in the stash as `claude-desktop.import`): on the switch on and, for a Desktop already on magpie, from `Sync` at magpie's start. A `claudeAiImport` already there is kept, and one the user removes is not written again (`TestClaudeDesktopOffersItsSessionImport`).
- Claude Desktop's 3p mode reads its MCP servers (Settings → Developer, its connector list) from `Claude-3p/claude_desktop_config.json`, a file of its own, so on magpie the servers the user added signed in with Anthropic, in `Claude/claude_desktop_config.json`, were gone from the list (aa86222 on Discord: connectors didn't sync). Turning Desktop onto magpie copies each of those `mcpServers` entries that `Claude-3p` has none of the same name for (`desktopCarryMCP` in [`claudedesktop.go`](../../internal/agent/claudedesktop.go)); one of that name already there, the user's or the Library's (which writes both files), stays. `Sync` does it once for a Desktop already on magpie (`claude-desktop.mcp-seen`), so a server the user takes out in 3p isn't brought back. What was copied is stashed (`claude-desktop.mcp`), and off takes back each one still as copied; one the user changed since stays (`TestClaudeDesktopCarriesTheMCPServers`, `TestClaudeDesktopMCPKeepsThe3pServers`, `TestClaudeDesktopSyncCarriesTheMCPServersOnce`). Claude's file is never written. A claude.ai account's connectors can't come along: Desktop calls them through claude.ai with that account (`/api/organizations/<org>/mcp/servers/<id>/tools/call`, refused with `no_active_org` without one, Desktop 2.7032), and 3p mode has no account; Anthropic's docs say "Made by Anthropic" connectors are only in standard Desktop, and others reach 3p through `managedMcpServers` or plugins (claude.com/docs/third-party/claude-desktop/extensions).
- Claude Desktop names a Claude model with reasoning levels after its own catalog ("Opus 5.5"), not by the `display_name` magpie lists, because magpie lists it as `magpie-<number>.anthropic.<model>` to keep its effort picker (`claudeLooking` in [`desktop.go`](../../internal/gateway/desktop.go)). Desktop 4.4212 labels a picker row by its catalog's name before `display_name` (only an admin's `inferenceModels` list carries the `labelOverride` that beats it; magpie writes one, with each row's `display_name`, only while a tier is picked), so two providers' rows of one model read alike and Desktop adds the tail of the id, "Opus 5.5 (…7922287072.anthropic.claude-opus-5-5)". Desktop shows the gateway's `description` under the name, before the catalog's, so such a row's description names its provider when the Provider in model names setting puts it after the name (`desktopSaidBy`: on, every one; off, only two of one name), and a 1M row listed by its `[1m]` id says "1M context window · <provider>" (4 v5 on Discord, `TestClaudeDesktopCatalogNamedSaysProvider`). The id stays as it was. The provider editor shows the number too on the model's chip (`gateway.DesktopNumber`, `desktopNumbers` in [`providers.go`](../../internal/gui/providers.go), #2578). The chip shows it only while Claude Desktop is installed and is shown that model. Every other model Desktop is shown carries no number on the chip: Desktop names it by `display_name`, which already says the provider, or by its own id.
+1 -1
View File
@@ -887,7 +887,7 @@ func desktopLocaleFrom(ps []desktopPaths) string {
//
// It holds only for a language Desktop's 3p window has. That window is
// its bundled UI (Resources/ion-dist), with 11 catalogs and no Chinese up
// to 3.6556.2 at least; on every start it asks the main process for its
// to 4.23118.0 at least; on every start it asks the main process for its
// own pick (requestLocaleChange: its localStorage, else navigator.languages
// mapped onto those 11, else en-US), and the main process writes that into
// Claude-3p/config.json. So a Chinese "locale" there, carried or set by