Repository navigation
refactor: drop mid-request authority re-checks in bundled plugins and update/MCP sign-in (R6d part 2) - #204077
Conversation
… update/MCP sign-in (R6d part 2) Authority is checked once at start. Delete the remaining permission, role, scope and config re-reads in bundled plugins (Discord native commands and draft preview, geolocation, skill workshop, workboard, memory wiki, ClickClack account config), the update park requester re-check and the MCP sign-in scope re-check. Keep Stop, request close and data fences, reworded to say what ended and the next step. Co-authored-by: obviyus <[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. |
|
…s-part2 # Conflicts: # extensions/discord/src/monitor/native-command-auth.ts # extensions/discord/src/monitor/native-command.interaction-boundary.test.ts # extensions/discord/src/monitor/native-command.ts
|
Codex review: needs maintainer review before merge. What this changesThis PR removes repeated permission checks from admitted plugin operations, updates, and MCP sign-in while retaining cancellation and data guards. Example: An administrator starts MCP browser sign-in, then loses operator.admin while OAuth completes.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: the scoped cleanup follows the recorded one-admission policy, and review found no discrete introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway admission authorizes requests before plugin and update owners perform network, credential, or storage operations and return their outcomes. flowchart TD
A[Operator request] --> B[Gateway admission]
B --> C[Plugin or update owner]
C --> D[Cancellation and data guards]
D --> E[Transport or storage effect]
E --> F[Recorded result]
Technical reviewBest possible solution: Keep authority admission in its existing owners while preserving Stop, session, registry, and storage protections. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows the repeated scope and client-authority checks; no runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Removing the repeated predicates and their plumbing is the smallest scoped change using existing owners; the retained guards still distinguish cancellation and changed data from permission changes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7f6e113c68b4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -77, Tests -173, Other -5. Total -255 across 35 files. Added test files: 0. 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 Reviewed November 23, 2026, 8:58 AM ET / 13:58 UTC. |
|
Landed as 59ae4e0. Bundled plugins, the update park step and MCP sign-in no longer refuse a started request when a permission, scope or config changes; Stop, request close and data fences stay, with messages that name what ended. Proof: CI green on 4e5a9c1, local ClawSweeper review clean, one-admission E2E Q/R/S pass. Remaining R6d-2 scope (43 gateway string files, skill-library Stop split, worker reclaim plumbing, message-action wording) moves to part 3. |
… update/MCP sign-in (R6d part 2) (openclaw#204077) Authority is checked once at start. Delete the remaining permission, role, scope and config re-reads in bundled plugins (geolocation, skill workshop, workboard, memory wiki, Discord draft preview, ClickClack account config), the update park requester re-check and the MCP sign-in scope re-check. Keep Stop, request close and data fences, reworded to say what ended and the next step. MCP sign-in forced-effects tests now end the sign-in through the kept registry fence. Co-authored-by: Ayaan Zaidi <[email protected]>
…ate acts on it (#201668) * fix(update): verify recorded data-at-risk marks before repair acts on them * fix(update): verify any unverified data-at-risk mark and honor receipts in handoff recovery * fix(update): recognize a Git release-mode service as its checkout's own * fix(update): check a recorded data-at-risk mark before the next update, including already-current runs * fix(update): lead data-at-risk refusals with triage and record them on the refused run * fix(update): keep data-at-risk refusals within the recorded warning limit * test(e2e): finish the seeded data-at-risk run with a terminal phase * fix(update): name the agent route in killed-update recovery refusals * fix(update): drop an unused import * test(update): expect the agent route in killed-update refusals * fix(update): verify the newest mark before restoration without comparing run ids * fix(update): address review: keep the Gateway down on any inconsistent mark, resolve all marks, harden release ownership * fix(update): break the admission-root import cycle and type the e2e schema read * fix(update): address rating findings: agent rollback leftovers, helper restart, blocking findings first, shared Git metadata * test(e2e): prove the next plain update resolves a mark with the Gateway running * fix(update): address rating round 2: refuse marks before Doctor, registry-based rollback check, handoff fallback, async history read * test(update): pick the repair run, not a settlement row, in the data-at-risk cell * fix(update): resolve live-writer marks after Doctor holds the state * fix(doctor): say a skipped stale-Gateway stop left the PID running * fix(update): address rating round 3: leftovers before deferrals, retained rollback files, refusal after Doctor fails finalization * docs(update): note retained rollback files and refusals after Doctor * fix(doctor): say a stale Gateway stop could not be confirmed when nothing shows it running * fix(update): address landing review: revert release-mode ownership, check leftovers first, handoff entry guard, durable rollback evidence * test(update): follow main's Git release link layout in the launcher refusal test * fix(update): treat uninspectable leftovers and unreadable databases as unchecked; true wording after Doctor Release adaptation: Retain the stable installed-recovery harness. Do not add main's installed Docker service cell, later retired by #203808, or Git release-launcher wording/test because stable uses the in-place Git updater. Keep the state-verification, next-update, repair and interrupted-handoff paths and their compatible regressions. Companion audit: #203486 is present-equivalent at 3081077 (preserved). #201978 is selected next in this lane. #203808 and #203966 involve the inapplicable installed service-cell layout; #203497 and #203194 change main's package/Git activation layout and are not applicable; #204017 depends on that release-install layout. #204077, #204043, #203555 and #203520 are independent authority, cleanup, helper-fixture and config-validation changes. #204151, #203917, #203849 and #203406 are separate guidance, cleanup or status changes, not required by the data-risk verifier. #203569 fixes a separate cron receipt fixture in the same Doctor suite; the touched stale-stop cases do not depend on it. (cherry picked from commit a28f211) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f8d4bc138ed2512c413cf96f66fe0eefb3b28d65)
Problem
OpenClaw checks authority once, when work starts (AGENTS.md "Choose good compromises"). Bundled plugins and a few Gateway leftovers still refused started work with "authority changed" / "authority is no longer active/current". Some of these checks re-read a permission, role, scope, credential or config in the middle of a request. Others are valid Stop, run-close or data fences whose text claimed authority.
Change
R6d part 2, first half (split rule: ~65 production files remain in the area; this PR takes
extensions/**plus the R6b leftoversupdate-admission.tsandmcp-auth-login.ts). Each check was classified with one test: can it fire when only a permission, approval or config changes while nothing about the run or data changes?extensions/browser/.../pw-tools-core.interactions.navigation.tsextensions/clickclack/.../service-open.tsextensions/clickclack/.../service.tsextensions/codex/src/app-server/native-hook-relay.tsextensions/codex/src/node-app-server.tsextensions/discord/.../message-handler.draft-preview.tsretired) + channel policy re-readisPolicyCurrentplumbing deleted; retirement fence kept: "Discord retained progress ended. Start a new turn to retry."extensions/discord/.../native-command-auth.tsmainby #204048; this PR took main's version at the mergeextensions/geolocation/index.tsclient.invalidated,hasCurrentClientAuthority)extensions/google/research-gateway.tsextensions/knowledge/src/storage-protocol.tsextensions/memory-wiki/src/gateway.tshasCurrentClientAuthority()re-read deleted;active/signal kept: "Memory Wiki request ended. Start a new request to retry."extensions/skill-workshop/src/gateway-methods.tsextensions/telegram/src/telegram-ingress-non-retryable.tscallback-authority-changedreason deleted (no other producer)extensions/whatsapp/src/agent-tools-login.tsextensions/workboard/src/gateway.tsextensions/workboard/src/store-workflow.tssrc/gateway/server-methods/update-admission.ts+src/infra/update-managed-service-handoff*.tscommands.restartconfig re-read at park)retainUpdateRequesterAuthoritydeleted; the handoff'srequesterAuthoritycarries only the Stop signal; 7assertCurrent()reads removedsrc/gateway/server-methods/mcp-auth-login.tsclient.invalidated, admin scope re-read)Deleted tests (they asserted a mid-request permission refusal): geolocation/skill-workshop/workboard
hasCurrentClientAuthoritycases, ClickClack account-config change variants (before list, during create), Telegramcallback-authority-changeddrain case, the skill-workshop contract case inserver-methods.workshop-contract.test.ts, and the MCP sign-in "admin scope" variant. Stop and data-fence tests keep their conditions; only their expected text changed.The lifetime-check ratchet reports 0 counted strings in every touched production file.
config/session-identity-allowlist.txtis pruned (6280 → 6273 pins).Accepted edge cases:
commands.restartis disabled or the requester loses owner rights after admission. The start-time check inupdate.tsis unchanged.Not in this PR (part 3)
src/gateway/**listed in the R6d-2 list (agent-runtime-identity-token.ts…talk/client-run-authority.ts).src/skills/library/store-access.ts: split Stop (run close, claim loss, disconnect) out of the authority check, then delete the authority part.authorize/reauthorizeplumbing (placement-dispatch.ts,placement-reclaim.ts,server-worker-placement-reclaim.ts).src/channels/plugins/message-action-dispatch.tswording (cut less). It is a registration-lifetime fence, so only the text would change, but the local run showed 21 cases in 8 channel read tests (test/channel-message-read-authority,discord-metadata,feishu,matrix,slack-download,telegram-history,mattermost-read-authority.contract,message-action-dispatch.registry) assert the generic "no longer active" substring, mixed with other producers of that text. Rewording needs each assertion split by producer; it goes with part 3. Its read fence also ends a read on atrustedOfficialInstalldowngrade, which is an authority term to delete there.User impact
A started request, command, update or sign-in is no longer refused because a role, scope, credential or config changed mid-request; the change applies to the next request. Stop, disconnect, plugin reload and data changes still end work, with messages that say what ended and what to do next.
Evidence
pnpm tsgo:core,pnpm tsgo:extensions,pnpm tsgo:test: pass. oxfmt and oxlint on changed files: clean.ocx test(continue-on-failure) on 78 files: every touched test file plus every test that imports a changed source directly (the transitive test-support set is 162 files, over the 150 cap; CI runs it). Reds were only the message-action wording (reverted, see above) and one ClickClack mid-open config-change case (deleted); the 21 failed/invalidated files were rerun green.pnpm check:changed: typecheck, coercion and deprecated-API guards pass; its dead-export scan fails on exports this PR does not touch (pre-existing on main).mainafter the merge: +22/−99.4e5a9c1a1f43: "patch is correct", no findings.4e5a9c1a1f43(isolated scratch Gateway, real agent turn): verdict pass; R.running-turn-finishes pass, Q.queued-input-refused-visibly pass, S.stop-cancels pass (verdict.json,results.jsonlkept in the worker's proof directory).