Repository navigation
improve: retain current worker builds between sessions - #140449
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed September 6, 2026, 10:16 PM ET / September 7, 2026, 02:16 UTC. ClawSweeper reviewWhat this changesPersistent nodes retain the current worker build between sessions, while maintenance runs independently per node and installation remains attached to explicit session requests. Merge readiness✅ Ready for maintainer review This remains useful work: current main lacks the between-session retention pin. The revised scope resolves the earlier background-installation finding by removing that design, and no blocking defect was identified in the remaining patch. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway sends worker software to paired nodes that host sessions. Its retention coordinator combines current-build and session references so node maintenance can preserve needed artifacts and remove unused older builds. flowchart TD
A[Gateway worker build] --> C[Retention coordinator]
B[Live and recoverable sessions] --> C
D[Current cloud enrollment] --> C
C --> E[Per-node retention request]
E --> F[Preserve needed builds]
E --> G[Remove unused older builds]
F --> H[Reuse on next session]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +67, Tests +182, Docs +7. Total +256 across 12 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep retention on the existing bounded maintenance protocol, preserve request-owned installation, and leave preparation-before-first-use to the broader linked issue. Do we have a high-confidence way to reproduce the issue? Yes, from source: after session references disappear and installation generations are acknowledged, main's retained-hash set can omit the current build and native cleanup can collect it. No runtime reproduction was executed during this review. Is this the best way to solve the issue? Yes. Extending the existing retention snapshot is a narrow solution that preserves integrity validation and avoids introducing a separate background installation owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c371a00aadcf. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
* perf(gateway): prepare node worker builds on reconnect * refactor: keep node maintenance limited to installed build retention
* perf(gateway): prepare node worker builds on reconnect * refactor: keep node maintenance limited to installed build retention (cherry picked from commit 4cf8d68)
…es (#182115) After a Gateway update, the first session on each persistent node paid the full worker-bundle download (about 24 s measured in #140449). Nodes that negotiate the new capability now receive a low-priority, archive-only prefetch: the node downloads and verifies the pinned bundle archive but never extracts, repairs, publishes or activates it; a session's own install preempts any in-flight prefetch and reuses the verified archive. Prefetch failures are warnings only, old nodes keep the session-owned install, and existing retention handles the archive. Fixes #140425
…es (openclaw#182115) After a Gateway update, the first session on each persistent node paid the full worker-bundle download (about 24 s measured in openclaw#140449). Nodes that negotiate the new capability now receive a low-priority, archive-only prefetch: the node downloads and verifies the pinned bundle archive but never extracts, repairs, publishes or activates it; a session's own install preempts any in-flight prefetch and reuses the verified archive. Prefetch failures are warnings only, old nodes keep the session-owned install, and existing retention handles the archive. Fixes openclaw#140425
Related: #140425
What Problem This Solves
Fixes an issue where closing the last session on a persistent node can discard the current worker build, forcing the next session to download it again. Slow maintenance on one node can also delay another node.
Why This Change Was Made
Keep one installed current worker artifact per Gateway namespace alongside existing live/recovery references, using the existing bounded retention protocol. Coalesce maintenance independently per node. Read current enrollment ownership from the canonical store instead of caching it by inventory version, which pairing does not update.
This revision removes the earlier automatic remote installation and shared preparation lifetime. Installation remains owned by an explicit session request and its cancellation signal; maintenance only retains installed software. Existing native integrity validation and cloud execution-mode ownership remain unchanged.
User Impact
Later sessions reuse the current installed build after earlier sessions close. Unreferenced older builds remain eligible for normal cleanup. First use after a Gateway build change still installs the new artifact: this is a partial improvement toward #140425, not prewarming or a ten-second cold-start guarantee.
No schema, index, configuration, dependency, permission, or protocol changes. Node documentation describes the retention and installation boundaries. Release-note context is recorded here; CHANGELOG.md is release-owned.
Evidence
pnpm buildalso passed on the exact PR head with Node 24.20.0 and pnpm 12.3.4; that build is running in the dev Gateway.9f05f2ba0dcadf7276a588653d3ce96f0fe6ac5a.Darwinsuccessfully. After the first close, live/recovery and nonterminal-environment pins were zero; normal cleanup removed its workspace while the bundle receipt, bytes, inodes, and modification times stayed identical through the second activation. Both synthetic sessions were archived. This is two-sample warm reuse evidence, not a cold-cloud SLO or a measured network-download count.The earlier background-installation finding was addressed by removing that design. Earlier CI and investigation results are historical evidence, not validation of the removed cancellation contract. There are no UI appearance changes.