Repository navigation
fix(crabbox): preserve project snapshots across runtime updates - #170780
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Separate disk compatibility from exact runtime readiness. Top up compatible foreground forks without a runtime-only capture, preserving age refresh, generation ownership, and allocation replay. Keep the existing outer image-record key and bump only the preparation contract.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b78e0edf6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /** SHA-256 of provider-owned disk/boot settings, excluding runtime and lease policy. */ | ||
| profileKey?: string; |
There was a problem hiding this comment.
Specify or normalize the profile fingerprint encoding
The new public contract describes profileKey only as a SHA-256 digest, so an external provider may legitimately return an uppercase hexadecimal or another standard digest encoding. During project preparation, Target.parse() accepts only lowercase 64-character hex via Digest, causing such a provider's dispatch to fail with “Worker project preparation identity is invalid.” Normalize the value or explicitly require lowercase hexadecimal in the SDK contract so runtime enforcement matches the documented plugin API.
AGENTS.md reference: src/plugins/AGENTS.md:L25-L29
Useful? React with 👍 / 👎.
8b78e0e to
17d4a27
Compare
|
Merged via squash.
|
* commit '7ae69497bec4d9c37f170f046a3cbbf954ff19a7': (6238 commits) refactor(ui): replace Systems filters with native menu (#170786) fix(browser): browser open honors timeoutMs for its opening navigation (#170053) refactor: deslop old Apple shared/macOS and Control UI code (#170823) perf(memory): reuse pooled origin readers (#170795) fix(crabbox): preserve project snapshots across runtime updates (#170780) fix: prevent chat image loading from shifting messages (#170819) refactor(ui): use native menus for Secret Store actions (#170663) fix(gateway): keep chat metadata available during model reloads (#170805) fix: preserve diagnostics for unresponsive state lease heartbeats (#170835) fix(test): prepare runtime config for corpus revision proof test: give credential fixtures database ownership perf(auth): unblock session writes during health preparation (#170807) fix(ci): use smaller runners for selected Gateway client tests (#170821) fix: use same-commit plugins in development macOS builds (#170776) perf(github): share cached reads across sessions and searches (#170825) fix(projects): keep listings stable during unrelated session changes (#170824) fix(update): update repair fails after Doctor completes on busy macOS hosts (#170779) fix(heartbeat): suppress truncated NO_REPLY finals such as NO_R (#170190) perf(sessions): reduce read transaction overhead (#170745) refactor: simplify older plugin and package lifecycles (#170800) ...
…claw#170780) Separate disk compatibility from exact runtime readiness. Top up compatible foreground forks without a runtime-only capture, preserving age refresh, generation ownership, and allocation replay. Keep the existing outer image-record key and bump only the preparation contract.
* feat(qa): report scorecard evidence gaps Distinguish catalog coverage, recorded attempts, and qualified evidence without changing scores or release gates. Include the canonical compatibility migration-status correction from ec1fb60. Co-authored-by: Patrick Erichsen <[email protected]> * chore(qa): drop compatibility backport already on main Keep the QA evidence-gap change scoped to its 13 paths. The canonical compatibility correction ec1fb60 and later refinements are already on main; restore the six branch preimages so the merge consumes that upstream owner state. * chore(qa): integrate canonical worker settlement fixes * commit '7ae69497bec4d9c37f170f046a3cbbf954ff19a7': (6238 commits) refactor(ui): replace Systems filters with native menu (#170786) fix(browser): browser open honors timeoutMs for its opening navigation (#170053) refactor: deslop old Apple shared/macOS and Control UI code (#170823) perf(memory): reuse pooled origin readers (#170795) fix(crabbox): preserve project snapshots across runtime updates (#170780) fix: prevent chat image loading from shifting messages (#170819) refactor(ui): use native menus for Secret Store actions (#170663) fix(gateway): keep chat metadata available during model reloads (#170805) fix: preserve diagnostics for unresponsive state lease heartbeats (#170835) fix(test): prepare runtime config for corpus revision proof test: give credential fixtures database ownership perf(auth): unblock session writes during health preparation (#170807) fix(ci): use smaller runners for selected Gateway client tests (#170821) fix: use same-commit plugins in development macOS builds (#170776) perf(github): share cached reads across sessions and searches (#170825) fix(projects): keep listings stable during unrelated session changes (#170824) fix(update): update repair fails after Doctor completes on busy macOS hosts (#170779) fix(heartbeat): suppress truncated NO_REPLY finals such as NO_R (#170190) perf(sessions): reduce read transaction overhead (#170745) refactor: simplify older plugin and package lifecycles (#170800) ... * fix(gateway): preserve safe previews and no-op bindings Clear only the matching pending binding operation after an authoritative unchanged settlement, preserving committed and unknown invalidation fences. Include the canonical managed-media preview correction from 47ba0ae. Co-authored-by: Peter Steinberger <[email protected]> * merge(main): reconcile QA reporting with frozen main * test(gateway): verify retained route authority after binding settlement Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
* feat(qa): report scorecard evidence gaps Distinguish catalog coverage, recorded attempts, and qualified evidence without changing scores or release gates. Include the canonical compatibility migration-status correction from 3f6d26f. Co-authored-by: Patrick Erichsen <[email protected]> * chore(qa): drop compatibility backport already on main Keep the QA evidence-gap change scoped to its 13 paths. The canonical compatibility correction 3f6d26f and later refinements are already on main; restore the six branch preimages so the merge consumes that upstream owner state. * chore(qa): integrate canonical worker settlement fixes * commit '4ae87487b6eca95ac58a2f18de0e742b240772eb': (6238 commits) refactor(ui): replace Systems filters with native menu (openclaw#170786) fix(browser): browser open honors timeoutMs for its opening navigation (openclaw#170053) refactor: deslop old Apple shared/macOS and Control UI code (openclaw#170823) perf(memory): reuse pooled origin readers (openclaw#170795) fix(crabbox): preserve project snapshots across runtime updates (openclaw#170780) fix: prevent chat image loading from shifting messages (openclaw#170819) refactor(ui): use native menus for Secret Store actions (openclaw#170663) fix(gateway): keep chat metadata available during model reloads (openclaw#170805) fix: preserve diagnostics for unresponsive state lease heartbeats (openclaw#170835) fix(test): prepare runtime config for corpus revision proof test: give credential fixtures database ownership perf(auth): unblock session writes during health preparation (openclaw#170807) fix(ci): use smaller runners for selected Gateway client tests (openclaw#170821) fix: use same-commit plugins in development macOS builds (openclaw#170776) perf(github): share cached reads across sessions and searches (openclaw#170825) fix(projects): keep listings stable during unrelated session changes (openclaw#170824) fix(update): update repair fails after Doctor completes on busy macOS hosts (openclaw#170779) fix(heartbeat): suppress truncated NO_REPLY finals such as NO_R (openclaw#170190) perf(sessions): reduce read transaction overhead (openclaw#170745) refactor: simplify older plugin and package lifecycles (openclaw#170800) ... * fix(gateway): preserve safe previews and no-op bindings Clear only the matching pending binding operation after an authoritative unchanged settlement, preserving committed and unknown invalidation fences. Include the canonical managed-media preview correction from f3260b9. Co-authored-by: Peter Steinberger <[email protected]> * merge(main): reconcile QA reporting with frozen main * test(gateway): verify retained route authority after binding settlement Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
Problem
What Problem This Solves
Gateway updates, plugin toggles, and lease-policy edits invalidate prepared project snapshots because the disk compatibility key includes runtime artifacts and the full profile. Subsequent cloud sessions start cold even when the repository environment is unchanged.
Solution
Separate disk compatibility from ready-worker identity. Crabbox supplies its existing resolved disk-profile fingerprint through the optional
resolvePreparationTarget().profileKeycontract, so core does not duplicate provider policy. Other providers retain conservative settings-based compatibility. The disk key includes provider/backend, resolved OS/architecture/class, setup inputs, project identity, repository recipe/skip choice, workspace protocol, and contract version 2. Exact runtime artifacts, profile, and commit remain in the ready-worker key.Compatible project forks with an older runtime run runtime preparation and enrollment verification. A runtime-only change does not cause foreground pre-enrollment capture. Background reserve/build preparation and age refresh can publish the updated runtime. Existing source-generation replacement fences and interrupted/enrolled replay semantics remain in place. Both capture and top-up use the same runtime-installation implementation.
Profile field decisions
providerinstallsuspendAfter,readyWorkerssettings.providersettings.class, placementmachineClasssettings.target, placementos, target architecturesettings.setupsettings.setupEnvsettings.desktopsettings.binarysettings.ttl,settings.idleTimeout, derived heartbeat/timeout valuessettings.warmImageImpact
Compatible repository snapshots survive routine Gateway/runtime updates and non-provisioning profile changes. Older runtime images are topped up after forking, without an extra foreground snapshot solely for that runtime change. First capture, setup repair, interrupted preparation, and age refresh retain their existing capture boundaries.
Update behavior: previous-contract prepared project images are incompatible with new allocations and retire through normal retention. The outer Crabbox image-record key stays stable so existing allocations retain their replay identity. Existing version-3 plugin-state records are unchanged; historical preparation identities remain readable for their lifecycle. No SQLite/schema migration, config change, or new operator setup is required. No live cloud lease was used; integrated AWS proof remains a follow-up.
Evidence
pnpm test src/gateway/worker-environments/preparation-identity.test.ts extensions/crabbox/src/crabbox-worker-prepared-image.test.ts extensions/crabbox/src/crabbox-worker-profile.test.ts --maxWorkers=1— 32 passed, 261.28 s wall time, including cold worker compilation.pnpm test extensions/crabbox/src/crabbox-worker-warm-image*.test.ts extensions/crabbox/src/crabbox-worker-project.test.ts --maxWorkers=1— 181 passed across 10 files, 578.59 s wall time. This exercises existing replay, capture custody, runtime preparation, generation replacement, retention, and cleanup contracts.pnpm test extensions/crabbox/src/crabbox-worker-profile.test.ts extensions/crabbox/src/crabbox-worker-prepared-image.test.ts extensions/crabbox/src/crabbox-worker-warm-image-allocation.test.ts --maxWorkers=1— final replay-key correction: 29 passed, 126.66 s wall time.pnpm test extensions/crabbox/src/crabbox-worker-profile.test.ts extensions/crabbox/src/crabbox-worker-prepared-image.test.ts --maxWorkers=1— final profile-owner extraction: 14 passed, 65.57 s wall time.pnpm test src/gateway/worker-environments/preparation-identity.test.ts --maxWorkers=1 -t 'invalidates a changed runtime before allocation'— fails on the original implementation at the cache-key equality assertion (22.25 s), passes on the candidate (20.66 s). Candidate source was restored byte-for-byte after the comparison.pnpm build:runtime— final candidate passed, 96.07 s (earlier complete runtime build: 188.27 s). Fullpnpm buildwas stopped after 1067.17 s: package declaration generation had spent over 12 minutes without completing the step. The supported runtime build completed; full declaration-build proof remains with CI.pnpm tsgo— passed, 794.14 s including the wait for build artifact ownership.pnpm tsgo:extensions— final candidate passed, 6.13 s (earlier run: 193.81 s including the runtime-build lock wait).node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/gateway/worker-environments/preparation-identity.test.ts src/gateway/worker-environments/preparation-identity.ts src/plugins/capability-provider.types.ts— passed, 23.70 s.node scripts/run-oxlint.mjs --tsconfig extensions/tsconfig.json extensions/crabbox/src/crabbox-worker-prepared-image.test.ts extensions/crabbox/src/crabbox-worker-profile.test.ts extensions/crabbox/src/crabbox-worker-profile.ts extensions/crabbox/src/crabbox-worker-provider.ts extensions/crabbox/src/crabbox-worker-warm-image-capture.ts— passed, 78.05 s. The initial run reported 711 counted provider lines against the 700-line cap; moving the preparation-target projection into its existing profile owner resolved it.pnpm format:checkon all ten changed files passed (0.85 s);git diff --checkpassed.pnpm check:line-cap-ratchet --base origin/mainpassed (6.55 s);pnpm check:max-lines-ratchet --base origin/mainpassed (55.05 s). No baselines, caps, or guards were changed.The initial focused run exposed a deletion-budget fixture that depended on a readiness-key change forcing capture. It now requests setup repair explicitly, preserving the deletion-budget proof under the new capture policy. The provider tests use the existing command/SQLite boundary fixtures; they boot no Gateway and use no live cloud lease. Host contention and cold worker compilation account for much of the wall time. CI test seconds are pending. Rebased onto main after a documentation-only conflict: all eight changed TypeScript files are byte-identical to the reviewed/tested candidate; docs formatting and
git diff --checkpassed again. Main's resolved-directory/normalized-URL wording is preserved.Release-note context
Cloud sessions reuse compatible repository snapshots across Gateway updates and plugin changes, topping up the worker runtime after fork instead of rebuilding the environment or waiting for a runtime-only snapshot capture.