Repository navigation
fix(update): check delegated owners against Doctor-migrated config - #205669
Conversation
Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: b6bc84cd-308e-8d6c-b593-250f38546170
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR lets delegated configured-owner checks read Doctor’s validated migration projection before legacy configuration is persisted. Example: Telegram owner telegram:1001 requests an update while skills.workshop.autonomous contains mode: auto.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current delegated-update failure with a focused change; no introduced defects were found, and the reviewed head’s CI gate passes. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe delegated update worker reconstructs requester authority from current installation configuration before running Doctor; the policy reader returns configuration for owner matching while Doctor retains persistence ownership. flowchart TD
A[Shipped updater] --> B[Candidate delegated worker]
B --> C[Current config policy reader]
C --> D[Doctor migration planner]
D --> E[Configured owner matcher]
E --> F[Doctor repair and persistence]
Technical reviewBest possible solution: Keep the delegated reader’s validated projection while leaving configuration writes and migration policy with Doctor. Do we have a high-confidence way to reproduce the issue? Current main validates configuration before delegated Doctor migration, matching kitiyeung’s published-package reproduction and the supplied predecessor failure; this read-only review ran no target code. Is this the best way to solve the issue? This is a focused repair using the existing Doctor planner, without duplicating migration rules, weakening ordinary config reads, or changing profile continuation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b8c9305ae227. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +33, Tests +21. Total +54 across 5 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. 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 (1 earlier review cycle)
Reviewed November 26, 2026, 1:05 AM ET / 06:05 UTC (Revision 2). |
|
Exact-head evidence for Installed proof: private rootless Podman, systemd user unit,
Separately, a loopback fake Telegram Bot API delivered an actual The installed Published-driver follow-upThe reported false rejection comes from the new installation's delegated post-install Doctor, before its config migration. The PR can fix the same hop when it reaches that Doctor; it does not modify the installed 2026.11.10 helper's earlier authority gate.
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…205669) * fix(update): check delegated owners against Doctor-migrated config Co-authored-by: RomneyDa <[email protected]> * fix(update): check delegated owners against Doctor-migrated config Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: b6bc84cd-308e-8d6c-b593-250f38546170 --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 09431bb) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
…205666) * fix(update): preserve typed Discord owners during plugin migration Co-authored-by: RomneyDa <[email protected]> * fix(update): preserve typed Discord owners during plugin migration Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: a3a077a6-6af8-4854-a490-4ae036753b01 * fix(update): match typed owners for any migration-deferred channel The delegated requester check now accepts the exact typed user target for whichever channel plugin Doctor is holding back for its state migration, not only Discord. Mattermost, Slack and Teams share the user-prefixed direct target style. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> Release adaptation: Keep the matcher in this release’s command-auth owner rather than importing the later #205772 owner extraction. Keep #205669 and #205850 separate. (cherry picked from commit 777b439) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
…205669) * fix(update): check delegated owners against Doctor-migrated config Co-authored-by: RomneyDa <[email protected]> * fix(update): check delegated owners against Doctor-migrated config Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: b6bc84cd-308e-8d6c-b593-250f38546170 --------- Co-authored-by: RomneyDa <[email protected]> Release adaptation: Apply after #205666, retaining the release-only package-settlement test and independent typed-owner regression; the ordinary managed admission still rejects invalid config. (cherry picked from commit 09431bb) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
…penclaw#205669) * fix(update): check delegated owners against Doctor-migrated config Co-authored-by: RomneyDa <[email protected]> * fix(update): check delegated owners against Doctor-migrated config Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: b6bc84cd-308e-8d6c-b593-250f38546170 --------- Co-authored-by: RomneyDa <[email protected]>
… a verified Gateway (#205758) * fix(update): admit migrated finalizer requester once * fix(update): bound migrated finalization and verify interrupted recovery * fix(update): require authenticated RPC in interrupted recovery wait * test(update): scope the migrated worker capability stub * test(update): keep the worker timeout stub typed * fix(update): keep migrated finalization unbounded without an operator deadline A default worker deadline terminated finalization into a pending recovery that leaves the managed Gateway stopped. Restore the explicit/inherited-only deadline until timeout recovery can verify a serving Gateway. * fix(update): recover timed-out and orphaned finalizers to a verified Gateway A finalizer stopped at its deadline left a pending recovery that the managed helper treated as an explicit refusal, and a killed waiting updater left its candidate worker holding the run's child lease, so the helper lost its claim. Both left the Gateway stopped until a manual update repair. Route the finalizer deadline into the helper's existing interrupted recovery, join a settling candidate worker within the recovery budget before reclaiming the claim, and restore the default finalizer deadline (an explicit --timeout still takes precedence). Recovery still requires an authenticated health RPC with the expected version and build. Refs #205547, #205675. * fix(update): keep migrated finalization bounded only by an operator timeout Restoring an implicit finalizer deadline added a failure path that a healthy but slow update could hit (#153085 removed it for that reason), and its expiry is reported as update-recovery-pending, which the helper does not route into recovery. Drop it again: an explicit --timeout still bounds the worker, and its update-activation-timeout result enters the verified interrupted recovery. Refs #205547. --------- (cherry picked from commit cc7f256) Release adaptation: Keep timeout classification with the existing interrupted-recovery admission in the result source; leave the handoff entry point at its baseline line count. Preserve authenticated readiness and the retained package-slot/installed-generation recovery. Later same-path commits from the pinned scan (separate behavior unless named as folded/selected below): f927fb1 #203406 reports explicit package recovery; 8bc37be #205850 and `020832b252e8` #205669 handle migrated channel owner admission; 31ea1c0 #206530 handles namespace-less Linux locks (separately deferred because explicitly superseded in pinned main).. Co-authored-by: RomneyDa <[email protected]>
Problem
Refs #205485. A delegated configured-owner check can reject an installed candidate's config on the retired
skills.workshopkey before Doctor has a chance to migrate it. The issue was closed without a linked closing commit; the failing path is present on main andrelease/2026.11.11.Fix and impact
For delegated configured-owner checks, use the existing Doctor migration planner to project valid config when the offline policy read encounters a repairable legacy shape. The policy reader never writes or observes the projection as disk config; Doctor still owns persistence. An owner replaced in the current config is still denied (proven end to end below). Normal valid config loads and profile continuation are unchanged. No new schema or migration.
Upgrading from 2026.11.10
The fix runs in the newly installed version. The installed 2026.11.10 updater checks the owner first and may refuse a chat
/updatebefore it installs anything (INVALID_CONFIGonskills.workshop). When that happens the Gateway keeps serving the current version. Workaround: runopenclaw doctor --fix, then retry the update.Verification
All proof below is end to end on exact head
590bd2e1ca7f: private rootless Podman, systemd user unit,--network none, offline npm. The installed package'sbuild-info.jsonrecords commit590bd2e1ca7f74409b5a43a8668a9743b210272f, and its build source tree matchesgit archiveof that commit. This commit applies conflict-free by itself torelease/2026.11.11. Combined with the typed-owner fix (#205666), both regressions insert at the same place in the shared test file; keep both when resolving.Legacy hop, owner kept. Telegram owner
telegram:1001, retired rootskills.workshop.autonomouspresent. The base was published 2026.11.8, because 2026.11.10 refuses this config before installing (see above). Chat-requesterupdate.run→ candidate (relabeled 2026.11.11, build ID unchanged):/readyz(Gateway down)succeededThe candidate served build
2026.11.10-590bd2e1ca7f-2026-11-26T01-58-41.388Zon a new boot and passed/healthz,/readyzand authenticatedhealth. Doctor removedskills.workshopand keptmode: autoandchannelNotices: trueunder the Skill Workshop plugin. Afterward the installed owner check accepted sender 1001 and denied 1002. Most of the downtime was post-install Doctor (config flow about 90 s, contributions about 50 s). Doctor was mostly idle while it waited for the fixture-missingcodexplugin (npm 404, thenclawhub.aiDNSEAI_AGAINwith no network). A warm standalone Doctor afterward took 14 s.Revoked owner, retired key still present. This was the same legacy hop. A watcher waited until the installed candidate spawned its delegated Doctor (
update-migrated-finalize.worker.js --doctor). Then it changedcommands.ownerAllowFromfromtelegram:1001totelegram:1002and leftskills.workshopin place, so the owner check had to read through the Doctor projection. The candidate Doctor refused config promotion withrequester-revoked("Doctor config promotion refused for top-level keys: meta, plugins, skills"). The published driver also recordedrequester-revokedat activation, and the run endedfailed / requester-revoked. The projection did not resurrect the old owner. The reader wrote nothing: the file still heldtelegram:1002and the retired key afterward. Timing: revocation 05:56:00, refusal 05:56:07.Pre-existing behavior, not changed by this PR: after the refusal, the published driver did not restart the Gateway ("managed update recovery not attempted"), so the service stayed inactive. A control run that revoked at package swap was denied by the published driver itself during activation and ended the same way. This PR does not touch restart or recovery code. This will be reported separately.
Error surfaces
I audited the full diff against merge-base
abd58266467d. The PR adds no new refusal or rollback trigger. It removes one:INVALID_CONFIGon a repairable legacy key during the delegated owner check.io.loadprojectInvalidConfighook in the existing invalid-config branchINVALID_CONFIG, and only for the offline reader (!deps.observe) that supplies the hook. If it returnsundefined, the same throw happens. If the planner throws, that error replaces an existing failureplanLegacyConfigForUpdateChannelprojectionundefined, andundefinedkeeps the old pathimport("../commands/doctor/legacy-config-repair.js")in the delegated configured-owner checkupdate-command-admit, which the same worker loads next, already imports this module statically. It also sits in the existing try block, whose failure becomes the run's recorded authority errorisRecord(snapshot.parsed)guardundefined, which keeps the old pathio.factory/io.runtimetype and option plumbingWorked on by