Repository navigation
feat: delegate managed Gateway updates to OCM - #158932
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: blocked before merge. Reviewed September 26, 2026, 2:13 PM ET / 18:13 UTC (Revision 5). ClawSweeper reviewWhat this changesRoutes authorized Gateway and Control UI update requests from OCM-managed installations into OCM jobs and displays those jobs through OpenClaw’s update status views. Merge readiness⛔ Blocked before merge - 5 items remain Keep this PR open. Current main lacks the OCM job handoff, and the previous older-manager status finding is addressed at this head. The implementation has strong real-use evidence, but release timing and a still-open source-update prerequisite need resolution before merge. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway receives update requests from the Control UI and internal commands. For an OCM-managed installation, this branch asks OCM to perform the update, then reads OCM’s recorded job for status and UI display. flowchart LR
A[Control UI or internal command] --> B[Gateway update request]
B --> C{OCM-managed installation?}
C -->|Yes| D[OCM job and update owner]
C -->|No| E[Native updater]
D --> F[Gateway job status]
E --> F
F --> G[Update status view]
Decision needed
Why: The code and source-built run establish the integration, but only maintainers can choose whether to stage a dormant feature ahead of its dependency rollout. Before merge
Agent review detailsSecurityNone. PR surfaceSource +455, Tests +918, Docs -2. Total +1371 across 22 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep OCM as the sole durable job and installation owner, then ship the Gateway handoff with the native retention repair and a job-capable OCM release. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature request. Current main’s external-supervisor boundary is visible in source, and the PR documents an OCM-managed run through the proposed entry point. Is this the best way to solve the issue? Yes. The Gateway adapter uses OCM’s existing job contract and leaves durable update work with the installation owner; rollout should account for the two prerequisites. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 402ae8b78022. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
Added: OCM-managed updates now run through their installation owner and retain their recorded status across reconnects. |
Route eligible Gateway updates through the bound OCM manager and retain truthful managed job status across reconnects. Preserve native read-only update information with older OCM managers while refusing unsupported managed writes.
What Problem This Solves
An OCM-managed environment needs its installation owner to perform an update, but the Control UI and internal /update command currently stop at the native updater's external-supervision boundary.
This adds a route from the normal Gateway updater to OCM's existing update jobs and keeps the accepted job's result visible after reconnects.
User Impact
Compatible OCM-managed environments can request an update and follow the same job through progress and completion.
Package updates retain their selected channel, and source updates retain native source-checkout and channel ownership.
Unmanaged installations and requests from external chat preserve their existing updater and authorization paths.
The UI displays OCM's recorded result and recovery instructions without inventing native verification phases or offering native repair/report actions for an OCM-owned job.
Accepted jobs remain readable while another source update is unavailable, and historical outcomes survive later environment rebinding.
A failed first status read resumes through polling without submitting another update.
Why This Change Was Made
The normal update.run entrypoint calls the existing admission module for one validation and the optional OCM handoff before native update records or lifecycle work begin.
OCM remains the owner of durable jobs, installation, checkpoints, restart, verification, and recovery.
The adapter discovers OCM from its trusted executable and environment identity, validates canonical paths, excludes configuration-owned overrides and workspace dotenv values, and rechecks current requester authority immediately before submission.
A lost submission reply is reconciled using the original request ID.
This is an additive, capability-discovered integration with the OCM job protocol.
Ordinary environment activation without a manager executable preserves the native path; a recognized manager that cannot answer the capability probe returns an actionable error before any native update begins.
Released older OCM managers retain native read-only update information when their CLI explicitly rejects the unsupported job command; managed writes and explicit OCM job reads still refuse with an actionable message.
Other capability, identity, authentication, timeout, and selected-job failures remain errors.
No additional support flag, OpenClaw storage migration, or second update ledger is introduced.
The source prerequisites are the preferred-target correction in #158926, artifact/currentness correction in #158931, and retired-workspace retention correction in #159035.
All three prerequisites are now landed; the final target contains the qualified retention repair.
The recorded live fixture used the first two landed corrections and the earlier retention candidate qualified below.
Evidence
Real managed source update
One Control UI Update request created one OCM job, which completed as source-updated with a restarted Gateway in 326 seconds.
The original browser reconnected, refreshed its UI, and recorded connected success on that same job while the running build matched the selected source.
A separate read-only browser context then retrieved the same successful job through update.status and update.runs.get before and after reload, with zero further update requests and no fabricated native verification or recovery controls.
The successful recording and screenshots appear first below; the source-build wait is explicitly accelerated to 32×.
The actual executed source was 9f9ddd059f259261051ad70c5f0e3a58ad7b5221 → 939ee0b224cca04ae94971877aae387ac5bb72fb, tree cc66fbea5885bd0381210ae4d55dea71d5a6bd79, combining adapter a165ff0 with retention candidate e783d95.
The landed retention repair 31445e8 preserves the scoped files from reviewed candidate 644dc9f, qualified against the original module-only orphan input, its corrected boundary tests, and a read-only comparison of post-update retention plans: 154,803 complete entry fingerprints and 186 copy pairs match, and relocation agrees for 156,623 paths.
The post-update comparison is not represented as reconstruction of the original dependency inventory, and the successful execution is not relabeled as a run of 644dc9f.
The source-built OCM driver has identical production and build files to landed openclaw/ocm@2af4102; only unchanged test functions are reordered.
This qualifies the source-built driver, without claiming a published release artifact was tested.
The original recorder later timed out on a sidebar locator absent from Settings, after its successful terminal snapshot.
Its failed tool result is retained; late token-byte assertions did not run, and the separate readback does not establish original-session continuity.
An earlier attempt failed on the retired Webhooks dependency edge; its failed job and explicit operator recovery remain recorded, while the successful attempt includes the native retention repair.
The footer’s dirty marker comes from the updater’s temporary pnpm virtual-store override during the candidate build; the workspace is restored before clean-source and exact-source checks, followed by matching activated artifact digests.
No raw Git-status snapshot was retained at the instant Vite observed it, so this does not claim a complete inventory of transient untracked files.
Boundary and regression checks
The normal-entrypoint correction passed 25 OCM RPC cases in 17.68 seconds and 133 native updater, authority, channel, campaign, and internal-command cases in 52.08 seconds on the cloud Mac.
The final flag-removal and dotenv correction passed 30 OCM RPC cases and 43 dotenv cases in 22.34 seconds, including real sync/async loader failures reproduced before the workspace namespace policy was corrected.
The changed dotenv file passed alone in 6.67 seconds with one worker.
The 49-case UI batch passed in 4.06 seconds, including the first-read retry regression that failed before correction.
Changed-file formatting, type-aware lint, the line-cap gate, production and affected test types, UI types, i18n, config documentation, import cycles, and stylesheet checks passed.
The unchanged UI and earlier selected test-type graphs retain their original execution identity; affected backend graphs were refreshed after the routing and dotenv corrections.
The UI build passes its startup performance gate at 370,913 bytes gzip against the 371,332-byte limit, and the environment-variable inventory remains 486.
Hosted CI and applicable security checks pass on final head 8183053.
ClawSweeper reports Platinum readiness and patch quality, Diamond proof confidence, and no actionable findings on that exact head.
Independent and structured P0–P2 reviews of the final correction are clean.
The older-manager status regression failed before correction, then all 36 OCM cases passed in 17.54 seconds and 80 native status, schedule, channel, and campaign cases passed in 14.55 seconds.
The actual published OCM 0.2.47 binary also passed the unsupported-capability classification through the real client, while the handler regression proves native latest/list/get remain readable and managed writes and explicit OCM reads refuse.
Final formatting, type-aware lint, production types, canonical Gateway test types, and changed-path ratchets pass.
Earlier isolated live proof also covers package replacement, download failure, activation rollback, source no-ops, reconnects, and retained readback.
The actual published OCM 0.2.47 binary rejects the unsupported capabilities probe before mutation; that refusal does not become a native update.
The secondary browser comparison below uses the maintained UI with a mocked Gateway and intentionally ends in a recorded download failure to show first-read recovery and truthful failure rendering.
Its captured UI and projection are byte-identical in a165ff0; it sends one request, polls the same job, and requires no reconnect.
Visual evidence
Real Update succeeds; source-build wait shown at 32×
proof.mp4
Visual verification
81830534aa5d547dd8c3ea4a7ea6817931ec7753Supporting first-read recovery
One update request, automatic read recovery, and recorded result
[email protected]
Visual verification
a44dbbd07f60a7581b7c5b253c77fa8a152d4fff