Repository navigation
fix(openclaw-id): replayed revocation removes a device that was approved again - #193146
Conversation
…at was approved again A Revocation now names its claw and the membership seq its signer saw, and every listed key records the seq at which it was listed (re-adding a listed key keeps it). A revocation removes only keys listed at or before its seq, together with every device they approved; a key listed again later is refused as seq_conflict, so replaying captured bytes changes nothing and no list of past revocations is kept. Invites stay bounded the same way: a cap may expire at most a week after registration, a claw keeps at most 100 invites, spent records are deleted before counting, and removing an owner device deletes the open invites it registered. Prompted by #192230 (thanks @SebTardif).
|
🦞👀 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: needs real behavior proof before merge. What this changesThis PR scopes revocations to a claw and membership sequence and bounds invite lifetime, count, and retention. Example: A revocation signed at seq 2 removes device B, which is approved again at seq 3.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR: current main still has the reported replay bug, and this maintainer-directed replacement preserves bounded authority state; no definite introduced code defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe protocol package validates signed statements and transforms in-memory membership state into updated state and removal events; the downstream Gateway owns persistence, connections, tokens, and publication. flowchart LR
A[Signed statements] --> B[Schema validation]
B --> C[Current owner verification]
C --> D[Scoped authority rules]
D --> E[Membership state]
D --> F[Removal events]
F --> G[Gateway effects]
Technical reviewBest possible solution: Keep listing sequences and invite bounds in the existing protocol authority, with its consumers using the same signed contract. Do we have a high-confidence way to reproduce the issue? Current main unconditionally removes a presently listed revocation target, so capture, removal, reapproval, and replay follow directly from source; this review executed no target code. Is this the best way to solve the issue? The bounded listing-sequence design addresses replay without restoring an ever-growing history, preserves the existing cascade owner, and keeps distinct regression cases; the documented stale-view tradeoff already has owner direction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2cd45a3eaffc. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: The current-owner signature gate remains intact, but the changed authority scope needs final-effect validation. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +276, Tests +279, Docs +28, Other +2. Total +585 across 21 files. Added test files: 2. 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
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 4, 2026, 10:03 PM ET / November 5, 2026, 03:03 UTC. |
|
Landing note for Inherited CI failure. CI run 41957539527, attempt 1, has one failed job,
This lands through the pre-existing-failure route; the failure itself still needs a fix on Proof scope. ClawSweeper found no code issues on this head. It asked for Gateway-level traces (mailbox replay after re-approval, a removed signer refused, invite cap through Gateway registration). Nothing on Local checks on |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…at was approved again (openclaw#193146) A Revocation now names its claw and the membership seq its signer saw, and every listed key records the seq at which it was listed (re-adding a listed key keeps it). A revocation removes only keys listed at or before its seq, together with every device they approved; a key listed again later is refused as seq_conflict, so replaying captured bytes changes nothing and no list of past revocations is kept. Invites stay bounded the same way: a cap may expire at most a week after registration, a claw keeps at most 100 invites, spent records are deleted before counting, and removing an owner device deletes the open invites it registered. Prompted by openclaw#192230 (thanks @SebTardif).
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change.
…nd the Access page (#192352) * feat(openclaw-id): add the Control UI account menu, linking dialogs and the People plugin * fix(openclaw-id): sign Your devices revocations for this claw at the seq it last read A Revocation now carries the claw id and the membership seq the signer saw (#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change. * fix(openclaw-id): make one recovery kit per Make reachable preparation Pressing Continue twice could send two preparations. A late second answer returned the dialog to the owner-key step after the owner had saved kit A, and the next Create recovery kit made kit B while the dialog still counted the kit as saved, so B could link the claw unsaved. One preparation now runs at a time, only the name step accepts its answer, and each new kit starts unsaved. * fix(openclaw-id): report an owner key stored only after IndexedDB commits it A request's success event does not mean its transaction committed, so a write could resolve, and notify approval lifetimes, while the transaction then aborted and the non-extractable owner key was never stored. Writes now wait for the transaction to complete. * fix(openclaw-id): store the first owner device key before linking with it The browser stored D1 only after the commit answered. The Gateway pins the root and admits D1 before it publishes and answers, so a reload or dropped connection in between left a linked claw whose only owner device key was never stored. The key is now stored before the commit, and a key this origin already holds for the claw is reused rather than replaced. * fix(openclaw-id): close OpenClaw ID dialogs when the Labs switch turns off Make reachable, Your devices and owner approval each ran in their own modal host with no tie to the feature, so turning the Labs switch off left them open, including a recovery kit on screen, and the reachability toast could still open Make reachable. The enabled feature's mounted lifetime now owns them: they open only while it runs and close when it ends, and Make reachable drops its kit secrets however it closes. * fix(openclaw-id): open sign-in and print windows without an opener The sign-in popup and the recovery-kit print window called window.open directly, which the Control UI boundary guard forbids. They now reserve the window with reserveExternalWindowForDeferredNavigation, which cuts the opener before any page loads; the sign-in callback answers through localStorage and needs no opener. A blocked popup falls back to openExternalUrlSafe. * refactor(openclaw-id): type the approval handoff as JSON and explain a key mock * chore(test): allocate the OpenClaw ID UI review regression test lines * fix(openclaw-id): style the Make reachable name step outside Settings The dialog opens from the account menu on any page, but SettingsRow's styles load only with the Settings pages, so the claw name title and hint ran together. The dialog chunk now imports them. * docs(openclaw-id): merge the OpenClaw ID remote access sections and count the People plugin #192335 added a short OpenClaw ID remote access section to the Labs docs; this PR's fuller section now carries its off-state and configuration-key details, so the page has one heading. The plugin inventory and reference index count the bundled openclaw-id-access plugin on the new base. * feat(openclaw-id): rename the People page to Access The page that controls who may reach this claw through OpenClaw ID is now Access in the sidebar and titled Remote access. Its People section keeps invites, approvals and members, so later Your devices and Nodes sections fit beside it. Nodes are not people, the sidebar already has Users, and chat details already has a People section. - Page and navigation id `people` -> `access`; navigation label Access, page title and heading Remote access, with a one-line pointer to Settings -> Devices for devices paired with this Gateway. - Plugin display name "OpenClaw ID remote access"; the plugin id `openclaw-id-access` and the `openclawId.people` RPC are unchanged. - Labs copy, docs, plugin inventory and reference page, config baseline hashes, tests and the test-line allocation follow the rename. * test(openclaw-id): call the real IndexedDB add without an unbound method reference Main's core lint now rejects typescript(unbound-method); the abort test captures IDBObjectStore.prototype.add with Reflect.get and calls it with Reflect.apply. * perf(openclaw-id): keep the config form analyzer out of the Chat and New Session boot graphs config-sections.ts is part of the boot graph, and its new visibleConfigSchema imported view-schema.tsx, which pulled the config form analyzer and utilities into Chat and New Session boot (+6 KiB gzip and two more Chat requests). The helper now lives in config-page-state.ts, which only the Settings page loads. * fix(openclaw-id): name the removed device in the Your devices removal preview Remove access is offered only for other devices, but its confirmation said "This browser loses access now". It now names the device being removed. The approved-by test keeps a real owner key for the claw and checks the preview text; the test-line allocation grows to 3,683. * perf(control-ui): budget the OpenClaw ID sidebar mounts and account menu styles Approved by Josh Lehman (2026-11-06). main 0a65906 already exceeds its own Chat, New Session and largest-chunk ceilings. On it, this branch measures Chat boot JS at 1,288,774 B, New Session boot JS at 797,124 B (Linux CI) and the largest shared chunk at 560,277 B gzip; each ceiling is that measurement plus 256 B for main's concurrent growth. Total CSS measures 325,045 B gzip / 1,675,690 B raw; its ceilings are the measurement plus 64 B. Request counts stay within their existing limits. * fix(openclaw-id): check the default claw name with the account's link code Turn on remote access fills the link code from the signed-in account and then checks the default name. Solid settles the code signal later, so the check read an empty code and never asked the Gateway. The acquired code is now passed to the check directly; the one-preparation test also expects that check_name request (it fails without the fix). * test(openclaw-id): drop the recovery kit field-copy test kit-export.test.ts only repeated the helper's interpolation without saving or printing a kit (ClawSweeper). recoveryKitLines is now module-private, so its Knip production-scan entry goes too. The test-line allocation is 3,667.
…nd the Access page (openclaw#192352) * feat(openclaw-id): add the Control UI account menu, linking dialogs and the People plugin * fix(openclaw-id): sign Your devices revocations for this claw at the seq it last read A Revocation now carries the claw id and the membership seq the signer saw (openclaw#193146), so the owner-devices dialog signs with the link's claw id and seq. A browser without that seq refuses to sign, and a device approved again since the dialog loaded is refused by the Gateway as a concurrent change. * fix(openclaw-id): make one recovery kit per Make reachable preparation Pressing Continue twice could send two preparations. A late second answer returned the dialog to the owner-key step after the owner had saved kit A, and the next Create recovery kit made kit B while the dialog still counted the kit as saved, so B could link the claw unsaved. One preparation now runs at a time, only the name step accepts its answer, and each new kit starts unsaved. * fix(openclaw-id): report an owner key stored only after IndexedDB commits it A request's success event does not mean its transaction committed, so a write could resolve, and notify approval lifetimes, while the transaction then aborted and the non-extractable owner key was never stored. Writes now wait for the transaction to complete. * fix(openclaw-id): store the first owner device key before linking with it The browser stored D1 only after the commit answered. The Gateway pins the root and admits D1 before it publishes and answers, so a reload or dropped connection in between left a linked claw whose only owner device key was never stored. The key is now stored before the commit, and a key this origin already holds for the claw is reused rather than replaced. * fix(openclaw-id): close OpenClaw ID dialogs when the Labs switch turns off Make reachable, Your devices and owner approval each ran in their own modal host with no tie to the feature, so turning the Labs switch off left them open, including a recovery kit on screen, and the reachability toast could still open Make reachable. The enabled feature's mounted lifetime now owns them: they open only while it runs and close when it ends, and Make reachable drops its kit secrets however it closes. * fix(openclaw-id): open sign-in and print windows without an opener The sign-in popup and the recovery-kit print window called window.open directly, which the Control UI boundary guard forbids. They now reserve the window with reserveExternalWindowForDeferredNavigation, which cuts the opener before any page loads; the sign-in callback answers through localStorage and needs no opener. A blocked popup falls back to openExternalUrlSafe. * refactor(openclaw-id): type the approval handoff as JSON and explain a key mock * chore(test): allocate the OpenClaw ID UI review regression test lines * fix(openclaw-id): style the Make reachable name step outside Settings The dialog opens from the account menu on any page, but SettingsRow's styles load only with the Settings pages, so the claw name title and hint ran together. The dialog chunk now imports them. * docs(openclaw-id): merge the OpenClaw ID remote access sections and count the People plugin openclaw#192335 added a short OpenClaw ID remote access section to the Labs docs; this PR's fuller section now carries its off-state and configuration-key details, so the page has one heading. The plugin inventory and reference index count the bundled openclaw-id-access plugin on the new base. * feat(openclaw-id): rename the People page to Access The page that controls who may reach this claw through OpenClaw ID is now Access in the sidebar and titled Remote access. Its People section keeps invites, approvals and members, so later Your devices and Nodes sections fit beside it. Nodes are not people, the sidebar already has Users, and chat details already has a People section. - Page and navigation id `people` -> `access`; navigation label Access, page title and heading Remote access, with a one-line pointer to Settings -> Devices for devices paired with this Gateway. - Plugin display name "OpenClaw ID remote access"; the plugin id `openclaw-id-access` and the `openclawId.people` RPC are unchanged. - Labs copy, docs, plugin inventory and reference page, config baseline hashes, tests and the test-line allocation follow the rename. * test(openclaw-id): call the real IndexedDB add without an unbound method reference Main's core lint now rejects typescript(unbound-method); the abort test captures IDBObjectStore.prototype.add with Reflect.get and calls it with Reflect.apply. * perf(openclaw-id): keep the config form analyzer out of the Chat and New Session boot graphs config-sections.ts is part of the boot graph, and its new visibleConfigSchema imported view-schema.tsx, which pulled the config form analyzer and utilities into Chat and New Session boot (+6 KiB gzip and two more Chat requests). The helper now lives in config-page-state.ts, which only the Settings page loads. * fix(openclaw-id): name the removed device in the Your devices removal preview Remove access is offered only for other devices, but its confirmation said "This browser loses access now". It now names the device being removed. The approved-by test keeps a real owner key for the claw and checks the preview text; the test-line allocation grows to 3,683. * perf(control-ui): budget the OpenClaw ID sidebar mounts and account menu styles Approved by Josh Lehman (2026-11-06). main 88a8ee9 already exceeds its own Chat, New Session and largest-chunk ceilings. On it, this branch measures Chat boot JS at 1,288,774 B, New Session boot JS at 797,124 B (Linux CI) and the largest shared chunk at 560,277 B gzip; each ceiling is that measurement plus 256 B for main's concurrent growth. Total CSS measures 325,045 B gzip / 1,675,690 B raw; its ceilings are the measurement plus 64 B. Request counts stay within their existing limits. * fix(openclaw-id): check the default claw name with the account's link code Turn on remote access fills the link code from the signed-in account and then checks the default name. Solid settles the code signal later, so the check read an empty code and never asked the Gateway. The acquired code is now passed to the check directly; the one-preparation test also expects that check_name request (it fails without the fix). * test(openclaw-id): drop the recovery kit field-copy test kit-export.test.ts only repeated the helper's interpolation without saving or printing a kit (ClawSweeper). recoveryKitLines is now module-private, so its Knip production-scan entry goes too. The test-line allocation is 3,667.
Related: #192230 (closed in favor of this PR), #192335
What Problem This Solves
Fixes: a captured OpenClaw ID revocation, submitted again through the Discovery mailbox, removes an owner device or member browser that an owner approved again after the revocation was signed. Invite records also pile up with no limit, so a stolen owner device could grow the claw record until the Gateway can no longer save it.
User Impact
claw_idandseq, and the old form is refused asmalformed. Gateways run none of this code until the OpenClaw ID Gateway stack (feat(openclaw-id): add Gateway membership authority and publication behind the Labs flag #192335) merges.Why This Change Was Made
@SebTardif found the replay in #192230 and fixed it by keeping every applied revocation signature. That list only grows. The claw stopped keeping history on 2026-11-02 because its earlier revoked list outgrew the 256-entry statement limit, so this PR fixes the replay without a list.
A revocation now covers only what its signer saw. It names the claw and the membership
seqthe signer last read. Every listed key records the seq at which it was listed, and listing a key that is still listed anywhere keeps its earliest seq. A revocation removes a key only if it was listed at or before that seq, together with every device the key approved. A re-approval is a new listing the old signature never covered, so the replay is refused withseq_conflictand changes nothing. Invites get the same treatment: each one expires within a week, so the claw no longer has to remember used invites forever.Tradeoff: a revocation signed from a view older than the key's re-approval is refused (
seq_conflict). The signer has to sign it again at the current seq.Evidence
vitestoverpackages/openclaw-id-protocol: 21 files, 141 tests passed. New tests are inrevocation-scope.test.ts(6) andinvite-retention.test.ts(4).pnpm tsgo:core, package tests) report no errors.oxlintfinds no problems in the 16 changed files, and the max-lines ratchet passes.config/test-lines-allocations/openclaw-id-bounded-authority-state.txt(slack 76 againstmain658e3db2a46).Follow-ups
src/mailbox/payload.ts), so it must re-vendor this commit before mailbox revocations in the new form go through. claw-loader signs no revocations or invites; re-vendor it to stay in step.claw_idandseq. The invite signer in feat(openclaw-id): add the Control UI account menu, linking dialogs and the Access page #192352 (extensions/openclaw-id-access/browser/invites.ts) already sets a 7-day expiry, which fits the new limit.