Repository navigation
feat: prepare cloud workers for enterprise repositories - #160108
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
79c1e7a to
27bfdfb
Compare
|
Codex review: needs real behavior proof before merge. Reviewed October 2, 2026, 11:22 AM ET / 15:22 UTC (Revision 31). ClawSweeper reviewWhat this changesAdds GitHub Enterprise repository discovery, saved New Session repository defaults, and presence-driven cloud-worker preparation with host-aware credentials, publication, and recovery. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 9 items remain Keep open: the prior Azure diagnostic finding is repaired, but a newly identified presence-revocation defect blocks merge. The Enterprise preparation capability remains distinct from current main and the related identity-delivery PR. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway combines repository settings, GitHub credentials, and authenticated Control UI presence to prepare cloud workers. Those workers receive repository content and later serve session execution, while the UI displays repository and pull-request information. flowchart TD
A[Repository settings] --> C[Gateway repository admission]
B[Authenticated browser presence] --> D[Prepared worker pool]
C --> D
E[GitHub credentials] --> C
D --> F[Cloud provider and Git transfer]
F --> G[Session worker]
C --> H[Repository picker and PR details]
Before merge
Findings
Agent review detailsSecurityNeeds attention: Browser authority invalidation does not immediately revoke cached preparation demand. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Bind preparation demand to live session-creation authority through revocation and final effects, preserving idle-grace semantics and verifying existing-state upgrades. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a focused path: pause presence preparation, invalidate the last eligible browser before registry removal, then resume; the cached presence generation still permits reserve admission. This review did not execute that path. Is this the best way to solve the issue? Unclear until the revocation defect is repaired; extending the existing repository, credential, and pool owners is coherent, but registry membership alone cannot represent current browser authority. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f0f0e3aa47bb. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What 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 (30 earlier review cycles; latest 8 shown)
|
|
c83b792 to
bd7ac6a
Compare
fd0e48a to
be8058f
Compare
0cd7374 to
7f3ec73
Compare
|
@clawsweeper re-review Current head: |
Co-authored-by: galiniliev <[email protected]>
Fence presence on policy invalidation and keep pool cleanup and activation-backed refill independent of repository admission. Preserve explicit destinations and supported Git URLs, bind Actions reads to their public issuer, and retain search quota cooldowns. Co-authored-by: galiniliev <[email protected]>
Share the provider cleanup allowance across normal stop and fixed-lease recovery, retaining the original failure when no time remains. Cover elapsed and exhausted budgets with mocked-clock regressions. Co-authored-by: galiniliev <[email protected]>
|
Merged via squash.
|
What Problem This Solves
Private GitHub Enterprise repositories need a complete discovery, New Session default, and prepared cloud-worker workflow that remains bound to the selected host, repository, and current authority.
User Impact
Operators can configure
gateway.github.host/gateway.github.apiBaseUrl, select a default repository throughgateway.projects.defaultRepository, and use the existingcloudWorkers.projectProfilesmapping to prepare capacity while an authenticated, session-creating Control UI browser is connected. Readers do not receive the private default or sustain preparation. Unused reserves retire after the last eligible browser leaves; active sessions retain their workers.Explicit user destinations and accepted HTTPS/SSH/SCP Git URLs are preserved. Session PR data follows the recorded repository host, while public OAuth, public Actions capabilities, and sign-in identity lookup remain bound to github.com. Enterprise service credentials must declare their matching host; native discovery is an explicit opt-in.
Worker-side stock GitHub-client authentication is separately tracked in #157500; transferring repository content does not claim that dependency is complete.
Why This Change Was Made
The existing repository, identity, preference, preparation, and transport owners carry the configured host throughout discovery and preparation. Private/Enterprise source is transferred as an authenticated pinned Git pack, without embedding tokens in worker images or setup files. Host/credential-scoped caches and final-effect checks prevent stale configuration or revoked authority from authorizing new work.
Presence follows canonical client invalidation, not only socket removal. A held or failed repository admission does not block unrelated cleanup or independently authorized refill. Actual activation timestamps are tracked separately from newer spare-worker demand and scoped to the exact preparation generation.
Demand uses a key in the existing SQLite machine-state table and its read-worker/write-broker owners. Remote choices use existing authenticated per-person preferences, not shared browser fallback. No SQLite schema, updater, package/lock, or checkpoint-path change is authored by this PR.
Evidence
Current candidate:
99502c3ca1c0bbb165719de3bf5331ec74c0d87b, rebased onto main60e849f1a4aa2101382883e91e97f87aaf297451with contributor history preserved. The original six-fix commit remains patch-identical. Conflict resolution retains main’s Git-cache ownership, bootstrap subprocess cleanup and sanitized diagnostics while preserving Enterprise host binding and the verified worker-tool path. A follow-up correction keeps Azure force recovery within the original stop deadline.Current repair proof
Current rebase: 315 tests across 12 focused files passed in 264.06s (GitHub PR/host/cache readers, repository state, worker recovery and Crabbox lifecycle).
Deadline correction: both mocked-clock regressions failed before the fix; 77 tests across five stop/retry/error files passed afterward in 35.32s. Native independent review was scoped-clean through P2.
Core production types, plugin production/test types, targeted plugin typed lint, formatting and diff checks passed. One inherited max-lines failure remains in
src/state/openclaw-state-read.worker.ts: this PR only removes 18 lines from main’s already-over-limit file; no suppression or baseline relaxation was added.On prior published
cb7d9c2b6686c78b01fdafe90dacd1085310bda6: all 123 focused picker/default-selection/submission/worker-bootstrap/presence-effect cases passed in 63.37s, and all 10 real Control UI/mock-Gateway repository-flow cases passed in 31.35s. Core and UI production types, scoped typed lint/formatting, canonical config generation/check, and authored-diff sanity passed.Regressions failed before the fixes for browser revocation before reserve admission/effects, failed/held presence admission blocking cleanup, overwritten execution destinations, discarded SCP URLs, public Actions under Enterprise configuration, and lost search rate-limit cooldowns.
During the repair sequence, 304 integrated tests passed in 127.63s before the final activation refinements. The final pre-rebase repair tree (
64889c17e0b798420ca9795fd11c75fe41dc2c41) then passed 65 final-correction/registered Enterprise-boundary cases in 85.53s. Activation controls additionally cover a spare created after activation, the original activation deadline, and a different preparation generation. These are local production-owner and synthetic transport fixtures, not live cloud acceptance.All 10 actual Control UI/mock-Gateway browser cases passed in 29.84s wrapper wall. The explicit-destination case failed original source with
default-workerreplacingselected-worker, then passed after repair. Inspected synthetic before/after captures were delivered in the originating conversation. The UI repair is unchanged in this rebase.Pre-rebase staged checks passed: core/UI production types, all 27 core test-type graphs, lint, formatting, configuration and source guards, dead-export scans, and runtime import-cycle checks. Core lint retained three line-length warnings in untouched files and no errors. Affected types/lint/line-cap checks were rerun after the final two-file activation correction.
Independent native review identified the activation/refill gap, which was reproduced and repaired. Final pool review is scoped-clean at P0–P2 with source hashes matched during integration. A proposed Enterprise URL mismatch was rejected against the actual Gateway facade getter and passing Enterprise host-switch/registered-handler controls; the facade does not use the plugin's fixed public constant.
On prior published
dd93aa74d675090f58af64fbe17fa975bdd053e6: 91 focused cases across registered project methods, validated-handler authority, Enterprise search, public sign-in/roles, presence invalidation, private-Git lifecycle boundaries, and activation generations passed in 97.50s wrapper wall. Core production types and Gateway root/server/other test types passed, as did scoped typed lint, canonical config-baseline verification, and diff sanity.Additional prior-head (
dd93aa74d675) bounded checks: Dockerfile bootstrap/import closure (33), prepared-demand state-worker persistence/admission (5), and personal preference isolation/migration (28) all passed: 66 cases, 29.66s combined wrapper wall. These establish those local boundaries, not an image build, live provider acceptance, or an installed-driver upgrade/rollback matrix.Earlier scoped changed test-file cost samples: search 16 cases / 2.74s wrapper; read identity 44 / 23.86s (including 20.13s subprocess compilation); Actions board 27 / 11.73s; UI default-selection file 11 / 4.46s. Four activation ordering/expiry controls took 3.636s test-body time in their focused run. The attempt-1 Android test step took 414 seconds (Gradle 6m53s); changed-file-specific Node/UI CI timings were not present in the inspected failure evidence and have not been claimed. Prior-head CI is not current-head proof.
Remaining acceptance and landing status
At Galin’s explicit request, the failed jobs were rerun on unchanged head
dd93aa74d675090f58af64fbe17fa975bdd053e6. CI attempt 2 passed, including Android third-party and the required CI gate. Its complete inventory is 105 successful jobs and 12 skips, including successes carried forward from attempt 1; it was not a full reexecution.Attempt 1 remains evidence: one of 3691 Android tests timed out in progress-card fixture setup before recording/rendering assertions; the aggregate gate failed downstream. The unchanged third-party class subsequently passed all 113 cases locally in the same order. Neither that local pass nor the successful requested rerun establishes a code fix or the exact timing cause. No timeouts, assertions, or exclusions were weakened.
Fresh CI run 37128161104, attempt 1 passed on exact head
99502c3ca1c0bbb165719de3bf5331ec74c0d87b: 105 jobs succeeded, 12 skipped, none failed or pending. Both the Actions CI-gate job and the independently published requiredopenclaw/ci-gatestatus passed; dependency and security-sensitive statuses also passed. Android native 16-KiB, native 4-KiB, and third-party tests all passed on this head. This is new-head proof, not reused old-head green. The separate shared-kit iOS scan was still running at final verification; no claim is made that every broader check is terminal. The maintainer has explicitly requested landing.Earlier run
37094098348oncb7d9c2b6686failed on inherited recovery-test fixtures and Android native plugin resolution. Latest main now includes phase-based recovery-test correction4ec1118e7cc084651811ce52b5b4f2763df96e87, and the previously failing lifecycle file passes in the current focused run. The separate proposed fix #164029 was not merged by this task. The prior Android resolver failure did not identify an HTTP/DNS/TLS/cache cause; this rebase does not claim that failure was a product fix.The last independently audited automated ClawSweeper state was an input-safety hold on older
fefd70e9b6b5source; this rebase does not claim a fresh completed review. The retained diagnostic exposes only one of two findings, so complete-input review and any exact fixture qualification belong to the scanner host owner. No target-repository ignore or scanner bypass was added. The current native completion-marker check accepts the older review with a head-mismatch warning; it does not impose a score or 12-hour expiry. That acceptance is not a completed fresh review of this head. The earlier substantive presence-revocation finding is repaired and covered by the production-boundary tests above.Maintainer @galiniliev confirms validation in an existing deployment and explicitly requests landing. This is maintainer-reported deployment evidence, separate from the local and CI runs recorded above. This task did not independently rerun the complete authenticated Enterprise/Azure or published-driver fresh-install/upgrade/rollback matrix, and no exact external deployment revision/scenario inventory is claimed. No paid compute or live Gateway mutation was performed by this task.
Contributor
Original implementation and task direction: @galiniliev. Repair commits retain the verified human co-author credit.
Work sessions
Screenshots
Actual Chromium UI with synthetic data. Before: late repository discovery replaces the explicitly selected worker. After: the selected worker and draft are preserved.
Earlier source-bound UI evidence
The following captures document earlier repository-default, validation, ref-selection, and host-switch repairs. They are retained as historical evidence, not new execution of the current candidate.