Repository navigation
fix(update): preserve typed channel owners during plugin migration - #205666
Conversation
Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: a3a077a6-6af8-4854-a490-4ae036753b01
|
🦞👀 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 preserves configured typed channel owners while Doctor temporarily defers their channel plugins for migration. Example: Discord sender 100000000000000001 updates with ownerAllowFrom containing discord:user:100000000000000001 while Discord migration is pending.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: current main still has the typed-owner rejection, and this PR provides a focused repair with no blocking correctness finding. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe delegated updater reads current owner configuration and plugin availability, then supplies an authority result to the installed candidate’s Doctor and finalizer. flowchart TD
A[Chat update requester] --> B[Installed candidate finalizer]
B --> C[Requester authority]
D[Current owner configuration] --> C
E[Plugin migration registry] --> C
C --> F[Shared owner matcher]
F --> G[Doctor admission result]
Technical reviewBest possible solution: Retain the existing owner matcher and narrowly supply migration-deferred channel context without rewriting configured owner targets. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically drops discord:user:100000000000000001 without its plugin formatter, and the finalizer converts the failed owner check into requester-revoked; no target code was executed during this review. Is this the best way to solve the issue? The patch repairs normalization at the existing shared owner boundary, preserves loaded-plugin behavior and exact identity matching, and avoids the heartbeat regression associated with rewriting typed owner configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b7bd237d0050. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +24, Tests +30. Total +54 across 3 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. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label 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 (5 earlier review cycles)
Reviewed November 26, 2026, 2:59 AM ET / 07:59 UTC (Revision 6). |
|
Exact-head evidence for Installed proof: private rootless Podman, systemd user unit,
The installed route is the prepared-release Published-driver follow-upThe reported false revocation is in the new installation's post-core worker, which reconstructs configured-owner authority after the package swap. The installed 2026.11.10 managed handoff has a separate pre-install owner gate; candidate code cannot repair a refusal at that earlier gate.
|
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]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Co-authored-by: RomneyDa <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Ports the typed-owner match to src/auto-reply/command-owner-facts.ts, where #205772 moved it. Co-authored-by: RomneyDa <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…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]> (cherry picked from commit 777b439) 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#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]>
Problem
Refs #205162. During a delegated chat update, Doctor holds back a channel plugin whose state migration is pending, so that channel's formatter is unavailable when the updater rechecks a configured
<channel>:user:<id>owner. The typed target is then dropped and the update falsely reports requester revocation. Discord is the reported case; Mattermost, Slack and Teams use the same user-prefixed target style.Fix and impact
The delegated requester check records which channels the registry deferred for a pending state migration. For those channels only, and only when the channel formatter is absent, the owner matcher accepts the exact user ID from a typed
<channel>:user:<id>entry. The ID must still equal the sender exactly; an owner removed from the current configuration is still denied (proven end to end below). Loaded formatters and all other channels are unchanged. Without the plugin, the target style is unknown, so the typed form is accepted for any deferred channel; this edge is noted in the code. No schema or migration changes.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 (owner_requiredwhile the migration record is pending). 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
5358cc1ab827, the secondmainmerge. In that merge, #205772 movedresolveOwnerAllowFromListandisConfiguredCommandOwnertosrc/auto-reply/command-owner-facts.ts, and this PR's change was ported there. Setup: private rootless Podman, systemd user unit,--http-proxy=false,--network none, offline npm. The installed candidate'sbuild-info.jsonrecords commit5358cc1ab827a13ec4a22b2611eaa7c4197acf5b, build2026.11.10-5358cc1ab827-2026-11-26T07-35-54.980Z, relabeled 2026.11.11. The build source tree isgit archiveof that commit. Each cell sends a chat-requesterupdate.run. Combined with #205669 onrelease/2026.11.11, both regressions insert at the same place in the shared test file; keep both when resolving.discord:user:…001; Discordcommand-deploy-cache.jsonpending migrationsucceededin 7 min 56 s. The candidate served on a new boot and passed/healthz,/readyzand authenticatedhealth. Doctor removed the cache artifact. The installed owner check accepted the sender and denied another IDsucceededin 9 min 38 s, with the same checks passingupdate-migrated-finalize.worker.js --doctor, a watcher changed the owner todiscord:user:…002. The cache artifact was still present, so Discord was withheld with no formatter: the deferred pathconfigWriteRefusal.reason: requester-revoked), and the run's first failure wasrequester-revoked, about 12 s after revocation. Afterward, the revoked sender was not an owner and the new owner wastelegram:1001totelegram:1002, with the retired workshop key still pendingactivatingwithrequester-revoked, about 7 s after revocationPre-existing behavior, not changed by this PR: after the 3a and 3b refusals, the published driver left recovery pending. For Discord it reports "automatic restart and repair were not attempted"; for Telegram, package publication recovery is pending. In both cases the Gateway unit stayed inactive until
openclaw update repairruns. This PR does not touch restart or recovery code. This will be reported separately. Cell 2 is not rerun here; it is a known #205669 regression handled there.Covered only by unit tests: the Mattermost/Slack/Teams variants of the deferred typed-owner match.
Error surfaces
I audited the full diff against the merged
mainparentf031630c3e41. It touchessrc/auto-reply/command-owner-facts.ts,src/infra/update-requester-authority.tsand its test. The PR adds no throw, refusal, exit, rollback trigger, or tightened validation. OnlycaptureManagedUpdateRequester's configured-ownerisCurrentpassesmigrationDeferredChannels. With the list omitted or empty, every other caller behaves as onmain. These arecaptureCommandOwnerIdentityandprepareCommandOwnerAuthority(isCurrent),operator-admission'sisChannelOwner,approval-channel-custody,update-run-notice-targetand the Doctor cron check.resolveConfiguredCommandOwnersis unchanged. Its callers therefore see the same owner list, includingcommand-auth'sexplicitOwners→readCommandSenderAdmissionfrom #205772 andattempt-tool-context. The contextOwnerAllowFrompath incommand-authpasses no list.resolveOwnerAllowFromList: typed<channel>:user:<id>yields<id>when the plugin is absent and the channel is migration-deferredrequester-revoked!providerIdorchannel !== providerId→channel !== providerId)channelis always a non-empty string at that point, and with no list the typed branch still skipsisConfiguredCommandOwnerbuilds its owner list directly instead of callingresolveConfiguredCommandOwnersSetdedup (the list is used only forincludes), and reads the loaded plugin once instead of twicemigrationDeferredChannelsin the existing pending-migrationcatchregistry.plugins,status,channelIds) on a branch that already tolerated the erroroptionsargument onisConfiguredCommandOwner{}, so other callers are unchangedWorked on by