Repository navigation
fix: preserve gateway administrator permissions across native UI clients - #194443
roboclaw-bot merged 12 commits into
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 Summary: ✅ CompletedThis 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. |
✅ Maintainer security changes approvedA maintainer approved this revision with an explicit security approval comment.
A later push requires a fresh approval comment for an external contributor's PR. |
|
Codex review: needs maintainer review before merge. What this changesThis PR extends browser administrator delegation to authenticated native UI clients and preserves it through automation recovery and continuations. Example: An authenticated openclaw-macos administrator repairs a disabled automation owned by another conversation.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR delivers approved native administrator parity that current main still lacks, with no actionable findings in the reviewed diff and current-head security approval recorded. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway translates authenticated UI requests into run-bound authority; automation admission, recovery, and tool execution consume that authority before accessing jobs or performing effects. flowchart LR
A[Authenticated native UI] --> B[Gateway request admission]
B --> C[Operator authority]
C --> D[Automation management grants]
C --> E[Recorded recovery source]
E --> D
D --> F[Cron service and guarded effects]
Technical reviewBest possible solution: Land the approved native UI delegation through the existing admission, recovery, and grant owners while retaining caller caps and requester isolation. Do we have a high-confidence way to reproduce the issue? Current-main admission demonstrably requires the browser-specific management flag, matching the native inventory differences reported in #139586; this review did not execute a reproduction. Is this the best way to solve the issue? The implementation extends existing classification and authority owners, preserves browser identity separately, and carries the same bounded delegation through recovery without introducing a competing permission system. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3cce42d18562. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +83, Tests +619, Docs +24, Other +19. Total +745 across 36 files. Added test files: 3. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
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 17, 2026, 5:08 PM ET / 22:08 UTC (Revision 4). |
|
@clawsweeper — Contributor clarification: ad-hoc signing is the signing path I can provide for local native-app validation. Please do not make access to a shipped/distribution-signed build a contributor prerequisite for this fix. If distribution signing itself is material to the authorization behavior, please identify the concrete dependency and leave that verification with a maintainer who has the necessary build/signing access. This is not a claim that the remaining end-to-end proof has been completed: it has not. The PR records the fixture-authenticated regression evidence separately from native-client → WebSocket → real-model evidence. Ad-hoc signing must not be represented as distribution signing, but it should be an acceptable basis for locally exercising the native entry point. Please assess the current head and its updated regression evidence on that basis. Existing scope ceilings, revocation/final-write requirements, and current-head maintainer security approval still apply; this request is not a waiver of those checks. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Prepare the reviewed canonical grant type and recovery regression bytes for native baseline materialization. Current-main integration and exact-head secretless validation remain pending; this source is not a ready publication candidate. Co-authored-by: sallyom <[email protected]>
Baseline-Refresh: 762fcc2e63f62eff4e4bc3b9689a7f655ffb07d5 Co-authored-by: sallyom <[email protected]>
Retain the current-main optional authenticated profile return contract alongside native automation administrator delegation. Current-main integration and exact-candidate secretless validation remain pending. Co-authored-by: sallyom <[email protected]>
Baseline-Refresh: 90fe77b53215b4f98abe5f6f4273c0353c6bdd68 Co-authored-by: sallyom <[email protected]>
|
/allow-security-sensitive-change |
Move the existing native cases to their own database-worker test owner using the shared recovery fixture. Preserve every current-main generic recovery regression byte-for-byte, without raising or suppressing the max-lines rule. Production source is unchanged; exact-head affected isolated proof follows publication. Co-authored-by: sallyom <[email protected]>
Baseline-Refresh: 1a87ad06f2a53fad43196e246d92be0e160c9e2b Co-authored-by: sallyom <[email protected]>
|
/allow-security-sensitive-change |
Adapt the injected read operation to the optional AbortSignal contract and pass the signal through Node filesystem options. Keep production code and final-write revocation assertions unchanged. Co-authored-by: sallyom <[email protected]>
Drop a full-plan job worker default from a selected projection only when every retained child already has an equal or narrower worker pin. Preserve the executor intersection, process boundaries, capacity and deadline policies while allowing compatible selected jobs to share setup. Co-authored-by: sallyom <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/allow-security-sensitive-change |
Security review rationaleReviewed head: The intended contract is that the same authenticated administrator, with the same effective scopes and policy, has the same Gateway permissions through browser and native UI clients. Client type alone should not determine administrative privilege. The security considerations reviewed were:
No weakening of the existing authentication, authorization, caller-policy, or revocation safeguards was identified in the completed review. The change makes existing UI administrator capabilities available through equally authorized native UI connections, including their explicitly recorded continuations; it does not make all native connections privileged. The required checks and current-head sensitive-security approval are green on the reviewed head. Main CI passed, including the previously failing planner, typecheck, and Android lanes. The refreshed review reports no actionable findings. This documents the reviewed security rationale. It is not an approval command, a claim of zero risk, or a waiver of enforced checks. |
What Problem This Solves
An authenticated native-app administrator could receive caller-scoped automation inventory and “not found” for another conversation’s job, despite holding Gateway admin authority. The invariant is same authenticated administrator, same effective scopes and policy, same Gateway permissions, regardless of Control UI or native UI client. Rendering features remain separate.
User Impact
User impact: native UI administrators can inspect and repair existing automations across conversations with the same effective scopes and policy as browser administrators. Caller-only caps, requester isolation, and live revocation remain enforced. The maintainer direction endorses native UI administrator parity; security approval is evaluated separately for each head.
Why This Change Was Made
Evidence
Current selected-CI-planner repair — November 17, 2026
Current head:
0c556757a1f98d9ea265d3612b2d833cdf086c3f, parentc9258372212581d58b3454b9c4911a02fe1365c9. The integrated-main baseline remains2b9b23b9f3afbd8ebb233c097e13b847df0b73a3; no additional main refresh or ancestry rewrite was performed.min(job, child)intersection: a job cap above an unpinned or wider child remains authoritative. Other environment values, process boundaries, worker limits, memory floors, timing identities, prices, capacity rules, and deadlines are preserved. Native authorization production code and both recovery test registrations are unchanged.2bda603d…fails while its exact main parent passes. Applying the final repair makes that same merge’s serial-sharing regression pass under the checksum-pinned Bun fork. Candidate-snapshot checks pass 220 planner/selection/command tests across four files, plus the executor worker-ceiling case; the tooling caller type graph and both targeted lint groups pass. Final formatting and test budget pass. These are batched snapshot checks, not a single all-green command or remotely executed new-commit-SHA claim. The three checked Git blobs exactly match this signed commit.All earlier evidence below is historical and scoped to its named head.
Prior upstream-fix integration and adapter repair — historical
Current head:
c9258372212581d58b3454b9c4911a02fe1365c9. Integrated main:2b9b23b9f3afbd8ebb233c097e13b847df0b73a3(upstream lint fix #200685). This is the smallest authenticated main baseline containing the requested fix, integrated without rewriting contributor ancestry; no later-main refresh was added.3207881c907f34f6822e27005e16d6a3cc256850preserves every prior product blob from8eed13bc, with no conflicts. The generic recovery test exactly matches the selected main; all six native cases remain in the separate 61-line database-worker owner. The inherited expiry test now uses the upstream fixedusing _binding.readFileoverload against later main’sreadFile(path, signal?: AbortSignal)operation contract. That failure is retained, not relabeled inherited or green.shares selected serial setup within the shortest contributing timeoutatci-node-test-plan.selection-capacity.test.ts:404(expected shared serial selection to be defined). Fresh isolated attribution, using the same checksum-pinned Bun fork, reproduces the failure on actual CI merge2bda603d128bbf72dbb2899e9718fee4ff94692ewhile its exact main parentea94eb3bd38e29d17df08a957a08fa2866355110passes. This is an interaction with the PR-added recovery test inventory, not inherited main noise. The required planner/routing integration repair remains unresolved; no assertion was weakened, recovery lane removed, or expected-failure exception added.All evidence below is historical and applies only to its named head.
Prior 8eed13b lint repair — historical
Current head:
8eed13bc75f6276a3e95c93aba5f8da0f755d0b9. Predecessor:94082876686eacd2efb845f0796a0ded0bb6626a. Integrated-main baseline remainsbb45ba99390c80784ca50d1b07f150b72cd57b7d.The PR-caused max-lines finding is fixed and its focused proof passes. CI is not clear or waived: the fresh CI run encountered a separate lint error inherited from its later main-side merge base, described below. No merge readiness or security approval is inferred from the code-review result.
operator-run-recovery.native.test.ts, using the existing shared fixture and native database-worker lane. The entire generic recovery test now byte-matches the integrated main, including every generic retired-claim final-write, device/profile-custody, and key-linked lifecycle regression. No test was deleted or weakened; no max-lines limit, suppression, ignore, or baseline exception was added.94082876. Its successful full production build and unrelated proof are reused for those unchanged inputs, not relabeled as new-head execution. No redundant full production build, new native-app/model E2E, distribution-signing, or TCC-persistence claim is made. Contributor ancestry and Sally’s credit remain intact.331af13a658497fea8a806141b102c5bea859094combining this head with main3777fda157ff9bddfce7a0d083aba8291d70602c. Its core lint job failsno-underscore-dangleforusing _warninginsrc/agents/subagents/registry/subagent-result-owed.expiry-discard.test.ts:53. That file is absent from this PR head and has identical blob316a46d24e48e8fe9e2f61cc26c4b71846c388b7in the CI base and tested merge; their lint-rule/toolchain inputs are also unchanged. This is a later-main inherited failure, not the repaired native recovery lint issue. Upstream fix #200685, commit2b9b23b9f3afbd8ebb233c097e13b847df0b73a3, merged at 16:29 UTC after this job had failed. No unrelated source fix, later-main integration, rerun-for-green, or CI waiver was made here. This run is not represented as clear.94082876approval is historical and does not approve this commit. Fresh current-head recognition remains a separate required gate. No security-approval command, security-rationale comment, merge, auto-merge, or deployment was posted/performed by this repair.All evidence below is explicitly historical and remains scoped to its named head.
Prior 9408287 refresh and review — historical
Reviewed and published head:
94082876686eacd2efb845f0796a0ded0bb6626a. Integrated main:bb45ba99390c80784ca50d1b07f150b72cd57b7d.Not yet merge-ready: fresh targeted lint found one integration-caused
max-linesfailure in the generic recovery test. The approved head is preserved while that required repair is reported; no test, limit, or failure has been hidden.pnpm buildpassed, including Gateway, public declarations, and Control UI; 357 tests passed in 15 files across four Vitest shards (579.40 seconds); all five affected core/test type graphs passed. Production lint and the remaining gateway-methods, cron, and tooling lint groups pass. Formatting passes for all 33 changed supported files; whitespace and unchanged tracked-tree checks pass. The per-change test-line budget passes: 600 net LF lines, 400 ordinary allowance, 200 allocation credits. These are fixture-authenticated production-boundary checks, not new native-app/real-model E2E proof.src/gateway/operator-run-recovery.test.ts:1079has 1,039 counted lines against the 1,000-line limit. The exact integrated-main file passes the same canonical lint command in the isolated checkout; this head’s original file was restored byte-for-byte after that comparison. The existing native-specific recovery cases should be moved to their native test owner using the already-shared fixture, without deleting or weakening the generic retired-claim final-write regression. The initial isolated run exits 1 for this failure. The separate remaining-check run passes; it does not turn the failed required lint check into a pass. No contributor code ran on the maintainer host.openclaw/security-sensitive-reviewreports success via the approval-event run. No additional commit has replaced that approved head. Any required head-changing repair needs fresh current-head approval afterward. No security-approval command, security-rationale comment, merge, auto-merge, or deployment was posted/performed by this update.All earlier evidence below is retained as historical proof, not substituted for the exact-head checks above.
Earlier November 17 integration and verification — historical
Historical head:
f31e6ff01f633fa825ad97c0045567506b3ac7d1. Integrated main:4cbd215af463775faa6807aea90621292b28af15.pnpm build(Gateway, public declarations, and Control UI); 235 tests in 10 files across three Vitest shards; core typecheck plus the four affected gateway-root, gateway-methods, services-cron, and root-tooling test type graphs; targeted lint for all 32 changed code files; formatting for 33 changed supported files; whitespace checks; and a final unchanged tracked-tree check. The focused tests took 248.99 seconds. These are fixture-authenticated production-boundary tests, not a new native-app/real-model E2E claim. No contributor code ran on the maintainer host.extensions/openclaw-id-access/browser/recovery-uses.e2e.test.ts, which is absent fromuiE2ePrivateServerTestFiles. The file entered main through feat(openclaw-id): members can recover access with a recovery kit #200145. All scannedui/andextensions/sources, the assertion/support module, UI test configurations, parser, and CI node-plan owner are byte-identical between integrated main4cbd215aand this head. This is an inherited main inventory defect, not an authorization-test failure. The exact-baseline CI run was cancelled, so no passing baseline replay is claimed. No unrelated fix, expected-failure exception, budget adjustment, or rerun-for-green was made; broad CI is not green or waived. Execution approval was not the separate sensitive-security approval. No merge or deployment was performed.The November 6–7 evidence below is retained as historical proof, not substituted for the exact-head checks above.
Historical review repair head:
1d59863f8e6155adb544bb806acf134706c91c0e.Review repairs and expanded proof — November 7, 2026
pnpm check:madge-import-cyclesnow reports 0 cycles, versus 1 cycle on the reviewed head. Runtime authorization logic is unchanged.operator-run-recovery.effects.test.tsnow takes a serialized native snapshot through a persisted CronService row, the production job target and failure-repair event owners, admitted child authority, and a host-bound file write. An allowed write persists; device revocation, email reassignment, and reassignment-then-restoration during the next held write reject it, with the file unchanged. This extends and relocates existing final-effect cases rather than duplicating them.sessions-provider-review.integration.test.tsexercises the real Gateway router, scope/session authorization, acknowledgment owner, and worker SQLite compare/commit. An authorized native writer clears the exact pause. Read-only, foreign-owner, and non-UI callers never reach runtime handoff; device revocation at commit leaves the entire session entry unchanged. External model acceptance is a fixed fixture: this is production-boundary proof, not a live native-app/provider E2E claim.[email protected]store writer created a disabled synthetic automation. Supported backed-up Doctor migration and current-sourceloadCronStore/CronService.list/updatepreserve its authored prompt, disabled state, creator, owner, delivery, interval, and unrelated fields. Exact whole-store comparison permits only verified canonical metadata additions: every-schedule anchor, owner profile from stored creator, and versioned account tool policy from stored owner. Subsequent service update persists without changing unrelated fields. This proves the released-store → Doctor → current-service boundary, not a full native-package upgrade. No jobs or Gateway ran. Existing dependencies were reused without installing packages or overriding install policy.Focused validation: 154 tests pass across separate runs, not one all-green monolithic suite: recovery 43, recovered final effects 3, provider-review final effects 5, automation transports 15, scheduled-session custody 15, cron-context replay 13, and CI source-owner routing 60. Recovery effects took 43.69 s including compilation (3.97 s summed cases); the new provider-review cases initially took 45.81 s including compilation. Scheduled-session custody took 10.79 s (12.44 s wrapper). CI execution seconds for these new files are pending.
The first combined replay exposed the extracted recovery file running in an incompatible thread pool (host database broker unavailable). Registering it in the existing database-worker lane resolves that setup failure; the corrected effects shard and routing suite both pass. The repaired files pass focused lint, formatting, whitespace checks, and the affected type graphs. Regression check: substituting the pre-generalization job target (
a43f5e814047) and original provider-review handler (d482d7616512) produces four intended failures: missing recovered native owner authority and native continuation denial. Restoring the reviewed repair makes 8/8 pass, Vitest 41.34 s / wrapper 45.61 s. No setup failure is counted as negative authority proof.Fresh independent autoreview, Codex, P0–P2, covers reviewed head
697096f44c77820f7fde61cc005bd425a8227513→ the complete local repair snapshot, including untracked test files and the database-lane registration: scoped-clean, no actionable findings. It inspected supplied source/context and did not execute project tests. The helper's first preflight refused a shared temporary directory; the completed run used the OS-reported private macOS temporary directory without disabling isolation.Test growth is allocated explicitly: 463 net LF lines across the complete PR for distinct admission, recovery/continuation, forbidden-caller, revocation, and final-effect contracts. The shared test-line scalar is unchanged. Existing authority and persistence owners are reused; the handler-type dependency is removed and no parallel policy registry is introduced.
Upgrade-proof side effect: Doctor also cleaned 3,387 recognized obsolete files in its shared temporary archive-read cache. Source inspection confirms it targets that cache, not original archives; no live Gateway or configuration changed. No further Doctor runs were performed.
Inherited test-line ratchet failure (not waived or masked): the clean merge base
d482d7616512independently reports6,552,043LF lines against ceiling6,551,994(49 over, delta 0). This head reports6,552,506against6,552,457(49 over, delta +463). The PR adds exactly 463 lines and 463 allocation credits; it does not increase the inherited debt. The ratchet command still exits nonzero on this positive-delta branch. No unrelated tests, scalar baseline, or extra debt credit were changed. Broad exact-head CI remains to be assessed.Updated real-app proof — November 6, 2026
Main proof uses the normal, web-backed Mac app interface, not the experimental native SwiftUI chat. Experimental-native results from earlier preparation are supplemental only and are not substituted for the normal-interface results below.
Provenance and signing
697096f44c77820f7fde61cc005bd425a8227513.2026.10.4, source metadata3561a19c06ec0294c022b7b0ca3829a073f52ef5, copied into a separate proof bundle and explicitly ad-hoc re-signed. Its client revision is older than the Gateway; this is not an exact-head native-package build claim.local.openclaw.pr194443-installed-proof.codesign --verify --deep --strict --verbose=2reported valid on disk and satisfies its Designated Requirement.client=openclaw-macos,mode=ui,role=operator; it was not replaced by a script claiming that client name. The real model invoked the production OpenClaw automation tool through a normalchat.sendturn./Applications/OpenClaw.appbundle were not modified or restarted.Signing constraint: Ad-hoc signing is the signing path available to this contributor. This evidence does not claim Developer ID/distribution signing, notarization, or TCC permission persistence. Please assess the observed native authentication/authorization chain on that basis; if distribution signing itself is a material dependency, identify it and route that additional verification to a maintainer with distribution-build access.
Normal-interface observations
STANDARD-MAC-ADMIN-PR194443-VERIFIED; the job remained disabled.tools.gatewayPolicy.automations.scope: "caller"cron job not found. Persisted job state was unchanged and disabled.devices revokeCLI revoked the proof device’s operator authority while that run was active. The Gateway terminated the original run withoperator source authority is no longer activeand stopped model fallback because the caller signal was aborted. After the timer deadline, independent persisted-state comparison showed the entire job unchanged; the attempted new marker was absent.Sanitized Gateway receipt for the passing revocation run:
The shared-bootstrap-token app subsequently reconnected/re-paired. That did not restore the original run’s authority or persist its attempted update. This live case proves in-flight revocation before the delayed tool call; it is not represented as a write already held inside Cron’s commit guard.
Earlier revocation setup attempts used an insufficiently scoped generic RPC client or omitted the explicit credential required by a URL override. Those attempts are not counted as negative proof; an earlier timer completed without a successful revocation. The passing case above used the supported device-management CLI with explicit, disposable proof-Gateway credentials. No credential values or private endpoints are included here.
Additional live scope-demotion proof — November 6, 2026
A second disposable loopback fixture used the same PR-head Gateway and the identified installed
2026.10.4client, copied to bundlelocal.openclaw.pr194443-demotion, ad-hoc signed and strictly signature-verified. The normal web-backed Mac app interface was used; experimental native experience remained disabled.DEMOTION-ADMIN-CONFIRMED, and read it back.DEMOTED-MUST-NOT-PERSIST.devices rotateCLI narrowed the proof device’s operator token tooperator.read,operator.write, removingoperator.admin, approvals, questions, and pairing. This was scope demotion, not device removal or token revocation.operator source authority is no longer active; fallback stopped withcaller_signal_aborted. The app subsequently reconnected, but that did not restore the original run.effectiveAgentIdandstatusfields; those are not treated as stored mutations.This proves live scope-demotion propagation to an in-flight native-app model run before its delayed tool write. It does not claim a fresh non-admin model turn, a write already paused inside the Cron commit guard, persistent denial after a new bootstrap-authenticated reconnect, or distribution signing. No live operator Gateway, installed app bundle, or real automation was changed.
Earlier-head automation final-write boundary proof
Re-executed on
697096f44c77820f7fde61cc005bd425a8227513:pnpm test src/gateway/server-methods/cron-creator-transports.integration.test.ts --maxWorkers=115/15 passed; Vitest wall time 66.86 s, wrapper 70.65 s. This in-process suite uses fixture-authenticated connection facts and production admission, automation tools, and Cron handlers. It independently covers admin success, explicit caller-cap denial, native
operator.writewithout admin denial, and device revocation while the update is held in Cron validation: resumed final write rejects and stored state is unchanged. It complements, rather than substitutes for, the real-app evidence above.Earlier same-head focused validation: all 68 recovery/reconnect/session-run checks passed after correcting a fixture to publish production revocation rather than merely rotate a token. Seven other focused files passed in the preceding broader run. This is combined focused evidence, not one all-green monolithic suite. Core typecheck, focused lint, formatting, and whitespace checks passed. Current proof also built the Gateway runtime and Control UI successfully.
Base reproduction and earlier narrow proof remain at
d482d7616512,c13ab576c5059102aa143ec3355540bdf2d12422, anda43f5e81404718b2e15dd1379bbf885513c967c0; those are prior-head evidence, not substitutes for the current-head runs above. Independent local read-only review previously found no remaining P0–P2 defects; this is not an autoreview-helper-certified result.Remaining boundaries and gates
8eed13bc; its current-head CI inherited-base failure and per-head security gate are described above. No all-green/merge-ready claim or gate waiver is made; any new head requires fresh security approval. No merge or live deployment was performed.Simplification: existing classification, run-authority, and recovery owners are reused; browser identity is not widened and no competing authorization registry is introduced. The current test allocation and verification are recorded in the November 17 evidence above.