Repository navigation
fix(workers): retain admitted GitHub operator authority - #192540
Conversation
Co-authored-by: galiniliev <[email protected]>
|
🦞👀 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. What this changesThis PR retains the admitted operator authority in the existing worker GitHub grant and revalidates it before credential delivery. Example: An operator sends a repository-bound worker turn, and chat.send finishes before worker preparation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current worker authority-lifetime defect without introducing a verified correctness or security regression; required CI remains red with unresolved failure attribution. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway converts an admitted run and its selected GitHub identity into a turn-bound credential grant, delivers credentials to the worker, and releases the grant during settlement. flowchart TD
A[Authenticated operator request] --> B[Admitted run authority]
B --> C[Worker GitHub grant]
D[Live operator and turn checks] --> C
C --> E[Worker launch and heartbeat]
E --> F[Private worker GitHub profile]
C --> G[Settlement and release]
Technical reviewBest possible solution: Retain the original source in the existing grant owner, preserve final-effect revocation checks, and land after required CI is resolved. Do we have a high-confidence way to reproduce the issue? Current main omits original-operator retention at the grant boundary; supplied negative controls and runtime receipts support the failure path, though this read-only review ran no reproduction. Is this the best way to solve the issue? The repair uses the existing grant's lifetime, cancellation, validation, and cleanup owners without adding parallel authorization machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5b5a964d2cbd. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +23, Tests +887, Other +7. Total +917 across 15 files. Added test files: 3. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed November 4, 2026, 6:22 AM ET / 11:22 UTC (Revision 4). |
Address hosted review with production-owner proof and preserve current authority and lifecycle ownership. Co-authored-by: galiniliev <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Repair the exact PR-caused CI bookkeeping failure; production and behavior-proof code remain unchanged. Co-authored-by: galiniliev <[email protected]>
Exercise real Gateway and worker launch/profile effects after the original request completes, revocation, cancellation, and a legitimate successor. Preserve explicit QA password selection for trusted-proxy fixtures. Co-authored-by: galiniliev <[email protected]>
Retain auth bootstrap input draining while allowing capture-only Gateway fixtures to terminate before readiness. Preserve environment and lifetime assertions. Co-authored-by: galiniliev <[email protected]>
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
) * fix(workers): retain admitted GitHub operator authority Co-authored-by: galiniliev <[email protected]> * test(workers): exercise retained GitHub authority through token delivery Address hosted review with production-owner proof and preserve current authority and lifecycle ownership. Co-authored-by: galiniliev <[email protected]> * test(workers): preserve canonical Gateway test ordering Repair the exact PR-caused CI bookkeeping failure; production and behavior-proof code remain unchanged. Co-authored-by: galiniliev <[email protected]> * test(github): prove initial worker credential delivery Exercise real Gateway and worker launch/profile effects after the original request completes, revocation, cancellation, and a legitimate successor. Preserve explicit QA password selection for trusted-proxy fixtures. Co-authored-by: galiniliev <[email protected]> * test(qa): bound stdin draining to auth capture commands Retain auth bootstrap input draining while allowing capture-only Gateway fixtures to terminate before readiness. Preserve environment and lifetime assertions. Co-authored-by: galiniliev <[email protected]> --------- Co-authored-by: galiniliev <[email protected]>
Keep distinct route, ordering, trigger, publication, custody, and fixture-lifecycle contracts from openclaw#192769, openclaw#192540, openclaw#192250, openclaw#192812, openclaw#191643, openclaw#192584, openclaw#192588, and openclaw#192083. Raise only the scalar by the exact measured inherited deficit; production and test LOC remain unchanged.
Port only the applicable test-fixture correction from #192540. Keep capture-only Gateway fixtures from waiting on their inherited lifeline while preserving auth bootstrap input draining. The second source-root helper does not exist on this baseline; unrelated worker-authority changes are not included. Proof: the unchanged capture fixture timed out at 120s; after the correction all 48 gateway-child consumers pass. Scoped format, lint and diff checks pass. (cherry picked from commit e0a67d8) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes: worker GitHub access can lose the operator authority from its admitted run when later grant preparation no longer has the original caller context.
User Impact
Admitted worker runs retain their original operator authority for GitHub access. Revocation still stops launch or refresh, and existing cleanup releases the retained authority. Missing authority is not promoted to synthetic authorization.
Why This Change Was Made
Pass original admitted authority into the existing GitHub grant owner, which retains and revalidates it and composes its abort signal with the current turn. Keep grant lifecycle and cleanup with that owner.
Evidence
Retained authority and refresh
worker-github-binding.authority-wire.test.tscovers real admitted-request capture/release/retention, SQLite exact-turn binding, worker credential installation, production refresh dispatch and WorkerConnection delivery.Actual initial launch after public request completion
New committed runtime test passes 3/3 against a real built Gateway, public authenticated admission, production node invoke/workspace/bundle/supervisor owners, real WorkerConnection, and a real worker child:
chat.sendACK completes before the held noncredential preparation request resumes.executeWorkerTurnand the production launch deliver the initial credential; the worker creates its realhosts.ymlprofile and reaches the provider. The profile disappears after settlement.users.setRolewhile preparation is held. No credential-bearing launch, worker credential profile or provider request occurs for the original turn.chat.abortsettles the old turn without credential delivery; a legitimate successor receives its own binding, runs and cleans up.There are no manufactured grants, admission mocks, manual token-frame sends, direct credential-installer calls or direct pairing-store writes. QA password plumbing uses the existing GatewayClient password contract, allowing documented trusted-proxy admission plus authenticated local administration without changing core auth or disabling guards.
Source qualification and local gates
8bc44540c46d8d1e3d80800c7ea1b11277c2db02plus this PR's existing production delta and the eight new proof files, under the supported network-none runner. Exact source digest and complete assertion/output receipt appear below.b6287c8675cf14ef42e7385130fc4f8fff32fc2d(composition tree676dbdbd53221852a942383f498cb98528a83ff0). The runtime receipt retains its actual executing source; it is not relabeled as a head-alone replay.paste-api-keybootstrap command; no timeout or cleanup assertion was weakened. Both formerly failing cases pass (718ms / 229ms) while auth bootstrap still drains its input.Limits
External GitHub HTTPS and model/provider responses are synthetic. The node test host executes production owners but is not a separately launched node CLI. This does not claim live GitHub, external model, cloud-worker or publication qualification. The preparation hold is before grant construction, not a prepared-retained-grant pre-send race; the existing retention/heartbeat tests provide that complementary authority-lifetime coverage.
Reproduction
Sanitized runtime receipt and source hashes
Exact-head CI attribution (run 41817860361)
CI remains failed, not green. The completed 92-job attempt has two non-aggregate failures; security-fast passed. CI tested merge
ddc77ed2d8af7c9b78d7400e122296211372244e, with exact base490aff93f1073897caff7c6db6909375c1b4ea00and this PR heada46198f6a0b32b19e18b78945b6a43ca62d9a7b4.gateway-kill-restart-send.e2e.test.ts:137:88expects no provider requests after restart but receives two. Supported isolated qaRuntime/pinned-Bun replays on both the exact base and merge reproduce the same assertion. The PR delta is not needed to produce it; the underlying original cause is not repaired here.Both local runs used exact-lock dependencies, qaRuntime and CI's pinned Bun; build/launcher Node26.12.1 differs from CI24.22.1, and local selection was serial rather than a whole CI shard. All owned test containers were removed. These limits are retained in the inherited-failure admission evidence; no assertion, timeout, baseline, credential, review, or security gate was changed to make CI green.