feat: add npm registry config for openclaw#12300
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98c0e3e47e
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| func setOpenclawNPMRegistry(containerName, registry string) error { | ||
| return cmd.RunDefaultBashCf("docker exec %s npm set registry %q", containerName, registry) |
There was a problem hiding this comment.
Persist the registry in host-backed config
setOpenclawNPMRegistry only runs docker exec ... npm set registry. npm's own docs/CLI default npm set to the user config file, so this writes inside the container's $HOME/.npmrc rather than into the app's persisted files. Because setOtherConfig still only saves timezone/browser to openclaw.json (agent/app/service/agents_utils.go:297-312) and rebuildApp recreates the container with compose.Down()/compose.Up() (agent/app/service/app_utils.go:1255-1265), any rebuild/upgrade/restore drops the custom mirror and plugin installs silently fall back to npmjs.
Useful? React with 👍 / 👎.
| if err := writeOpenclawConfigRaw(agent.ConfigPath, conf); err != nil { | ||
| return err | ||
| } | ||
| return nil | ||
| return setOpenclawNPMRegistry(install.ContainerName, req.NPMRegistry) |
There was a problem hiding this comment.
Don't make other settings depend on a running container
UpdateOtherConfig now writes openclaw.json and then immediately returns docker exec ... npm set registry. Docker documents exec as operating on a running container, so if the OpenClaw container is stopped, this endpoint now fails after the file has already been updated. In that state users can't reliably change timezone/browser settings anymore, and the API reports an error even though it has partially applied the change on disk.
Useful? React with 👍 / 👎.
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wanghe-fit2cloud The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.