Skip to content

fix: keep pnpm fallback caches out of guest workspace sync - #188089

Merged
shakkernerd merged 2 commits into
mainfrom
guest-pnpm-cache
Oct 30, 2026
Merged

shakkernerd merged 2 commits into
mainfrom
guest-pnpm-cache

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #188068.

What Problem This Solves

Installing a nested project from a managed guest shell can make pnpm select .openclaw/.pnpm-store when its home store cannot hard-link across the protected .openclaw mount. That fallback enters ordinary workspace synchronization as authored content. A real one-package installation copied 54 generated store files into the canonical project; larger stores can also consume the existing result limits.

User Impact

The exact checkout-root fallback store stays with its producing runtime. Authored siblings, nested project fixtures and genuine staged inputs retain their existing preservation rules and file limits. Cache files already present on either side remain preserved.

Older accepted baselines remain recoverable when their inventory is missing and an intact workspace or checkpoint can reconstruct the saved root. Recovery preserves other live edits and refuses to replace that baseline with divergent content.

Why This Change Was Made

The shared generated-path classifier already owns capture, transfer, reconciliation and recovery. Adding the demonstrated fallback root there keeps those consumers consistent while preserving pnpm configuration, HOME, sandbox mounts and permissions. Both embedded manifest consumers are regenerated from that owner.

Historical reconstruction needs the old inventory before normal reconciliation applies today's exclusions. Repair therefore tries current candidates first, then allows only the former pnpm fallback root while matching the immutable saved root. Checkpoints retain their previous entries and recorded result directories so an interrupted policy transition can reconstruct that same baseline. Other cache exclusions, filesystem checks and inventory bounds remain in force.

Evidence

The live before-case used pnpm 12.15.0 and an authenticated local semver archive with guest networking disabled. A root-launched shell changed into the nested project while retaining HOME at /workspace; native pnpm selected .openclaw/.pnpm-store/v11. After one installation and normal synchronization, both workspaces contained 54 generated files, including a content-addressed object hard-linked to the installed package. A separate turn preserved authored edits, original staged inputs and package use.

The regressions reproduced fallback-cache admission, historical baseline reconstruction failure, and checkpoint reconstruction failure before their corrections. The final fourteen affected test files passed 220 cases with one existing opt-in skip. Changed-file formatting/lint, generated-script consistency, selected production/test type checks and the test-line ratchet passed. The fixtures retain physical node_modules, authored siblings, staged inputs, divergent edits and exact-root authentication.

On the corrected runtime, one installation of already-locked semver 6.3.1 naturally created a new 981-byte cache object that was absent from both workspaces beforehand. It matched the authentic archive and installed hard link, stayed in the private workspace, and remained absent from canonical storage through synchronization and a separate read-only turn. All 54 original canonical files and 53 prior private cache payloads remained unchanged; pnpm updated its private index normally. Authored V2 controls and original staged inputs survived, and the installed package remained usable without reinstalling. Guest isolation, mounts and configuration were unchanged.

The live case uses a small authentic object; the historical 64 MiB rejection and Team Podman scenario remain outside this proof. Existing boundary tests cover generated-root exclusion and preserved authored limits.

Latest-stable compatibility passed through production storage owners in three separate processes, starting from v2026.10.9. Stable itself created a cache-bearing legacy baseline and a conflicted pending Git result. The candidate's normal startup migration preserved their original identities and kept the authored conflict pending until it was resolved. Recovery then accepted the guest edit and cleared pending state. A fresh process reopened the same state, synchronized a subsequent authored edit, and kept a new cache file private. Existing independent cache contents, authored siblings, genuine staged inputs and host-only exclusions survived throughout.

This upgrade run covers storage owners and their normal backed-up startup migration. Full Gateway, service and model upgrades remain outside its scope. Latest stable predates the newer tree/checkpoint fields; their missing-inventory and checkpoint reconstruction paths are covered by the separate regressions above.

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime docker Docker and sandbox tooling size: XS labels Oct 30, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Exclude the checkout-root pnpm fallback store from workspace synchronization while preserving recovery of historical cache-bearing baselines.

Example: A guest shell installs semver beneath .openclaw while HOME remains /workspace.

  • Before: pnpm selects .openclaw/.pnpm-store/v11, and synchronization copies generated package-store files into the canonical project.
  • After: New cache objects remain private to the guest while authored edits, staged inputs, and existing cache contents survive.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with reported production behavior and upgrade compatibility; proof is detailed textual evidence rather than directly inspectable media or a linked execution artifact.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The current body reports normal guest exec, native pnpm installation, synchronization, and a separate read-only turn on the corrected runtime, with a new authentic cache object remaining private and authored controls preserved; the latest-stable storage-owner upgrade and fresh-process reopen resolve the previous compatibility blocker.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Installing dependencies inside a managed guest can copy disposable pnpm store objects into the canonical project.
