config: stop automatic writes and guard Nix mutators (#78047) · openclaw/openclaw@d4b4660
joshp123
·
2026-05-06
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -110,6 +110,7 @@ Docs: https://docs.openclaw.ai
|
110 | 110 | - Managed proxy: add `proxy.loopbackMode` for Gateway loopback control-plane traffic, allowing operators to keep the default Gateway loopback bypass, force loopback Gateway traffic through the proxy, or block it. (#77018) Thanks @jesse-merhi. |
111 | 111 | - Telegram/native commands: show the current thinking level above the `/think` level picker so users can see the active setting before changing it. (#78278) Thanks @obviyus. |
112 | 112 | - Plugins/hooks: add a `before_agent_run` pass/block gate that can stop a user prompt before model submission while preserving a redacted transcript entry for the user, and clarify that raw conversation hooks require `hooks.allowConversationAccess=true`. (#75035) Thanks @jesse-merhi. |
| 113 | +- Config/Nix: keep startup-derived plugin enablement, gateway auth tokens, control UI origins, and owner-display secrets runtime-only instead of rewriting `openclaw.json`; in Nix mode, config writers, mutating `openclaw update`, plugin lifecycle mutators, and doctor repair/token-generation now refuse with agent-first nix-openclaw guidance. (#78047) Thanks @joshp123. |
113 | 114 | |
114 | 115 | ### Fixes |
115 | 116 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -662,7 +662,7 @@ Default slash command settings:
|
662 | 662 | </Accordion> |
663 | 663 | |
664 | 664 | <Accordion title="Live stream preview"> |
665 | | -OpenClaw can stream draft replies by sending a temporary message and editing it as text arrives. `channels.discord.streaming` takes `off` (default) | `partial` | `block` | `progress`. `progress` keeps one editable status draft and updates it with tool progress until final delivery; `streamMode` is a legacy alias and is auto-migrated. |
| 665 | +OpenClaw can stream draft replies by sending a temporary message and editing it as text arrives. `channels.discord.streaming` takes `off` (default) | `partial` | `block` | `progress`. `progress` keeps one editable status draft and updates it with tool progress until final delivery; `streamMode` is a legacy runtime alias. Run `openclaw doctor --fix` to rewrite persisted config to the canonical key. |
666 | 666 | |
667 | 667 | Default stays `off` because Discord preview edits hit rate limits quickly when multiple bots or gateways share an account. |
668 | 668 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1020,9 +1020,10 @@ Use draft preview instead of Slack native text streaming:
|
1020 | 1020 | |
1021 | 1021 | Legacy keys: |
1022 | 1022 | |
1023 | | -- `channels.slack.streamMode` (`replace | status_final | append`) is auto-migrated to `channels.slack.streaming.mode`. |
1024 | | -- boolean `channels.slack.streaming` is auto-migrated to `channels.slack.streaming.mode` and `channels.slack.streaming.nativeTransport`. |
1025 | | -- legacy `channels.slack.nativeStreaming` is auto-migrated to `channels.slack.streaming.nativeTransport`. |
| 1023 | +- `channels.slack.streamMode` (`replace | status_final | append`) is a legacy runtime alias for `channels.slack.streaming.mode`. |
| 1024 | +- boolean `channels.slack.streaming` is a legacy runtime alias for `channels.slack.streaming.mode` and `channels.slack.streaming.nativeTransport`. |
| 1025 | +- legacy `channels.slack.nativeStreaming` is a runtime alias for `channels.slack.streaming.nativeTransport`. |
| 1026 | +- Run `openclaw doctor --fix` to rewrite persisted Slack streaming config to the canonical keys. |
1026 | 1027 | |
1027 | 1028 | ## Typing reaction fallback |
1028 | 1029 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,6 +8,10 @@ sidebarTitle: "Config"
|
8 | 8 | |
9 | 9 | Config helpers for non-interactive edits in `openclaw.json`: get/set/patch/unset/file/schema/validate values by path and print the active config file. Run without a subcommand to open the configure wizard (same as `openclaw configure`). |
10 | 10 | |
| 11 | +<Note> |
| 12 | +When `OPENCLAW_NIX_MODE=1`, OpenClaw treats `openclaw.json` as immutable. Read-only commands such as `config get`, `config file`, `config schema`, and `config validate` still work, but config writers refuse. Agents should edit the Nix source for the install instead; for the first-party nix-openclaw distribution, use [nix-openclaw Quick Start](https://github.com/openclaw/nix-openclaw#quick-start) and set values under `programs.openclaw.config` or `instances.<name>.config`. |
| 13 | +</Note> |
| 14 | + |
11 | 15 | ## Root options |
12 | 16 | |
13 | 17 | <ParamField path="--section <section>" type="string"> |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -38,6 +38,7 @@ openclaw doctor --generate-gateway-token
|
38 | 38 | |
39 | 39 | Notes: |
40 | 40 | |
| 41 | +- In Nix mode (`OPENCLAW_NIX_MODE=1`), read-only doctor checks still work, but `doctor --fix`, `doctor --repair`, `doctor --yes`, and `doctor --generate-gateway-token` are disabled because `openclaw.json` is immutable. Edit the Nix source for this install instead; for nix-openclaw, use the agent-first [Quick Start](https://github.com/openclaw/nix-openclaw#quick-start). |
41 | 42 | - Interactive prompts (like keychain/OAuth fixes) only run when stdin is a TTY and `--non-interactive` is **not** set. Headless runs (cron, Telegram, no terminal) will skip prompts. |
42 | 43 | - Performance: non-interactive `doctor` runs skip eager plugin loading so headless health checks stay fast. Interactive sessions still fully load plugins when a check needs their contribution. |
43 | 44 | - `--fix` (alias for `--repair`) writes a backup to `~/.openclaw/openclaw.json.bak` and drops unknown config keys, listing each removal. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -59,6 +59,10 @@ For slow install, inspect, uninstall, or registry-refresh investigation, run the
|
59 | 59 | command with `OPENCLAW_PLUGIN_LIFECYCLE_TRACE=1`. The trace writes phase timings |
60 | 60 | to stderr and keeps JSON output parseable. See [Debugging](/help/debugging#plugin-lifecycle-trace). |
61 | 61 | |
| 62 | +<Note> |
| 63 | +In Nix mode (`OPENCLAW_NIX_MODE=1`), plugin lifecycle mutators are disabled. Use the Nix source for this install instead of `plugins install`, `plugins update`, `plugins uninstall`, `plugins enable`, or `plugins disable`; for nix-openclaw, use the agent-first [Quick Start](https://github.com/openclaw/nix-openclaw#quick-start). |
| 64 | +</Note> |
| 65 | + |
62 | 66 | <Note> |
63 | 67 | Bundled plugins ship with OpenClaw. Some are enabled by default (for example bundled model providers, bundled speech providers, and the bundled browser plugin); others require `plugins enable`. |
64 | 68 | |
@@ -293,7 +297,7 @@ Use `--pin` on npm installs to save the resolved exact spec (`name@version`) in
|
293 | 297 | |
294 | 298 | Plugin install metadata is machine-managed state, not user config. Installs and updates write it to `plugins/installs.json` under the active OpenClaw state directory. Its top-level `installRecords` map is the durable source of install metadata, including records for broken or missing plugin manifests. The `plugins` array is the manifest-derived cold registry cache. The file includes a do-not-edit warning and is used by `openclaw plugins update`, uninstall, diagnostics, and the cold plugin registry. |
295 | 299 | |
296 | | -When OpenClaw sees shipped legacy `plugins.installs` records in config, it moves them into the plugin index and removes the config key; if either write fails, the config records are kept so the install metadata is not lost. |
| 300 | +When OpenClaw sees shipped legacy `plugins.installs` records in config, runtime reads treat them as compatibility input without rewriting `openclaw.json`. Explicit plugin writes and `openclaw doctor --fix` move those records into the plugin index and remove the config key when config writes are allowed; if either write fails, the config records are kept so the install metadata is not lost. |
297 | 301 | |
298 | 302 | ### Uninstall |
299 | 303 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,6 +10,10 @@ title: "Setup"
|
10 | 10 | |
11 | 11 | Initialize `~/.openclaw/openclaw.json` and the agent workspace. |
12 | 12 | |
| 13 | +<Note> |
| 14 | +`openclaw setup` is for mutable config installs. In Nix mode (`OPENCLAW_NIX_MODE=1`), OpenClaw refuses setup writes because the config file is managed by Nix. Agents should use the first-party [nix-openclaw Quick Start](https://github.com/openclaw/nix-openclaw#quick-start) or the equivalent source config for another Nix package. |
| 15 | +</Note> |
| 16 | + |
13 | 17 | Related: |
14 | 18 | |
15 | 19 | - Getting started: [Getting started](/start/getting-started) |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -52,6 +52,10 @@ console verbosity and file log level are separate: Gateway `--verbose` affects
|
52 | 52 | terminal/WebSocket output, while file logs require `logging.level: "debug"` or |
53 | 53 | `"trace"` in config. See [Gateway logging](/gateway/logging). |
54 | 54 | |
| 55 | +<Note> |
| 56 | +In Nix mode (`OPENCLAW_NIX_MODE=1`), mutating `openclaw update` runs are disabled. Update the Nix source or flake input for this install instead; for nix-openclaw, use the agent-first [Quick Start](https://github.com/openclaw/nix-openclaw#quick-start). `openclaw update status` and `openclaw update --dry-run` remain read-only. |
| 57 | +</Note> |
| 58 | + |
55 | 59 | <Warning> |
56 | 60 | Downgrades require confirmation because older versions can break configuration. |
57 | 61 | </Warning> |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -152,8 +152,8 @@ Slack-only:
|
152 | 152 | Legacy key migration: |
153 | 153 | |
154 | 154 | - Telegram: legacy `streamMode` and scalar/boolean `streaming` values are detected and migrated by doctor/config compatibility paths to `streaming.mode`. |
155 | | -- Discord: `streamMode` + boolean `streaming` auto-migrate to `streaming` enum. |
156 | | -- Slack: `streamMode` auto-migrates to `streaming.mode`; boolean `streaming` auto-migrates to `streaming.mode` plus `streaming.nativeTransport`; legacy `nativeStreaming` auto-migrates to `streaming.nativeTransport`. |
| 155 | +- Discord: `streamMode` + boolean `streaming` remain runtime aliases for the `streaming` enum; run `openclaw doctor --fix` to rewrite persisted config. |
| 156 | +- Slack: `streamMode` remains a runtime alias for `streaming.mode`; boolean `streaming` remains a runtime alias for `streaming.mode` plus `streaming.nativeTransport`; legacy `nativeStreaming` remains a runtime alias for `streaming.nativeTransport`. Run `openclaw doctor --fix` to rewrite persisted config. |
157 | 157 | |
158 | 158 | ### Runtime behavior |
159 | 159 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1401,7 +1401,7 @@ Defaults for Talk mode (macOS/iOS/Android).
|
1401 | 1401 | ``` |
1402 | 1402 | |
1403 | 1403 | - `talk.provider` must match a key in `talk.providers` when multiple Talk providers are configured. |
1404 | | -- Legacy flat Talk keys (`talk.voiceId`, `talk.voiceAliases`, `talk.modelId`, `talk.outputFormat`, `talk.apiKey`) are compatibility-only and are auto-migrated into `talk.providers.<provider>`. |
| 1404 | +- Legacy flat Talk keys (`talk.voiceId`, `talk.voiceAliases`, `talk.modelId`, `talk.outputFormat`, `talk.apiKey`) are compatibility-only. Run `openclaw doctor --fix` to rewrite persisted config into `talk.providers.<provider>`. |
1405 | 1405 | - Voice IDs fall back to `ELEVENLABS_VOICE_ID` or `SAG_VOICE_ID`. |
1406 | 1406 | - `providers.*.apiKey` accepts plaintext strings or SecretRef objects. |
1407 | 1407 | - `ELEVENLABS_API_KEY` fallback applies only when no Talk API key is configured. |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。