Repository navigation
fix(update): recover when another user owns shared temp storage - #170174
Conversation
Resolve the unused export reported by main CI 38271415987. The helper remains module-private and DatabaseEngineAdapter.transactions retains its existing structural contract. Full deadcode checks, core types, focused lint/format, and independent review pass.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR moves managed-update leases into per-user temporary storage and recovers obsolete receipts without opening foreign-owned directories. Example: Root repairs an update whose recorded /tmp/openclaw directory now belongs to UID 1001.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 6 items remain Keep this PR open: it addresses a confirmed recovery failure, but changing the default lease location breaks a supported legacy managed-update continuation. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe updater records installation ownership in a temporary SQLite lease store; package recovery consumes that authority to settle persisted publication journals and coordinate filesystem effects. flowchart TD
A[Update CLI or Gateway] --> B[Executor admission]
B --> C[Managed lease store]
D[Persisted package journal] --> E[Recovery settlement]
E --> B
E --> F[Package and launcher verification]
F --> G[Retained recovery evidence]
Technical reviewBest possible solution: Keep private defaults for new operations while preserving the exact historical lease domain for supported live continuations and safely settling obsolete foreign-owned receipts. Do we have a high-confidence way to reproduce the issue? The released-version report and current-main recovery path establish the foreign-directory refusal; source tracing also establishes the introduced legacy-finalizer failure, without executing target code. Is this the best way to solve the issue? Repairing the existing placement and settlement owners is appropriate, but changing the global default alone misses the supported released-driver continuation contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2b285c584aaf. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Source preserves foreign-directory rejection, but replacement-authority isolation still needs final-effect evidence. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +28, Tests +135, Docs +6. Total +169 across 8 files. Added test files: 2. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 12, 2026, 3:44 PM ET / 19:44 UTC. |
…ge (openclaw#170174) The managed update handoff lease lived under the shared /tmp/openclaw, whose path flipped to /tmp/openclaw-<uid> whenever another local user created it first; recovery then refused the other user's directory as unsafe and blocked package-swap and update repair. The lease now always uses a stable private per-user directory, and recovery treats a recorded lease under a foreign-owned directory as missing and settles it under current ownership, preserving rollback protections. Fixes openclaw#169382.
…ge (#170174) The managed update handoff lease lived under the shared /tmp/openclaw, whose path flipped to /tmp/openclaw-<uid> whenever another local user created it first; recovery then refused the other user's directory as unsafe and blocked package-swap and update repair. The lease now always uses a stable private per-user directory, and recovery treats a recorded lease under a foreign-owned directory as missing and settles it under current ownership, preserving rollback protections. Fixes #169382. (cherry picked from commit c949e5a)
What Problem This Solves
Fixes package updates and update repair getting stuck after another local user takes ownership of the shared
/tmp/openclawdirectory.Fixes #169382.
User Impact
Managed updates use a stable private per-user temporary lease directory. Repair treats an obsolete lease in another user's directory as missing and acquires current private ownership without reading or creating files there. Existing package, launcher, retained-evidence, and unfinished-rollback protections still apply. No configuration, schema, or dependency changes are required.
Why This Change Was Made
Lease placement previously followed the shared temporary-directory resolver, so another user's ownership could move the active lease path. Settlement then tried to prepare the historical database path and failed its ownership check. The lease owner now selects the per-user root explicitly, and package activation settlement and completed-receipt recovery recognize a foreign directory before database admission.
The shared test binding follows the private lease default as well. Two inherited gate failures are repaired with their canonical upstream changes: the internal
TransactionRecipesexport fix from 4cdac89, and the exact startup-checkpoint test hunk from cca31d7. The latter measures the two WAL-verification calls before a separate conflict probe can reopen the database; it preserves the original assertions.Evidence
node scripts/check-changed.mjspassed (exit 0; 1118.58 s), including production types, all 28 core-test type shards, root-test types, lint, ratchets, and runtime import-cycle checks.node --import ./scripts/tsx.mjs scripts/check-madge-import-cycles.tsreported 0 cycles.git diff --checkpassed.