Skip to content

fix(memory): require privileged dreaming config changes#97869

Merged
eleqtrizit merged 2 commits into
openclaw:mainfrom
eleqtrizit:788
Jun 29, 2026
Merged

fix(memory): require privileged dreaming config changes#97869
eleqtrizit merged 2 commits into
openclaw:mainfrom
eleqtrizit:788

Conversation

@eleqtrizit

@eleqtrizit eleqtrizit commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Tightens Memory Core /dreaming on|off so persistent dreaming configuration changes require a privileged caller.

Changes

  • Opts the bundled Memory Core /dreaming command into trusted owner-status exposure.
  • Requires owner status for channel callers, or operator.admin for gateway clients, before mutating dreaming config.
  • Keeps /dreaming status and help/phase output readable without mutating config.
  • Adds regression coverage for non-owner denial, owner success, gateway write-scope denial, gateway admin success, and command registration owner exposure.

Validation

  • node scripts/run-vitest.mjs extensions/memory-core/src/dreaming-command.test.ts extensions/memory-core/index.test.ts
  • git diff --check
  • .agents/skills/autoreview/scripts/autoreview --mode local

@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-core Extension: memory-core size: S maintainer Maintainer-authored PR labels Jun 29, 2026
@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 1:14 PM ET / 17:14 UTC.

Summary
The branch gates Memory Core /dreaming on|off config writes behind channel owner status or Gateway operator.admin, adds regression tests, and documents the privilege requirement.

PR surface: Source +14, Tests +19, Docs +7. Total +40 across 7 files.

Reproducibility: yes. from source inspection: current main only blocks Gateway callers when gatewayClientScopes lacks operator.admin, while channel contexts with no scope array can reach mutateConfigFile. I did not run a live current-main repro in this read-only review.

Review metrics: 2 noteworthy metrics.

  • Config Mutation Authorization: 1 command tightened. /dreaming on|off changes who may persist plugins.entries.memory-core.config.dreaming.enabled, which is compatibility-sensitive before merge.
  • Owner Status Exposure: 1 bundled command opted in. /dreaming starts receiving trusted owner status, so maintainers should notice the command-contract exposure even though it is bundled-only.

Stored data model
Persistent data-model change detected: unknown-data-model-change: extensions/memory-core/src/dreaming-command.test.ts, vector/embedding metadata: extensions/memory-core/index.ts, vector/embedding metadata: extensions/memory-core/src/dreaming-command.test.ts, vector/embedding metadata: extensions/memory-core/src/dreaming-command.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Maintainers should explicitly accept the owner/admin hardening compatibility impact before merge.

Risk before merge

  • [P1] Merging intentionally changes existing allowlisted non-owner channel /dreaming on|off behavior from permitted persistent config mutation to denial, so maintainers need to accept the upgrade impact.

Maintainer options:

  1. Accept Owner/Admin Hardening (recommended)
    Maintainers can land this once they accept that allowlisted non-owner channel callers will no longer be able to persist /dreaming on|off changes.
  2. Preserve A Shipped Non-Owner Workflow
    If non-owner chat toggles are considered a shipped workflow, revise the patch to keep that path and make the stricter rule explicit or opt-in.
  3. Pause For Shared Command Policy
    If this rule should apply broadly to config-mutating plugin commands, pause this PR and route a shared command-authorization design first.

Next step before merge

  • [P2] The protected maintainer label and intentional compatibility-sensitive authorization change require maintainer acceptance; there is no narrow automated repair remaining.

Security
Cleared: Cleared: the diff tightens an existing config-mutation authorization boundary and does not add dependencies, generated code, secret handling, workflow changes, or supply-chain surface.

Review details

Best possible solution:

Land the owner/admin hardening only after maintainers explicitly accept the compatibility impact for non-owner channel callers and the normal merge gates finish.

Do we have a high-confidence way to reproduce the issue?

Yes, from source inspection: current main only blocks Gateway callers when gatewayClientScopes lacks operator.admin, while channel contexts with no scope array can reach mutateConfigFile. I did not run a live current-main repro in this read-only review.

Is this the best way to solve the issue?

Yes with maintainer acceptance: using the existing trusted exposeSenderIsOwner path plus Gateway admin scopes is narrow and matches the Phone Control owner/admin mutation pattern. The remaining question is upgrade policy, not code shape.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6de357ad4772.

Label changes

Label justifications:

  • P2: This is normal-priority Memory Core authorization hardening with limited blast radius around one config-mutating command.
  • merge-risk: 🚨 compatibility: Merging changes existing allowlisted non-owner channel behavior from permitted persistent /dreaming on|off mutation to denial.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Sufficient live output: the contributor posted loopback Gateway WebSocket proof showing write-scoped denial without config mutation and admin success with persisted config mutation after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient live output: the contributor posted loopback Gateway WebSocket proof showing write-scoped denial without config mutation and admin success with persisted config mutation after the fix.
Evidence reviewed

PR surface:

Source +14, Tests +19, Docs +7. Total +40 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 18 4 +14
Tests 2 25 6 +19
Docs 3 15 8 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 58 18 +40

