Repository navigation
fix(update): profile-linked chat /update fails post-install Doctor with authority-check-failed - #188472
Conversation
…ance owner A profile-linked chat /update failed post-install Doctor with authority-check-failed: the delegated requester check reads profile rows from shared state, and child-process custody and post-repair work ran it while Doctor held sqlite-maintenance ownership outside a maintenance scope. Doctor now wraps the delegated write authority once; its maintenance state lends the held owner (and open scope) to every such check, as Doctor's own policy reads already do. Each check still reads current policy, so revoked or unauthorized requesters still fail. Also moves the deferred-maintenance ledger warning next to its refusal recorder to keep doctor-health under its line budget. Fixes #178291
|
🦞👀 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 SummaryThis 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. |
|
The update-reliability loop had a parallel investigation of #178291 in progress. This PR owns the same root cause, so I have stopped our duplicate implementation and switched that worker to independent review/verification of this PR. No second fix PR will be opened. I’ll share any distinct regression or actionable finding here rather than edit your active branch. |
|
Independent read-only verification of The raw parent is |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets delegated requester checks borrow Doctor's existing maintenance custody while continuing to check current authorization. Example: A profile-linked slack/primary/owner requester updates an installation running 2026.10.9 across a state migration.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs a current Doctor ownership failure without an identified correctness defect; the reviewed head's CI remains pending. Priority: P0 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherChat updates delegate requester authority to Doctor; Doctor acquires database maintenance custody and uses that authority before repair effects, config publication, and child-process operations. flowchart TD
A[Chat update requester] --> B[Delegated live authority]
B --> C[Doctor custody adapter]
D[Held maintenance owner] --> C
C --> E[Current requester policy]
E --> F[Config and process effects]
Technical reviewBest possible solution: Use Doctor's held owner for delegated policy reads while preserving fresh requester checks, maintenance exclusion, and existing rollback safeguards. Do we have a high-confidence way to reproduce the issue? Current source exposes the unscoped profile-policy read, and the author reports a matched published-release red/green upgrade; this review executed no target code. Is this the best way to solve the issue? The focused adapter repairs the storage-custody boundary using existing owners, retains live policy evaluation, and extends the existing regression without duplicate machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1d6f75fd7450. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +51, Tests +7. Total +58 across 7 files. Added test files: 0. View PR surface stats
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 October 30, 2026, 11:50 AM ET / 15:50 UTC. |
|
Merged via squash.
|
…195) ## Summary This updates `docs/openclaw.md` §4.4 with the maintainers' answers on [openclaw/openclaw#178291](openclaw/openclaw#178291), which is now closed. It also **corrects** a claim that #192 and #193 made: an `openclaw_setup_version` bump does not hit the refusal. ## What upstream established (2026-10-30) - **Mechanism:** for a chat `/update`, the post-install Doctor re-checks that the **requester** may still update. That re-check reads profile rows from the state DB outside Doctor's own maintenance scope, for example around child processes Doctor starts, and gets refused. This confirms the "Doctor refuses its own custody" trace I'd posted, and names the caller. - **Fix:** [openclaw/openclaw#188472](openclaw/openclaw#188472) (merge `ec05ff5d53a`) is on `main` but **not released**; it isn't in 2026.10.9 or 2026.10.10-beta.5. - **After release:** the post-install Doctor runs from the newly installed version, so a chat `/update` *to* a release that contains the fix works, even from 10.9. - **Until then:** an update started from a terminal has no chat requester to re-check, so it avoids the failure. ## Changes in `docs/openclaw.md` §4.4 - **2026-10-28 entry:** the failure is now scoped to chat-requested updates. The role path (`openclaw_setup_version` bump) runs the same updater but from a terminal with no chat requester, so it avoids the refusal according to the maintainer. It's noted as not yet exercised here across a migration, and the assert/recovery note is kept for the case where it fails anyway. This reverses "so it hits the same refusal". - **2026-10-30 root cause:** adds the upstream-confirmed mechanism, the requester re-check outside Doctor's maintenance scope. - **New "Upstream status" paragraph:** the fix PR and merge, the release status as of 2026-10-30, and that a chat `/update` to a fixed release works. Until then: upgrade with a pin bump or `sudo openclaw-admin update --tag <version> --yes`, and use the recovery sequence after a failed chat update. - **Open question:** the maintainer attributes the bug to profile-linked requesters, but `claw`'s owners are `commands.ownerAllowFrom`-only (a single `gateway-owner` profile with `roleSource: default` and nothing linked) and still failed three times, like another reporter. I raised this on #178291. The doc says to confirm with a chat `/update` to the first stable release that contains #188472. Docs only; nothing to apply. pre-commit passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ance owner (openclaw#188472) A profile-linked chat /update failed post-install Doctor with authority-check-failed: the delegated requester check reads profile rows from shared state, and child-process custody and post-repair work ran it while Doctor held sqlite-maintenance ownership outside a maintenance scope. Doctor now wraps the delegated write authority once; its maintenance state lends the held owner (and open scope) to every such check, as Doctor's own policy reads already do. Each check still reads current policy, so revoked or unauthorized requesters still fail. Also moves the deferred-maintenance ledger warning next to its refusal recorder to keep doctor-health under its line budget. Fixes openclaw#178291 Co-authored-by: Peter Steinberger <[email protected]>
## Summary On openclaw/openclaw#178291 the maintainer reported a second route to the post-install Doctor's `authority-check-failed`, separate from the profile-linked one that openclaw/openclaw#188472 fixed. The requester check loads the configured channel plugins and fails on any load error. A plugin whose settings/state migration is still pending is held back until Doctor runs that migration, so Doctor's own check failed before it could run that migration. This route matches claw: - the owners are only in `commands.ownerAllowFrom`; - the Signal plugin was left with its settings upgrade pending every time; - a terminal `update repair`, which has no chat requester, finished the job. It is fixed on main by openclaw/openclaw#190433 (merge `a5bcd9c8c8c`), which isn't released yet. ## Changes (`docs/openclaw.md` §4.4) - **Upstream status**, now dated 2026-11-01, lists both routes and both fixes. A chat `/update` is only safe to a release that contains **both** fixes. No config change is needed, since the maintainer confirms `ownerAllowFrom` is the right setup. - The root-cause bullet now says it describes the profile-linked route, and that claw's own route is the second one. - The open `ownerAllowFrom` question is answered. What's left to verify is a chat `/update` to the first stable release with both fixes, with the result reported on #178291. - Earlier references in the section are aligned: the 2026-10-19 entry now attributes that failure to the pending Signal plugin (per the maintainer), and the "expect this every time" note waits for **both** fixes. Docs only, so nothing needs applying to claw. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Closes #178291
What Problem This Solves
Fixes: a chat
/updatefrom an owner linked through a user profile fails in the post-install Doctor withauthority-check-failed. The new version is installed and serving, but the run is recorded as failed and rollback is refused.User Impact
User impact: owners linked through a user profile can update from chat across a state migration, and the run completes and verifies like a terminal or configured-owner update. Revoked or unauthorized requesters still fail the check.
Why This Change Was Made
The post-install Doctor re-checks the chat requester before every effect. For a profile-linked requester, that check reads profile rows from shared state. Doctor runs some of those checks while it holds
sqlite-maintenanceownership but sits outside a maintenance scope, for example on child-process custody (reserve and spawn) and in post-repair work. The state guard then refuses the read with "this process holds maintenance ownership without an active schema lease or maintenance scope". Configured owners (commands.ownerAllowFrom) only read config, so they never hit this.Doctor now wraps the delegated write authority once (
createDoctorWriteAuthority). Its maintenance state lends the held owner to that authority. Every delegated check then runs under the owner and its open scope, the same way Doctor's own policy reads already do (owner.assertCurrent(policy)). A check that is already nested inside an owner check runs directly under that check's storage lease. Each check still reads current policy, so this changes only the storage custody the read runs under, not what the requester is allowed to do.doctor-health.tswas already over its 700-line lint budget onmain(701). To make room for the wiring, the deferred-maintenance ledger warning moves next to its sibling refusal recorder indoctor-update-refusal.ts; its behavior is unchanged.Production LOC: +81 / −30 (includes the moved warning helper). Tests: +7.
Evidence
Before and after on Crabbox. Direct AWS lease
cbx_c753f252602c, now stopped:[email protected]was installed globally with a systemd user Gateway and a local registry.slack/primary/owner, andgateway.roleswas configured.update.runwithrequester: {channel: "slack", accountId: "primary", senderId: "owner"}was sent. The baseline admitted it asprofile:<id>.2f4373bd1f8. The red candidate has the fix reverted.authority-check-failed: Internal state ownership error … holds maintenance ownership without an active schema lease or maintenance scope12 times. The run was recorded as failed. 2026.10.96 was left serving with "Rollback not attempted: Databases changed after snapshot capture". This is the reporter's symptom.status: succeeded. Verification recorded: Gateway booted, service running 2026.10.97, version verified, channels, HTTP and core ready.Regression test.
doctor-maintenance.requester-authority.test.tsnow checks two things while Doctor holds maintenance ownership outside its scope:UpdateRequesterRevokedErrorafter the identity is unlinked.The profile case fails with the lending removed and passes with it. The configured-owner case passes both ways.
Local checks.
src/flows/doctor-health-startup.signal.test.tsfails 3/3 withERR_MODULE_NOT_FOUNDin its subprocess harness. It fails identically with the base sources restored, so the failure is pre-existing and unrelated.tsgo:corepassed; oxfmt and oxlint are clean on the touched files.check:changedreports pre-existing dead exports onmain(tts, session-html-preview and others) that this PR does not touch.Review.
$autoreview(Codex): scoped-clean.codex execread-only review of the exact head: no findings.Gaps.
openclaw update) avoids it, because a CLI update carries no chat requester.