Skip to content

fix(update): check delegated owners against Doctor-migrated config - #205669

Merged
RomneyDa merged 2 commits into
mainfrom
openclaw/mild-barnacle-c19d77
Nov 26, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
openclaw/mild-barnacle-c19d77

Conversation

@tideclaw-bot

@tideclaw-bot tideclaw-bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Refs #205485. A delegated configured-owner check can reject an installed candidate's config on the retired skills.workshop key before Doctor has a chance to migrate it. The issue was closed without a linked closing commit; the failing path is present on main and release/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 /update before it installs anything (INVALID_CONFIG on skills.workshop). When that happens the Gateway keeps serving the current version. Workaround: run openclaw 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's build-info.json records commit 590bd2e1ca7f74409b5a43a8668a9743b210272f, and its build source tree matches git archive of that commit. This commit applies conflict-free by itself to release/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 root skills.workshop.autonomous present. The base was published 2026.11.8, because 2026.11.10 refuses this config before installing (see above). Chat-requester update.run → candidate (relabeled 2026.11.11, build ID unchanged):

Stage Time
requested → validating 26 s
validating → activating (old Gateway still serving) 79 s
activating → candidate /readyz (Gateway down) 4 min 34 s
verifying → succeeded 7 s
total, request → succeeded 6 min 29 s

