Repository navigation
feat: show live cloud worker pool in settings - #157200
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 24, 2026, 4:03 PM ET / 20:03 UTC (Revision 8). ClawSweeper reviewWhat this changesAdds a Cloud workers Pool settings view, administrator opt-in details to Gateway environment responses, and supporting documentation and tests. Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open. Current main has the prepared-worker reserve but lacks the Pool view. The prior release-compatibility and authority concerns are addressed at this head; no actionable patch defect remains. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway's cloud-worker service tracks prepared machines and reserved capacity. The Control UI requests that inventory through environment APIs and presents worker status and capacity to an administrator. flowchart LR
A[Worker profiles] --> B[Prepared worker store]
B --> C[Reservation summary]
C --> F[Gateway response]
D[Pool view request] --> E[Administrator and opt-in check]
E --> F
F --> G[Pool view]
G --> H[Capacity and worker status]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +466, Tests +800, Docs +13, Other +21. Total +1300 across 33 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep reservation capacity sourced from the prepared-worker owner and project sensitive details only after the Gateway confirms current administrator authority. Do we have a high-confidence way to reproduce the issue? Not applicable—this PR adds a settings capability. Current main exposes the reserve policy and snapshots but no live Pool view. Is this the best way to solve the issue? Yes. The UI consumes the existing Gateway environment service and reservation projection, with explicit administrator detail requests and default response compatibility. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1a7ba53b45ed. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
4a06950 to
861cb14
Compare
861cb14 to
441486b
Compare
441486b to
d4de123
Compare
|
Merged via squash.
|
* feat: show ready cloud worker pool in settings * test: complete cloud worker cleanup fixtures * test: wait for sidebar before plugin registration check * test: run composed gateway scenarios in source lanes * fix(gateway): opt in to live-authorized pool details * test: document native TypeScript shutdown noise workaround
What Problem This Solves
Cloud worker settings expose reserve limits and snapshots, but operators cannot see which prepared machines are ready or why pool capacity is occupied.
User Impact
Adds Settings → Connections → Cloud workers → Pool with ready, preparing, releasing, and attention counts; profile/project grouping; prepared commit, expiry, recorded failures, and current capacity. It refreshes every ten seconds while visible, offers manual refresh, and preserves the last result when refresh fails.
Why This Change Was Made
The existing pool owner supplies the exact reservation IDs, including consumed workers still holding capacity during cleanup. The UI presents those facts and retires pending reads when its Gateway or tab changes. New project/timing/capacity details require both
includePreparedDetails: trueand current administrator scope. The Pool view opts in; default list/status responses retain the released inventory shape, including for administrators. Both handlers revalidate canonical request authority after discovery finishes and project sensitive fields only in the final synchronous response frame. Protocol models are regenerated with no version or persistence migration.Evidence
d4de12310288: default admin and read-only opt-in replies validate the released v2026.9.6 schemas; opted-in admins receive the new fields; controlled in-flight scope downgrades returnFORBIDDENwithout a payload. Actualdevice.token.revokeRPCs from a second admin close the requesting sockets with code 4001 and deliver no inventory frames. The listener, signed-device handshakes, router, serialization, and revocation are real; worker records are synthetic and no cloud provider is called.7d6a0a9bec0cin run 36051073661: 172 successful checks, 11 intentional skips, and a successfulopenclaw/ci-gate. Fresh ClawSweeper review reports no code or security findings and accepts the visual, wire and compatibility proof. The unrelated supporting Shared Periphery result is disclosed below. No Team deployment or restart was performed.Before — existing snapshots view:
After — the new pool view, refreshed after rebasing:
Mobile worker details:
Current-head WebSocket compatibility and revocation proof
One task-owned Gateway with isolated state and real signed-device WebSocket clients exercised both
environments.listandenvironments.status. Results were captured as parsed response frames; authentication/connect frames were excluded.includePreparedDetails: true{"ok":false,"error":{"code":"FORBIDDEN","message":"Gateway requester authority changed"}}, no payloaddevice.token.revokeRPC during held discovery4001 / device removed; zero inventory response framesThe controlled scope case mutates the actual accepted client's scope state; it is not presented as a settings grant-change RPC. The revocation case uses the real RPC and persistent device owner. Synthetic inventory and a deterministic discovery barrier isolate the policy contract. The full proof passed in 5.264s test time / 18.88s command wall. An initial proof-fixture error used an obsolete context-factory parameter; it was corrected from the current signature before the successful run.
The review's
unknown-data-model-changemarker does not describe a persistence change: the record, table schema, migrations, and persisted preparation shape are unchanged. The store addition only reads IDs from the existing prepared-reservation projection. The protocol fields are explicitly opted into and released-client compatibility is covered above.CI fixture and routing repairs
CI exposed four existing fixture records missing the new required nullable cleanup timestamp. They now supply it. The exact type errors reproduced with a cold local graph; all 25 canonical test graphs then passed without incremental state.
CI also exposed two existing browser fixtures that assumed transient startup state. The plugin fixture now waits for the lazy sidebar's existing Plugins link before its unchanged registration assertion. The image-handoff correction landed independently in #157202 and is inherited from main; it no longer requires a completed 180ms animation class to persist; real animation-event and lifecycle tests retain that contract, and every image/frame/handoff/identity assertion remains. Baseline cohorts passed 33 and 19 cases locally, so those historical timing failures were source-traced rather than locally reproduced. Corrected native-plugin, handoff, and animation-owner files passed 8, 5, and 3 cases.
The Codex startup fixture introduced by #157229 advanced fake timers while catalog identity still awaited real filesystem I/O. Independent main fixes in commit
619405d49dddand #157258 now await actual close notifications while preserving the physical-exit assertions. The rebase retains those fixes and removes this branch's duplicate correction. During investigation, the original 23-file group reproduced the failure and a controlled filesystem-delay probe failed before and passed after our local correction. That historical candidate passed 20 standalone runs of 132 cases and three original-group runs of 830 cases; those runs are not claimed as current-head proof. One additional local run stopped before assertions because a concurrent type check generated SDK declarations; the checks were serialized afterward.The two composed SDK/Gateway scenarios consumed source code and fixture-owned minimal servers, but their generic E2E route built the entire private-QA/declaration runtime first. CI exceeded its 60-minute budget before assertions; the second of eleven build invocations alone took 3,026.8 seconds. The tests now use existing source Gateway projects, with relative imports, QA references, and the artifact fixture's existing isolated-lane registration updated. Every scenario assertion and hook remains. Planner checks confirm one owner per fixture and no global E2E build; ordinary source-worker preparation remains enabled. Historical E2E timing entries remain unchanged for frozen-target provenance.
The prior head also exposed a missing eager dependency in the PR-tooling extraction manifest, introduced by #157333. The final branch inherits #157394, which includes the plugin-state command contract. All of that contract's own imports are type-only, so the application worker implementation stays excluded. The missing-import baseline failed locally; the corrected three existing tooling files passed 235 cases with one existing skip (1,018.88s wall). The identical local manifest correction was removed during rebase. The iOS smoke failure was a Cargo download failure caused by DNS/low-speed errors contacting
index.crates.io, with no source compilation diagnostic.The earlier CI run on
d4de12310288(36032501735) completed with 165 successful checks and one underlying failure: the unchanged max-lines ratchet CLI received an extracontext canceleddiagnostic from TypeScript 7.0.2's native process shutdown. The sync API closes its transport and sends SIGTERM, racing the server's normal EOF shutdown. An unchanged 34-case local replay passed; it did not establish a repair. The exact upstream defect is already fixed in microsoft/TypeScript#64276, which is not in our installed 7.0.2. The temporary workaround is confined to this CLI test: allow at most one complete standalonecontext canceledline, then compare all remaining stderr exactly. Exit status and stdout assertions are unchanged. The comment links the upstream fix and names removal after upgrading. No dependency or production code is patched. Controlled CLI subprocess output fails the old assertion, passes with the single known line, and still fails for duplicate, partial, or unrelated output. Independent P2 review is clean. Twenty standalone runs passed 34 cases each. An initial 75-file replay on macOS failed seven Docker-fixture setups because nested temporary paths made 109-byte Unix socket addresses exceed macOS's 104-byte limit; the ratchet cases passed. Three unchanged 75-file replays then passed 1,805 cases with 7 platform skips each under the existing short temporary-root policy, in 177.255/173.596/165.599s. Source/config/selection/assertions remained unchanged. Local proof uses macOS/Node 26.9.0; the original CI used Linux/Node 24.19.0.The supporting Shared OpenClawKit Periphery workflow reports
GatewayExternalAuthorizationErroras unused on both Apple platforms. That type is absent from this branch and was introduced on newer main by #157454 as an iOS prerequisite; its PR explicitly defers the app-owned producer integration. No deletion, suppression, or unrelated authorization integration is added here. The enforced branch check isopenclaw/ci-gate; native admission remains authoritative.The initial CI attempt was deliberately deferred during Full Release Validation and resumed after its priority hold cleared. A later topology runner exited 143 with an explicit shutdown signal after its import-cycle check passed; no topology assertion failure was reported. Subsequent CI ran that check successfully.
Focused test costs
Measured locally with one worker unless noted. Codex fixture rows describe the historical correction, now superseded by the independently landed main fixes. Command wall includes startup, transforms, and fixture setup.
The final Pool RPC cases total 39ms of test execution; their cold wall includes 29.691s of source-worker preparation. The two new authority cases use the real request router so a helper-only test cannot conceal a missing bound authority guard. No real timers, polling, or per-case Gateway boots were added. The source SDK run includes 19.833s of cold worker compilation; SDK and artifact test bodies measured 16.198s and 25.954s. Codex stability proof ran on macOS/Node 24.21; the original failing CI group used Linux/Node 24.19.
Hosted Pool UI evidence on the earlier
4a06950head: 8/8 passed, 445ms summed cases, 445.24ms native diagnostic duration, and 722.46ms queued-to-module-end interval. These are not standalone command wall. The feature's Pool source is unchanged. Final required hosted CI passed on7d6a0a9bec0c.