Repository navigation
Description
Summary
During an OpenClaw release-validation run, an OCM-adopted disposable environment was upgraded to an exact beta runtime. The candidate did not remain confined to the adopted environment: it migrated the original source gateway's shared state database from schema 7 to schema 8.
The source gateway could no longer start on its original checkout after the validation attempt and required recovery. The OCM checkpoint available for rollback had been created after the migration, so it did not contain a recent schema-7 copy.
Environment
- Host: Windows 11 with Ubuntu WSL
- OCM:
0.2.32 - Source OpenClaw:
2026.8.1atf329a9489f32e6472ded5437be971609229c9451 - Candidate:
v2026.8.1-beta.2at8f382a202ff1e15833394b481615dcdda99b04d7 - Source: a real gateway state directory
- Target: an adopted OCM environment with a distinct environment name, state directory, and port
No credentials or user-specific paths are included here.
Sequence
- Inspect and import the real gateway into a disposable environment using the documented
ocm adopt inspect,ocm adopt plan, andocm adopt importflow. - Install and verify the exact candidate runtime.
- The adopted environment had
defaultRuntime=null, so set its runtime explicitly before continuing. - Run the candidate upgrade dry-run, upgrade, and start against the adopted environment.
- Observe that the isolated candidate reports the exact beta version but fails readiness.
- Inspect the source gateway after the failed validation run.
Expected behavior
- All candidate migrations and writes stay within the adopted environment's state directory.
- The source gateway's configuration, databases, and schema metadata remain byte-for-byte unchanged.
- A pre-upgrade checkpoint exists before any candidate migration and can restore the adopted copy independently of the source.
Actual behavior
-
The isolated candidate failed startup three consecutive times with:
Gateway failed to start: Cannot read properties of undefined (reading 'values') -
The original source gateway's state database was migrated from schema 7 to schema 8.
-
Its schema metadata recorded
app_version=2026.8.1-beta.2, even though the source gateway had not been intentionally upgraded. -
The source checkout supported schema 7 and could no longer restart against the migrated database.
-
The available OCM checkpoint was created after the migration and therefore did not provide a recent schema-7 recovery copy.
-
The exact retained path, link, or environment reference through which the candidate reached the source database has not yet been identified.
The release-facing startup failure was recorded in the shared validation ledger: openclaw/openclaw#125626 (comment)
Impact
This breaks the central safety guarantee of the release-validation workflow: a tester can follow the isolated-copy path and still mutate or disable the gateway they actively use. A failed beta upgrade can therefore affect data outside the disposable environment, while the resulting checkpoint may be too late to recover the pre-migration state.
Requested safeguards
- Resolve and verify all candidate-writable paths after adopt/import and before upgrade.
- Fail closed if any config include, symlink, workspace reference, database path, or resolved state path escapes the adopted environment or aliases the source gateway.
- Create and verify a pre-migration checkpoint before starting the candidate runtime.
- Ensure the checkpoint itself is independent of candidate-writable state.
- Add an integration test that upgrades an adopted copy and asserts that the source state tree and database schema hash remain unchanged.
- Surface the resolved source and target state roots in redacted diagnostic output so an isolation failure can be traced without exposing credentials.
The source gateway has since been recovered, but the isolation escape remains unexplained.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Aug 20, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed September 6, 2026, 5:24 AM ET / 09:24 UTC.
Summary
Keep open: current main retains the runtime-install environment leak, and the reporter has supplied a targeted reproduction and an open fixing PR. The newer evidence supersedes the earlier assessment that the write boundary was unidentified.
Reproducibility: yes. for the inherited-environment defect: current source exposes caller state paths to npm, and the linked PR supplies a targeted published-package reproduction. The exact current-main schema migration was not executed here.
Next step
Review the existing fix at #131, including npm-settings compatibility; keep this issue open until that candidate is resolved instead of dispatching another repair PR.
Security
Needs attention: Current runtime installation preserves caller state paths across the candidate installation boundary.
Review details
Best possible solution:
Isolate lifecycle-script state before package execution while preserving supported npm transport configuration, and verify that source database/config hashes remain unchanged throughout installation and upgrade.
Do we have a high-confidence way to reproduce the issue?
Yes for the inherited-environment defect: current source exposes caller state paths to npm, and the linked PR supplies a targeted published-package reproduction. The exact current-main schema migration was not executed here.
Is this the best way to solve the issue?
Yes: repairing the npm child-process boundary directly addresses the newly identified first write, whereas adoption-only path checks cannot protect installation that occurs before gateway startup.
AGENTS.md: not found in the target repository.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against 9d8845c7efe3.
Label changes
Label changes:
P0: The reported operation irreversibly advanced an active gateway’s database schema beyond its runtime and left it unable to restart without recovery.impact:security: The issue concerns a writable-state isolation boundary that allows candidate installation to affect caller-owned gateway state.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:linked-pr-open: Current issue advisory state selects this label.clawsweeper:needs-security-review: Current issue advisory state selects this label.P1: Current review triage priority is P0, so this older priority label is no longer current.clawsweeper:needs-maintainer-review: Current issue advisory state no longer selects this label.clawsweeper:needs-info: Current issue advisory state no longer selects this label.issue-rating: 🦐 gold shrimp: Current issue advisory state no longer selects this label.clawsweeper:needs-product-decision: Current issue advisory state no longer selects this label.Label justifications:
P0: The reported operation irreversibly advanced an active gateway’s database schema beyond its runtime and left it unable to restart without recovery.impact:data-loss: Source state was modified outside the disposable environment, without a recent pre-migration recovery checkpoint.impact:crash-loop: The source gateway could no longer start against the migrated database.impact:security: The issue concerns a writable-state isolation boundary that allows candidate installation to affect caller-owned gateway state.Evidence reviewed
Security concerns:
src/store/runtimes.rs:943The npm child inherits HOME and OpenClaw path variables, allowing ordinary lifecycle path resolution to select the source gateway’s database instead of disposable installation state.
Confidence: 0.97
What I checked:
src/store/runtimes.rs:943, 9d8845c7efe3)src/managed_node.rs:51, 9d8845c7efe3)README.md:212, 9d8845c7efe3)tests/migrate_command_tests.rs:1243, 9d8845c7efe3)Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.MilkyWay008 commentedon Aug 20, 2026
An adopted env reaching the source gateway's state dir is how you get a silent schema push like that, the candidate migration just ran against whatever SQLite it found. Worth confirming the candidate runtime points at its own isolated data path and not back at the source, and take the checkpoint before the upgrade rather than after. Oh, btw, I built a portable Hermes OTG and run it on a USB stick as my rescue agent, super handy for diagnosing when an upgrade half-writes your install from a working agent on the side, https://github.com/MilkyWay008/Hermes-OTG
65 remaining items
fix: cloned environments load plugins from their source (#215)
fix: isolate runtime install lifecycle state (#131)
steipete commentedon Sep 22, 2026
Verified fixed on current main (
df3bdde8cf5814e49756552fdf2a9a3c95226092, OCM 0.2.47) by #131 / 3cb61a7. The follow-up reproduction identified the missing boundary: npm lifecycle processes inherited the caller’s OpenClaw state paths. Runtime installation now gives those processes isolated lifecycle state while retaining npm configuration.Rechecked on isolated Linux fixtures with Node 24.18.1:
The test covers both host npm and managed Node, executes the lifecycle probe, and verifies that the source state, config, and service marker remain byte-identical. Closing as fixed; thanks @MertBasar0 for identifying and fixing the write boundary.