Reason: The maintainer-authored direction restores the documented generated-content boundary while retaining existing files and authored-input protections.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current workspace synchronization defect without an identified correctness blocker; the updated compatibility evidence resolves the previous review’s upgrade concern.

Priority: P2
Reviewed head: bc9d65a90581e37d7a6c375769c81573684586be

Before merge

None.

Findings

None.

Agent review details

How this fits together

Managed workspace scanners capture canonical and guest files into manifests; shared path rules select synchronized content, and the existing recovery owner reconstructs missing baseline metadata against its saved digest.

flowchart LR
  A[Guest package installation] --> B[Workspace scanner]
  C[Shared path classifier] --> B
  B --> D[Workspace manifests]
  D --> E[Canonical reconciliation]
  F[Saved baseline and checkpoint] --> G[Baseline recovery]
  B --> G
  G --> D
Loading

Technical review

Best possible solution:

Use the existing shared classifier to exclude new fallback-cache content and preserve exact historical baseline identities through the existing recovery owner.

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

The linked report supplies a precise native pnpm trigger and observed synchronization result, and current-main source confirms the missing exclusion; this read-only review ran no target code.

Is this the best way to solve the issue?

The patch is the smallest complete repair using existing owners: one exact-root exclusion, regenerated consumers, and narrowly justified historical reconstruction support.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 445b21a0ebb2.

Provenance checked

  • Generated workspace path classification keeps the original intent (9012743: Keep observed package-manager and test-tool caches out of synchronized results through one shared exact-root classifier.)
  • Missing baseline and checkpoint reconstruction keeps the original intent (fix: recover accepted guest files after missing baseline metadata #186819: Use surviving membership and complete filesystem observations only as candidates, accepting reconstructed metadata solely when it reproduces the saved baseline.)
  • Checkpoint base serialization changes intended behavior with a stated reason (a25b072: Persist incremental content-addressed manifests and checkpoint roots; the PR explains why historical entries must remain in the previous-state document during an exclusion transition.)
  • Generated manifest programs keeps the original intent (fe0be1a: Retain declared helper programs in ordinary and standalone installations through generated script assets.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Shakker: Raw commit 9012743 adds src/gateway/worker-environments/workspace-path-exclusions.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 90127436fa45; files: src/gateway/worker-environments/workspace-path-exclusions.ts)
  • Peter Steinberger: Raw commit e69b382 adds src/gateway/worker-environments/local-workspace-manifest-scan.ts:233 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e69b3829f844; files: src/gateway/worker-environments/local-workspace-manifest-scan.ts)

PR surface

Source +26, Tests +31, Docs +5, Generated +18, Other +1. Total +81 across 10 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 123 97 +26
Tests 3 38 7 +31
Docs 1 9 4 +5
Config 0 0 0 0
Generated 2 22 4 +18
Other 1 1 0 +1
Total 10 193 112 +81

Root-cause cluster

Relationship: same_root_cause
Canonical: #188068
Summary: This PR implements the fallback-store boundary correction demonstrated by the linked report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: The demonstrated defect copies disposable dependency bytes into canonical projects; the supplied reproduction does not establish data loss or a broader outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-30T04:11:01.416Z sha dd75d69 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-30T11:52:13.979Z sha bc9d65a :: blocked before merge. :: none

Reviewed October 30, 2026, 9:19 AM ET / 13:19 UTC (Revision 3).

@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 30, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@shakkernerd
shakkernerd merged commit fdba74e into main Oct 30, 2026
186 of 187 checks passed
@shakkernerd
shakkernerd deleted the guest-pnpm-cache branch October 30, 2026 13:24
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: pnpm fallback caches stay out of guest workspace synchronization, with saved baseline recovery preserved.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…188089)

Exclude the checkout-root pnpm fallback store from guest workspace synchronization and retain authenticated reconstruction of older saved baselines.

Refs openclaw#188068.
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…188089)

Adapt bounded source behavior to frozen LOCAL11.8; preserve unrelated baseline behavior.

(cherry picked from commit fdba74e)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 1b431065dfe6552ff27caa297430e7098bcfd550)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling docs Improvements or additions to documentation gateway Gateway runtime 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: M 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.

[Bug]: pnpm fallback store enters managed guest workspace synchronization

1 participant