The candidate served build 2026.11.10-590bd2e1ca7f-2026-11-26T01-58-41.388Z on a new boot and passed /healthz, /readyz and authenticated health. Doctor removed skills.workshop and kept mode: auto and channelNotices: true under 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-missing codex plugin (npm 404, then clawhub.ai DNS EAI_AGAIN with 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 changed commands.ownerAllowFrom from telegram:1001 to telegram:1002 and left skills.workshop in place, so the owner check had to read through the Doctor projection. The candidate Doctor refused config promotion with requester-revoked ("Doctor config promotion refused for top-level keys: meta, plugins, skills"). The published driver also recorded requester-revoked at activation, and the run ended failed / requester-revoked. The projection did not resurrect the old owner. The reader wrote nothing: the file still held telegram:1002 and 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_CONFIG on a repairable legacy key during the delegated owner check.

Changed path Can fire for a healthy user? Rollback/outage risk Decision
io.load projectInvalidConfig hook in the existing invalid-config branch No. It runs only when config is already invalid, a branch that always threw INVALID_CONFIG, and only for the offline reader (!deps.observe) that supplies the hook. If it returns undefined, the same throw happens. If the planner throws, that error replaces an existing failure Reduces it: a repairable legacy key no longer fails the delegated check Kept (the fix)
planLegacyConfigForUpdateChannel projection No. It returns a validated config or undefined, and undefined keeps the old path None Kept
Eager import("../commands/doctor/legacy-config-repair.js") in the delegated configured-owner check Only with a corrupt package. update-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 error None added Kept
isRecord(snapshot.parsed) guard No. It returns undefined, which keeps the old path None Kept
io.factory / io.runtime type and option plumbing No None Kept

Worked on by

tideclaw-bot and others added 2 commits November 26, 2026 01:16
Worked on by:
- @RomneyDa

Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: b6bc84cd-308e-8d6c-b593-250f38546170
@clawsweeper

clawsweeper Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@tideclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 26, 2026
@tideclaw-bot
tideclaw-bot marked this pull request as ready for review November 26, 2026 01:24
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The installed candidate’s requester check throws INVALID_CONFIG before Doctor can migrate the retired key.
  • After: The check authorizes the current owner through Doctor’s projection, allowing Doctor to migrate the settings.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair supported by exact-head installed upgrade evidence, an owner-replacement counterexample, and passing CI.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The updated exact-head evidence exercises the candidate delegated Doctor through an installed legacy update, records successful authenticated serving and preserved settings, and separately records requester-revoked after owner replacement while the retired key remains; the latest stable’s earlier refusal and healthy predecessor are also documented.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A chat-requested update can roll back because its owner check rejects a retired setting that Doctor would migrate.
Reason: The maintainer-authored direction repairs a reproduced shipped-update boundary and preserves current owner matching and Doctor persistence ownership.

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: 590bd2e1ca7f74409b5a43a8668a9743b210272f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: A red-on-base run of the committed regression is not recorded; the supplied packaged predecessor/head comparison demonstrates the same failing boundary.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Delegated requester reconstruction keeps the original intent (d264306: The lifecycle consolidation shared delegated reconstruction while preserving the original authorization source and keeping profile continuations separate.)
  • Strict config loading and offline policy reads changes intended behavior with a stated reason (290836c: The config I/O split preserved validation and observation contracts; this PR documents a narrow offline projection through Doctor’s existing validated planner.)
  • Pending plugin migrations during requester checks keeps the original intent (a5bcd9c: Configured chat owners must remain checkable while Doctor has not yet migrated channel-plugin state, without ignoring unrelated plugin failures.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Focused introduced change: The pinned introduction diff limits projection to delegated requester capture and an explicitly supplied offline config-read hook; ordinary callers retain their existing behavior. (src/infra/update-requester-authority.ts:66, 590bd2e1ca7f)
  • Main still needs the repair: Fetched main delegates configured-owner reconstruction to the strict reader without a Doctor projection, preserving the reported failure before migration. (src/infra/update-requester-authority.ts:66, b8c9305ae227)
  • Existing migration owner and validation: The reused planner validates migration results and retains existing include-write restrictions; the new reader branch returns the projection before snapshot observation and performs no persistence. (src/config/io.load.ts:186, 590bd2e1ca7f)
  • Updated installed upgrade evidence: The current PR body records an exact-head, systemd-supervised 2026.11.8 upgrade reaching succeeded, authenticated candidate health, preserved Workshop settings, and a separate owner-replacement refusal through the projection; this addresses the previous review’s requested scenario. (590bd2e1ca7f)
  • Latest stable limitation is documented: The published 2026.11.10 helper can reject the retired key before installing any candidate; supplied evidence records the previous Gateway remaining healthy and documents doctor --fix before retrying. (590bd2e1ca7f)
  • Exact-head checks: The reviewed head has successful CI, dependency-review, and security-sensitive-review statuses, with no reported failing checks; the published-driver lane was skipped and is not counted as upgrade proof. (590bd2e1ca7f)

Likely related people:

  • Peter Steinberger: Raw commit d264306 adds src/infra/update-requester-authority.ts:48 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d2643069b48d; files: src/infra/update-requester-authority.ts)

PR surface

Source +33, Tests +21. Total +54 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 38 5 +33
Tests 1 21 0 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 59 5 +54

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-26T01:28:56.424Z sha 590bd2e :: needs maintainer review before merge. :: none

Reviewed November 26, 2026, 1:05 AM ET / 06:05 UTC (Revision 2).

@tideclaw-bot

tideclaw-bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Exact-head evidence for 590bd2e1ca7f74409b5a43a8668a9743b210272f. The requester-authority suite passed 16/16 in a disposable rootless container, including the Doctor-migrated Telegram owner regression. The published-driver-update job was skipped for this head.

Installed proof: private rootless Podman, systemd user unit, --network none, offline npm, local verified archives. Baseline 810d0cb8a42135dbf710cb6d09afb4b727645ed4; baseline and candidate both report version 2026.11.10, so comparison uses the authenticated serving commit/build/boot IDs, not version alone. Drove production update.run with a synthetic Telegram requester and checked /healthz, /readyz, and authenticated health.

  • Authorized with retired skills.workshop key: the run reached database-schema-preflight and refused the retired field before installing the candidate, both with the key in an include and after moving it into the root config. The prior Gateway stayed healthy on the same boot. This does not exercise the delegated finalizer’s migration fallback.

  • Revoked before request: owner_required, runId: null; the prior build and boot stayed healthy.

  • Revoked after install, before trial activation: run cac77ee3-c5e5-4d05-9d0d-481448554db3 had a published candidate and a pending trial when the owner entry was revoked at 02:10:10.722Z. The already-admitted run finished succeeded; exact candidate 590bd2e served on a new boot with authenticated health. A fresh request from the revoked owner returned owner_required. No rollback occurred and no stopped-Gateway outage was reproduced.

Separately, a loopback fake Telegram Bot API delivered an actual /update to the exact installed candidate. It returned /update is disabled (commands.restart=false) and the candidate stayed healthy on the same boot. This proves native command ingress, not an upgrade via the fake transport.

The installed update.run path uses prepared releases and Gateway trial settlement, not the legacy delegated CLI finalizer changed by this PR and overlapping #205675. No product patch or branch push was made.

Published-driver follow-up

The 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.

  • Exact published 2026.11.10 with the retired root skills.workshop key present: run f67181f5-248d-46f6-81ed-828432389374 failed before launching the update child. The handoff log shows the installed helper throwing INVALID_CONFIG from its policy reader. Before and after, /healthz, /readyz and authenticated health passed, with the same service PID, boot ID and published build ID. A patch shipped only in the destination cannot change this refusal. The practical path is operator-side config repair before retrying.
  • Packed delegated-authority comparison: predecessor 810d0cb8a421 threw INVALID_CONFIG; exact PR build 590bd2e1ca7f authorized the same configured Telegram owner while leaving the legacy file byte-identical. The normal doctor --fix then removed skills.workshop and preserved mode: auto and channelNotices: true under the Skill Workshop plugin. The owner still passed afterward. This is a packaged boundary check, not a completed update.
  • Published 2026.11.8 → sealed PR candidate with the actual retired key: the old driver admitted the config with a legacy warning, and reached package activation and candidate Doctor, not the old helper refusal. The first run ended update-activation-timeout; the retry with a longer updater budget (aaa5763e-7845-4c5e-8493-6e7d71b8b012) outlasted the harness polling window while Doctor was still running. There is no healthy candidate/terminal success receipt for these legacy runs.

@tideclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Nov 26, 2026
@RomneyDa
RomneyDa merged commit 09431bb into main Nov 26, 2026
242 checks passed
@RomneyDa
RomneyDa deleted the openclaw/mild-barnacle-c19d77 branch November 26, 2026 06:24
tideclaw-bot added a commit that referenced this pull request Nov 26, 2026
…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]>
tideclaw-bot added a commit that referenced this pull request Nov 26, 2026
…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]>
tideclaw-bot added a commit that referenced this pull request Nov 26, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…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]>
tideclaw-bot added a commit that referenced this pull request Nov 29, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants