Skip to content

Commit 3ab1726

Browse files
RomneyDasteipete
andauthored
fix(update): preserve explicit plugin capability consent (#131301)
* fix(update): preserve explicit plugin capability consent * fix(update): bind plugin consent to staged artifacts Use the canonical artifact consent adapter for channel migrations and preserve explicit consent through the update wizard. Keep prior usable payloads on denial and record the exact accepted surface through the existing install-record owner. Cover parser boundaries, staged artifact changes, and packaged update/repair handoffs without treating --yes as consent or granting future permission. Co-authored-by: Dallin Romney <[email protected]> * test(update): register consent scenario with probe Route the packaged consent scenario through the existing plugin-update probe so Knip discovers the implementation through its normal entry graph. Initialize scenario state only when the consent command runs, preserving other probe modes. Co-authored-by: Dallin Romney <[email protected]> * fix(update): retain consent with compatible finalizers Inspect the installed update command before forwarding explicit consent so older and same-version target CLIs keep finalization in the existing parent path when they lack the option. Preserve the installed compatibility host through plugin convergence and reuse the update step timeout for inspection. Use built-in streaming SHA256 for the packaged proof rather than requiring an undeclared checksum binary. Co-authored-by: Dallin Romney <[email protected]> * fix(update): keep convergence code loaded across replacement Link the mandatory registry repair before the core package swap removes the old updater's chunks. This keeps current-process finalization runnable when the installed target cannot receive explicit capability consent, without retaining old runtime files or changing plugin policy. Co-authored-by: Dallin Romney <[email protected]> * test(cli): await MCP Doctor batch readiness Synchronize the concurrency test at the fourth credential check instead of polling command startup with a wall-clock deadline. Release blocked checks and await Doctor in finally, including early command or assertion failures. Keep the exact concurrency, total-check and sorted-result assertions. Co-authored-by: Dallin Romney <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Dallin Romney <[email protected]>
1 parent 117078f commit 3ab1726

18 files changed

Lines changed: 962 additions & 113 deletions

‎docs/cli/update.md‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ openclaw update --tag beta
2929
openclaw update --dry-run
3030
openclaw update --no-restart
3131
openclaw update --yes
32+
openclaw update --accept-capabilities
3233
openclaw update --json
3334
openclaw --update
3435
```
@@ -47,6 +48,7 @@ launcher scripts).
4748
| `--json` | Print machine-readable `UpdateRunResult` JSON. Includes `postUpdate.plugins.warnings` when a managed plugin needs repair, beta-channel plugin fallback details, and `postUpdate.plugins.integrityDrifts` when npm plugin artifact drift is detected during post-update sync. |
4849
| `--timeout <seconds>` | Per-step timeout. Default `1800`. |
4950
| `--yes` | Skip confirmation prompts (for example downgrade confirmation). |
51+
| `--accept-capabilities` | Accept each plugin's reviewed capability changes during post-update sync. This acknowledges the exact staged capability surface; it does not disable capability checks or establish future trust. |
5052

5153
There is no `--verbose` flag. Use `--dry-run` to preview planned actions,
5254
`--json` for machine-readable results, and `openclaw update status --json`
@@ -99,6 +101,7 @@ converge.
99101
openclaw update repair
100102
openclaw update repair --channel beta
101103
openclaw update repair --json
104+
openclaw update repair --accept-capabilities
102105
```
103106

104107
| Flag | Description |
@@ -107,6 +110,7 @@ openclaw update repair --json
107110
| `--json` | Print machine-readable finalization JSON. |
108111
| `--timeout <seconds>` | Timeout for repair steps. Default `1800`. |
109112
| `--yes` | Skip confirmation prompts. |
113+
| `--accept-capabilities` | Accept each plugin's reviewed capability changes while repairing plugin state. |
110114
| `--no-restart` | Accepted for parity; repair never restarts the Gateway. |
111115

112116
`update repair` runs `openclaw doctor --fix`, reloads the repaired config and
@@ -119,15 +123,28 @@ With `--json`, stdout contains one JSON document. Doctor panels and other
119123
diagnostics go to stderr, so stdout can be parsed directly. Failed doctor or
120124
plugin finalization steps still exit non-zero.
121125

126+
Plugin artifacts that require capability consent are not installed without an
127+
interactive review or explicit `--accept-capabilities`. `--yes` alone does not
128+
accept capability changes, and JSON mode does not prompt. A denied update can
129+
preserve the previous usable plugin and finish with a warning; an unresolved
130+
missing or invalid active payload can still fail finalization.
131+
132+
If the core package has already changed, run `openclaw update repair` in an
133+
interactive terminal to review plugin capabilities. After reviewing the changes,
134+
automation can use `openclaw update repair --accept-capabilities`. Acceptance
135+
applies to each artifact's recomputed declared surface during this invocation;
136+
it does not approve future capability additions.
137+
122138
## `update wizard`
123139

124140
Interactive flow to pick an update channel and confirm whether to restart the
125141
Gateway afterward (defaults to restart). Selecting `dev` without a git
126142
checkout offers to create one.
127143

128-
| Flag | Default | Description |
129-
| --------------------- | ------- | ----------------------------- |
130-
| `--timeout <seconds>` | `1800` | Timeout for each update step. |
144+
| Flag | Default | Description |
145+
| ----------------------- | ------- | ------------------------------------------------------------ |
146+
| `--timeout <seconds>` | `1800` | Timeout for each update step. |
147+
| `--accept-capabilities` | `false` | Accept reviewed plugin capability changes during the update. |
131148

132149
## What it does
133150

0 commit comments

Comments
 (0)