feat(clawhub): use domestic mirror registry for zh language users#751
feat(clawhub): use domestic mirror registry for zh language users#751
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 091025e5b6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
electron/gateway/clawhub.ts
Outdated
| env.ELECTRON_RUN_AS_NODE = '1'; | ||
| } | ||
| if (language?.startsWith('zh')) { | ||
| env.CLAWHUB_REGISTRY = 'http://mirror-cn.clawhub.com'; |
There was a problem hiding this comment.
Use HTTPS for mirror registry override
The new CLAWHUB_REGISTRY override points to http://mirror-cn.clawhub.com, which forces Chinese-language users onto cleartext transport for registry access. Because this service is used to search/install skills, an on-path attacker can tamper with registry responses or downloaded artifacts in transit, which is a production security regression introduced by this commit. Please switch to an HTTPS mirror URL (or avoid overriding when TLS is unavailable).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9756d763e9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
electron/gateway/clawhub.ts
Outdated
| if (language?.startsWith('zh')) { | ||
| env.CLAWHUB_REGISTRY = 'https://mirror-cn.clawhub.com'; |
There was a problem hiding this comment.
Preserve explicit CLAWHUB_REGISTRY overrides
Because env is initialized from process.env, an existing CLAWHUB_REGISTRY value is currently an explicit user/operator override; this change unconditionally replaces it for any zh* language. In deployments that set a private/internal registry (or a different reachable mirror), Chinese-language users will now fail to use that configured endpoint, which is a behavior regression from prior versions. Only applying the mirror when CLAWHUB_REGISTRY is unset would keep the locale default without breaking intentional overrides.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f1c2cd5ab
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
electron/gateway/clawhub.ts
Outdated
| if (language?.startsWith('zh')) { | ||
| env.CLAWHUB_REGISTRY = 'https://mirror-cn.clawhub.com'; |
There was a problem hiding this comment.
Preserve configured CLAWHUB_REGISTRY overrides
This unconditionally rewrites CLAWHUB_REGISTRY for any zh* UI language, even when operators have already set process.env.CLAWHUB_REGISTRY to a private or reachable registry endpoint. In deployments that rely on an explicit registry override, Chinese-language users will now be forced to the mirror and can lose access to skill search/install; gate this assignment so it only applies when no explicit registry is configured.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6439abcf0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const env: Record<string, string | undefined> = { | ||
| ...baseEnv, | ||
| CI: 'true', | ||
| FORCE_COLOR: '0', |
There was a problem hiding this comment.
Apply zh mirror registry before spawning ClawHub CLI
The feature in this commit is not actually implemented in runtime code: runCommand still builds the child process environment with only baseline vars and CLAWHUB_WORKDIR, but never sets CLAWHUB_REGISTRY based on the UI language. That means zh users continue to use the default registry, and the newly added tests/unit/clawhub-registry.test.ts expectations cannot pass because spawn receives no registry override for zh* locales.
Useful? React with 👍 / 👎.
No description provided.