What I checked:

  • Repository policy applied: Root policy was read fully; it treats stricter validation, fail-closed changes, and config/default/operator impacts as compatibility-sensitive PR review surfaces. (AGENTS.md:29, 6de357ad4772)
  • Scoped extension/docs policy applied: The touched plugin files sit under the bundled-plugin boundary, and the docs edits follow the docs guide's root-relative Mintlify link style. (extensions/AGENTS.md:25, 6de357ad4772)
  • Current main behavior: On current main, /dreaming on|off only rejects when gatewayClientScopes is an array lacking operator.admin; ordinary channel contexts without that array can reach mutateConfigFile. (extensions/memory-core/src/dreaming-command.ts:80, 6de357ad4772)
  • PR authorization change: At PR head, the mutation guard requires Gateway admin scope when scopes are present and otherwise requires senderIsOwner === true before writing the dreaming config. (extensions/memory-core/src/dreaming-command.ts:80, 54ff1f7357a6)
  • Trusted owner-status exposure: The PR opts only the bundled Memory Core /dreaming command into owner-status exposure; current registry code only forwards owner status for required-scope commands or trusted bundled opt-ins. (extensions/memory-core/index.ts:208, 54ff1f7357a6)
  • Command dispatch contract: The core command executor forwards senderIsOwner only through canExposeSenderIsOwner, and the registry marks bundled opt-ins as trusted owner-status exposure. (src/plugins/commands.ts:310, 6de357ad4772)

Likely related people:

  • mbelinky: Commit 6af17b39e11f added the earlier operator.admin requirement for persistent Gateway /dreaming on|off calls on this same command path. (role: introduced prior gateway admin gate; confidence: high; commits: 6af17b39e11f; files: extensions/memory-core/src/dreaming-command.ts, extensions/memory-core/src/dreaming-command.test.ts)
  • vignesh07: Commit 4c1022c73b39 introduced the Memory Core dreaming promotion flow, /dreaming command, tests, and initial docs. (role: original dreaming command feature owner; confidence: high; commits: 4c1022c73b39; files: extensions/memory-core/src/dreaming-command.ts, extensions/memory-core/index.ts, docs/cli/memory.md)
  • vincentkoc: Recent history includes dreaming docs, config-shape, and rename work adjacent to the docs and Memory Core surfaces touched by this PR. (role: recent dreaming docs and memory-core contributor; confidence: medium; commits: 8ff41a6bc4ae, a1c159874204, aa69b12d0086; files: docs/concepts/dreaming.md, docs/cli/memory.md, extensions/memory-core/src/dreaming-command.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 29, 2026
Explain that persistent dreaming toggles require channel owner status or Gateway admin scope, while status and help remain read-only.
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Jun 29, 2026
@eleqtrizit

eleqtrizit commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Behavioral proof at head 54ff1f7357a66 from an isolated loopback Gateway using real WebSocket chat.send calls and separately scoped, paired clients.

The Gateway loaded the bundled Memory Core plugin and started normally. The initial persisted value was:

plugins.entries.memory-core.config.dreaming.enabled = true

Write-scoped client (operator.write):

> /dreaming off
< ⚠️ /dreaming on|off requires owner status for channel callers or operator.admin for gateway clients.

plugins.entries.memory-core.config.dreaming.enabled = true

The denial came from the assistant entry in chat.history; the persisted setting stayed true, proving the rejected command did not mutate config.

Admin-scoped client (operator.admin):

> /dreaming off
< Dreaming disabled.
< Dreaming status:
< - enabled: off

plugins.entries.memory-core.config.dreaming.enabled = false

The success came from the assistant entry in chat.history; the persisted setting changed to false, proving the permitted command reached the real config-write path.

This setup exercised Gateway startup, bundled-plugin discovery, command registration, WebSocket scope propagation, central slash-command dispatch, Memory Core authorization, transcript persistence, and config persistence together. It did not call the command handler directly or mock mutateConfigFile.

Documentation now states the privilege contract in:

  • docs/concepts/dreaming.md
  • docs/cli/memory.md
  • docs/tools/slash-commands.md

Additional regression validation:

node scripts/run-vitest.mjs extensions/memory-core/src/dreaming-command.test.ts extensions/memory-core/index.test.ts

Test Files  2 passed (2)
Tests       23 passed (23)
pnpm exec oxfmt --check docs/cli/memory.md docs/concepts/dreaming.md docs/tools/slash-commands.md
All matched files use the correct format.

git diff --check
Passed with no output.

@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 29, 2026
@eleqtrizit
eleqtrizit merged commit 29f787f into openclaw:main Jun 29, 2026
128 of 135 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 30, 2026
* fix(memory): gate dreaming config changes

* fix(memory): document dreaming privilege gate

Explain that persistent dreaming toggles require channel owner status or Gateway admin scope, while status and help remain read-only.
@eleqtrizit
eleqtrizit deleted the 788 branch June 30, 2026 19:27
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
* fix(memory): gate dreaming config changes

* fix(memory): document dreaming privilege gate

Explain that persistent dreaming toggles require channel owner status or Gateway admin scope, while status and help remain read-only.
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
* fix(memory): gate dreaming config changes

* fix(memory): document dreaming privilege gate

Explain that persistent dreaming toggles require channel owner status or Gateway admin scope, while status and help remain read-only.
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
* fix(memory): gate dreaming config changes

* fix(memory): document dreaming privilege gate

Explain that persistent dreaming toggles require channel owner status or Gateway admin scope, while status and help remain read-only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant