Repository navigation
feat(openclaw-id): add Gateway membership authority and publication behind the Labs flag - #192335
Conversation
|
🦞👀 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. |
|
Local |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR adds durable Gateway membership authority, Discovery publication, and owner-only RPCs behind the default-off OpenClaw ID Labs switch. Example: An owner removes member acct-bob from a linked experimental claw.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this maintainer-authored feature stage open. The five previous findings are addressed, and no additional concrete defect was established in the inspected paths. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway service consumes signed protocol statements and local configuration, persists membership through existing shared-state workers, and produces admission facts, removal effects, owner views, and signed Discovery publications. flowchart LR
A[Gateway RPC clients] --> B[OpenClaw ID service]
C[Discovery mailbox] --> B
B --> D[Protocol membership authority]
D --> E[Shared state workers]
B --> F[Connection and run owners]
B --> G[Discovery publication]
Technical reviewBest possible solution: Retain one protocol-backed Gateway authority using existing persistence and effect owners, and complete the final-effect authority verification before landing this stage. Do we have a high-confidence way to reproduce the issue? This is a feature PR rather than a current-main bug report; source inspection confirms the new Gateway stage is absent from fetched main. Is this the best way to solve the issue? The staged design uses the existing protocol authority, shared-state worker, canonical profiles, and connection/run owners without introducing a competing membership policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 12265e76a349. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: No additional concrete bypass was established, but the repaired authority boundaries still require final-effect evidence. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. 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
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 HistoryReview history (10 earlier review cycles; latest 8 shown)
Reviewed November 5, 2026, 8:56 PM ET / November 6, 2026, 01:56 UTC (Revision 11). |
1eb1706 to
e9522d1
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
9269511 to
f6264ac
Compare
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…ehind the Labs flag (openclaw#192335) * feat(openclaw-id): add Gateway membership authority and publication behind the Labs flag * fix(openclaw-id): keep removal enforcement through failures and let stop cancel Discovery - Keep a tunnel token's binding until its revocation is confirmed; retry unfinished revocations at start. - Settle each committed mailbox statement's effects before applying the next. - Cancel Discovery requests when remote access stops, bound each request with a deadline, and run startup publication beside the lifecycle queue. * fix(openclaw-id): recheck device authority before relaying mail and stop mailbox statements on stop - Device mail rechecks the caller and its exact active certificate immediately before the request leaves. - A stopped mailbox reader submits no further statement of the message it is applying. * fix(openclaw-id): keep tunnel-issued tokens bound across a restart with the Labs switch off Saved device-token bindings are read from the local claw record once at Gateway start, whatever the Labs switch says, and every device-token check waits for that read. A record that cannot be read refuses device tokens until the switch turns on or the Gateway restarts. No process, socket or remote service is touched. * fix(openclaw-id): delete spent invites with their reports before each Gateway write The Gateway's invite sweep, which already expires pending redemptions before every write, now also deletes invite records the protocol reports as spent (cap expired, nothing pending) together with their display reports, so stored invites stay within the protocol's cap. Test fixtures sign revocations with the claw id and seq, and a mailbox regression covers a captured revocation replayed after the device was approved again. * fix(openclaw-id): keep token bindings in their own row so a full claw still saves At the protocol caps (20 owner devices, 256 members with 10 browsers each, 100 invites) a claw record that also carried a token binding for every browser would be about 1.3 MiB, past the 1 MiB plugin-state value limit, and every write would fail. The bindings now live in a second row of the same namespace; each row stays within the limit (about 790 KiB and 550 KiB with every text field at its longest). A record written before keeps its bindings until the next write moves them into the row. * fix(openclaw-id): retain member profiles and atomically partition claw state openclaw-013: preserve OCID-keyed display profiles across invite cleanup and retain bounded membership approval times. Reconcile lost write acknowledgements before publishing authority or effects. * fix(openclaw-id): bound unsigned persisted Discovery metadata openclaw-013: reject oversized opaque identities and cursors without truncating or changing signed statements. Preserve headroom for membership writes. * test(openclaw-id): match stored secret fields, not random signature text The record check matched 'kit' inside random base64 signatures. It now refuses secret-named fields and the OCK1- kit text. * fix(openclaw-id): keep pending Discovery work bound to the lifetime that admitted it A check_name, publication, owner notice or mailbox start captured the service's stop signal only after loading the Gateway key. Turning remote access off in that window replaced the signal, so the request still went to Discovery (for check_name, with the link code). Each operation now captures the signal when admitted and does nothing if that lifetime stopped while it was being prepared. A mailbox reader started for a stopped lifetime would also have blocked the next lifetime's reader. * fix(openclaw-id): address CI guards and review findings - Capture the owner-notice lifetime before importing the notice sender, so turning remote access off during that import also stops the notice. - Mark the three openclawId.* methods as new in the 2026.11 train. - Add the OpenClaw ID config schema to the PR wrapper inventory. - Keep the Gateway database-worker test inventory sorted. - Document OpenClaw ID remote access on the experimental features page. - Remove chained type assertions, annotate new assertions, note the claw store mock isolation, break the authority/binding-check type cycle, classify the OCID profile reader as worker-only, and rename the provider constant so it is not counted as an environment variable. * test(openclaw-id): prove a stop during notice preparation sends nothing Hold the owner-notice sender's import, turn remote access off, then release it: no notice is sent. The test fails when the lifetime is captured after the import. Drop the mocked token-binding round-trip, which real persistence and reopen coverage already exercises. * test(openclaw-id): match the test-line allocation to added lines
…ount 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.
…ount 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.
…ount 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.
…ount 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.
…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.
) * fix(plugins): portable plugin-state keys for PostgreSQL Use an exclusive SQL lower bound for Doctor pagination instead of a NUL-suffixed cursor. Reject new NUL keys in test-only plugin-state fixtures while retaining legacy SQLite adoption reads. Add real PostgreSQL Doctor regression coverage and register it in conformance and database-worker lanes. Refs openclaw#184862 openclaw#188642. * test: account for rebased plugin-state coverage * test(clickclack): import legacy revocations before adoption (cherry picked from commit 395cac7) Release adaptation: Only exclusive SQL lower bound in kernel and Doctor pagination; preserve legacy SQLite keys and public validation. Regression exercises real Doctor paging and inspected executed SQL bindings; no NUL-key fixture policy, schema or unrelated tests. Follow-up dispositions: 8253356 fix: preserve child results after source lifecycle changes (openclaw#202708); f3f89c7 fix: show saved child results when completion delivery fails (openclaw#202664); c45faa8 fix: align CI tests with admitted tool calls (openclaw#202655); 5c9389a fix: make channels add report required plugin install failures (openclaw#202091); 52b9188 fix: show hosted model details in `models list` without a Gateway (openclaw#202490); d248a76 fix: show an outcome when kept child chats return no answer (openclaw#202423); 5148804 fix(discord): check a queued message's access again when its turn starts (openclaw#202330); 2470d62 fix: let setup use account models with a fresh catalog (openclaw#202019); 9fa0b92 fix: let PostgreSQL Gateways start with plugin-backed secrets (openclaw#201063); c180824 fix(plugins): Talk and plugin-loading requests fail on PostgreSQL Gateways (openclaw#201976); cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 17c5fb0 fix(state): PostgreSQL state created before Template bootstrap deferral is refused as schema drift (openclaw#197425); b5c1277 fix: let resumed parents collect children stopped by restart (openclaw#201460); f920a7e chore(postgres): qualify cron completion during graceful shutdown (openclaw#201246); 1680f54 fix(openai): new ChatGPT subscription models missing until an OpenClaw release (openclaw#201130); 0d8820a fix(media): image descriptions use the ChatGPT OAuth route when OpenAI has no API key (openclaw#199299); ee3e16e test(agents): trim and fold low-value regression suites (openclaw#198916); b8029b4 test(agents): qualify PostgreSQL simple-completion acquisition (openclaw#200956); 703c82d fix(sessions): record queued input end causes and recover them across crashes (openclaw#200533); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); d565e17 fix(ci): retire deleted session fork test from inventory (openclaw#200611); 4cf12c6 chore(postgres): qualify prompt refresh and rebalance CI (openclaw#200488); d460273 fix(templates): release earlier Template-managed agents (openclaw#200303); ff75829 fix(update): --no-restart update fails when the Gateway restarts itself during Doctor's stop (openclaw#200181); 0b2ad60 chore(postgres): cover compaction watched-session prompts (openclaw#200117); b90c573 test: consolidate redundant coverage (198795 recut) (openclaw#198943); a042363 test: consolidate redundant coverage (198793, part 2) (openclaw#198936); 9bfad2b test: consolidate suites while retaining recovery owners (openclaw#198933); 4e9812c test: consolidate redundant coverage (198789, part 2) (openclaw#198932); 90814f5 fix(subagents): stops a finished sub-agent's chat being deleted before its parent reads the result; 799bc0b fix(ci): stabilize hourly fixtures and retire unused exports (openclaw#199851); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); a4cc2ad fix: undo cold-session compaction CPU and latency regressions (openclaw#199561); 55fec79 fix(agents): stop divergent mid-turn overflow recovery (openclaw#199636); 2c4413a fix: reduce Gateway stalls under filesystem pressure (openclaw#197510); 37d977f fix: output reducers are skipped in headless and Code Mode runs (openclaw#199434); c9ee264 fix(compaction): concurrent sessions wait for each other's summaries during compaction (openclaw#196550); 2471ddc feat: let agents review generated images before delivery (openclaw#198227); 21f7dc6 fix(github): publication fails with PostgreSQL session or state stores (openclaw#193749); 63d9e57 fix(ci): new PostgreSQL suites are omitted from conformance (openclaw#198390); 466a4b6 fix(telegram): steered answers quote the wrong input (openclaw#178124); 87b6f52 fix(delivery): resend routed Telegram finals after an ambiguous network failure (openclaw#192779); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); cff99b2 fix(agents): keep provider history append-only across runs (openclaw#197874); 8a328bf feat: add an opt-in usage-ranked tool index (openclaw#197128); 097e648 fix(ci): plan only executable infra tests (openclaw#197911); 76385fd fix(models): discovered models become "Unknown model" after restart or an ended sign-in (openclaw#197784); 89d4177 fix(plugin-state): guarded calls fail until Gateway restart after an unknown write outcome (openclaw#197790); baca36e fix(sessions): commit selected invitations with original messages (openclaw#184512); 699e538 fix(sessions): drain passive notices on sessions_send resumes; d6ded18 chore(ci): drop retired test-lines allocation records (2/3) (openclaw#197656); e0dd020 fix(agents): collect process results at suspended-run capacity; 4897740 feat(auth): preserve delegated OCE user profiles and permissions (openclaw#196856); 7197ce1 feat(templates): install bundled plugins through native management (openclaw#196349); 9c6ee9b feat: let Template automations start paused for onboarding (openclaw#196323); 79a6214 fix(message): retain local final replies in conversation history (openclaw#187795); caa978c feat(templates): open durable chat before verified setup (openclaw#196392); 78e73aa fix(sessions): cold PostgreSQL conversations fail after idle readers close (openclaw#189991); b6ed907 perf(sessions): persist active transcript facts for hydration (openclaw#193682); 1595dd2 feat(plugins): reauthorize accepted session work (openclaw#176886); b43ad0a fix(models): avoid reloading plugins on catalog refresh (openclaw#193903); 0947d02 fix(ci): avoid unrelated PostgreSQL runs and admit owned tests (openclaw#193870); 428ca7d feat(openclaw-id): add Gateway membership authority and publication behind the Labs flag (openclaw#192335); c718583 fix(update): repair refuses forever after a verified update fails a later step (openclaw#193132); 3f64174 fix: deliver background replies after a reload retires the turn registry (openclaw#193130); 982f3b1 fix(imessage): report Automation failures after Gateway updates (openclaw#186117); 31b28e9 fix(agents): wait for a peer OAuth refresh before failing request auth (openclaw#192906); cf50d4a feat(storage): support read-only PostgreSQL standby inspection (openclaw#192645); 82fd4e6 fix(agents): retain stale session target refusal reasons (openclaw#192681); 8ac4e19 fix(worktrees): reserve capacity on PostgreSQL (openclaw#192537); 718b349 fix: reduce session startup stalls under storage contention; 08f4a19 refactor(skills): move Skill Workshop into its bundled plugin (openclaw#192471); 837402a fix(clawrouter): keep upstream credit failures off the shared key (openclaw#192575); f38495f fix(plugins): reject late routing from canceled runs (openclaw#192492); dc5d61a improve(sessions): reduce unnecessary maintenance query rows (openclaw#192023); c4bf0dc fix(sessions): avoid extra maintenance scans for embedded archives (openclaw#184507); e44b3d6 fix(team-reports): recover after database connection loss (openclaw#192020); 991fb33 fix(logbook): recover after database connection loss (openclaw#192011); e6d0d2e fix(test): include omitted PostgreSQL conformance suites (openclaw#191962); da5ff0f fix(codex): reject native hooks from a previous run (openclaw#191788); 09f0b0b feat(plugins): add skill usage runtime for plugins (openclaw#191661); 00b2ff4 fix: parent sessions miss child approvals with a custom session store (openclaw#189827); be44b10 fix: stop completed session writes retaining request data (openclaw#191197); d40aa7c fix(sessions): replay creation requests across Gateway restarts (openclaw#190862); d894035 fix: await Doctor shared-state repair preparation (openclaw#190875); b515cc7 feat: fork threaded conversations with Telegram support (openclaw#190783); def6349 feat(plugins): plugins can run a hidden forked turn of a session with their own tools (openclaw#190950); d983e34 feat(plugins): plugin commands can continue the agent with a replacement prompt, on every channel (openclaw#190908); ea3f0b8 fix(ci): provision Node test prerequisites and retain Baseten routing (openclaw#191050); 29503e1 fix(update): Gateway stays stopped after the updater process dies mid-update (openclaw#188497); fc8c2d0 fix(update): preserve unfinished handoff artifacts (openclaw#190571); 7c26e8c fix(ci): cover PostgreSQL managed update handoffs (openclaw#190336); 4913d41 fix(ci): prevent truncated PostgreSQL target listings (openclaw#189509); 8925f62 fix(gateway): start restored PostgreSQL homes on the first attempt (openclaw#190291); 177fe32 feat(models): preserve inference capabilities in opt-in catalog v3 (openclaw#189678); 7faf32d feat: retain repository disk authority through recovery (openclaw#189106); a658df3 feat(database): capture externally quiesced SQLite migrations; 0f9e7f7 feat(database): capture exact SQLite migration capsules; 4fb684e feat(backup): add PostgreSQL local companion checkpoints; c89a101 fix(doctor): migrate auth profiles on PostgreSQL stores (openclaw#189639); 799de09 fix(ci): split oversized workspace and setup files (openclaw#189356); 21ee847 fix(acp): keep completed run conversations resumable (openclaw#189273); fce0e56 perf(sessions): open cold history without restoring archives (schema 39) (openclaw#188397) Validation: Baseline1 NUL-binding assertion failure/21passing; candidate22/22passes (188693-green.log). Real SQLite Doctor path and generated SQL proved; no native PostgreSQL server execution claimed. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 0895146d8c1493146f5c6461eee0b10c329bdd1e) (cherry picked from commit f8ccaa70bc9773d6bbb569bc0e275eee0c544ead)
What Problem This Solves
OpenClaw ID remote access needs a Gateway-side owner for each claw's membership: who the owner devices and members are, how signed changes from them are accepted, and how the claw is published to Discovery. This draft adds that owner, without any transport, sign-in or UI, so it can be reviewed on its own.
User Impact
No user-visible change. Everything here sits behind the
gateway.openclawId.enabledLabs switch, which is off by default. With the switch off the Gateway starts nothing, opens no sockets, makes no OpenClaw ID, Discovery or relay calls, hides theopenclawId.*methods and events fromhello, and answers everyopenclawId.*call with "off" or a refusal.With the switch on, a claw still cannot be linked from this PR alone: linking needs the tunnel endpoint key, and the tunnel lands in the next PR. Linking is refused with
tunnel_not_runninguntil then.Why This Change Was Made
This is the third PR of the OpenClaw ID stack. It builds on the protocol package (#191469, merged) and on #193146 (merged), which makes revocations replay-safe and bounds invites. The next PRs are:
What this PR adds, all in
src/gateway/openclaw-id/unless noted:authority.ts,claw-store.ts,binding-check.ts,claw-migration.ts): the durable claw record in the shared state database. It applies owner-signed statements through the protocol package's authority rules, keeps invite reports, approval times and device-token bindings in separate rows written in one transaction, deletes spent invites with their reports before each write, and runs the link ceremony (prepareLink/commitLink). A claw's root never changes: there is no owner reset (it was removed from the protocol package and is redesigned separately).channel.ts,connection-identity.ts,tunnel-principal.tstypes,device-token-binding.ts): a client islocal_operatoronly when the handshake attested direct loopback, andtunnelonly when it carries a relayed device key (set by the next PR). People, owner devices and invites are disclosed only to the local operator or an active owner device.publisher.ts,publication-retry.ts,registration-recovery.ts,discovery-client.ts,gateway-key.ts,stale-seq.ts): publishes the descriptor and a K_gw-signed membership snapshot to Discovery, retries failures with backoff, refreshes before the snapshot ages out, and recovers a registration that Discovery lost.mailbox-reader.ts,owner-notices.ts,device-mail-relay.ts): reads the claw's Discovery mailbox (invite redemptions and owner-signed changes) and mails owner notices.removal-effects.ts,member-activity.ts,tunnel-connections.ts,people-events.ts,owner-expiry.ts,owner-lifecycle.ts,invite-expiry.ts): removing a device closes its connections, cancels its runs and revokes its tokens; owners get a keylessopenclawId.people.changedinvalidation.service.ts,src/gateway/server-methods/openclaw-id*.ts):openclawId.status,openclawId.people(owner only) andopenclawId.authority(check_name,prepare,commit,publish,submit,register_invite,device_mail).gateway.openclawIdis hot-reloadable), and stopped with the Gateway.GatewayClientRegistrygainssubscribeChangesso People events can observe connections without replacing another owner.gateway.openclawId(enabled,issuerUrl,clientId,discoveryUrl,relayUrl,loaderDomain,ownerDeviceInactivityDays,memberDeviceInactivityDays) with schema, labels, help and docs.Notes for review
core-descriptors.tswas at the 700-linemax-lineslimit, and the protocol-since check needs new methods inline in that table. To fit the threeopenclawId.*rows, thecron.statusshare policy object is now written on one line. Formatting only.device-token-binding.ts,tunnel-child/keyfile.ts) have Knip production-scan entries with a note to drop them with that importer. Focused tests cover them here.tunnel-child/keyfile.tsis in this PR because K_gw (gateway-key.ts) uses the same 0600 key-file loader; the tunnel child itself is in the next PR.openclawId.people.changedevent is allowlisted for iOS and Android: the People page is Control UI only.Review
An independent review (GPT-6 Astra) found four issues in the code carried over from the staging branch. All are fixed here, with regression tests:
openclawId.authoritypublishdid not check ownership, and its result names the owner account. It now requires a current owner, checked before and after publishing.discoveryUrl,loaderDomainand the inactivity windows. A change now restarts the service.ClawSweeper's review of
fbdae28found three more; all are fixed ine9522d1, each with a regression test:orphanedTokens: bindings whose key is no longer in the membership).root_statementmessage with several statements now applies each committed statement's effects (close connections, cancel runs, revoke tokens) before the next is submitted, so a later failure cannot discard an earlier removal's effects.A second ClawSweeper pass (on
e9522d1) found two more, fixed in9269511with tests:root_statementmessage, the reader's stop signal is checked before each statement; a statement already committed still gets its effects.Fixed, maintainer decision (2026-11-04): read saved token bindings at Gateway start even with the switch off. A token whose revocation failed, or any token issued over the tunnel, stays bound to its device key across a restart with the Labs switch off:
service-token-bindings.tsreads the local claw record once at Gateway start (server-runtime-state-prepare.ts, before any listener admits a connection). It publishes the binding owner only when saved bindings exist, so a Gateway without them behaves exactly asmain. No process, socket or remote service is touched;service.inert.test.tsgains a case for this read.checkDeviceTokenPeeris now async and waits for that read, so a connection that arrives during boot cannot slip past it.device-token-bindings-unreadable) until the switch turns on or the Gateway restarts, and a security warning is logged. Shared-token and password auth are unaffected, so the owner keeps a way in.service.token-bindings-start.test.ts(restart with the switch off, a check that arrives mid-read, no saved bindings, unreadable record) anddevice-token-binding.test.ts(the read gate, unreadable refusal). The ingress callers arrive in feat(openclaw-id): add the tunnel transport, OpenClaw ID sign-in and relayed-device Gateway auth #192345, which adds an HTTP test against the real claw store.ClawSweeper's review of
08d444e: replayed mailbox revocations (P1), fixed by #193146. A captured revocation replayed through the mailbox after an owner approved the device again removed it again. The repair is in the protocol package (#193146, credited to @SebTardif's #192230): a revocation now names its claw and the seq its signer saw, and removes only keys listed at or before that seq. This PR adds the Gateway side:mailbox-reader.test.tsdrives the real authority throughapplyMailboxMessage: revoke, approve again, replay. The replay is refused withseq_conflict, the device stays admitted, and no removal effects run. The test fails when the protocol's seq check is removed.service.invites.test.ts).ClawSweeper's review of
f7b57d3: member details and record size (two P2s), fixed with a maintainer decision (2026-11-05).openclaw.id). The reported email is display data only: it is never an alias, never merges profiles and grants nothing. Approval times are kept in their own row. Existing approved reports move into profiles on load, before their name and email are cleared.ClawSweeper's reviews of
ee1977aandd204141: one P2, fixed with a test.notifyOwnerscaptured the service lifetime only after importing the notice sender, so turning remote access off during that import let the notice adopt the next lifetime's signal. It now captures the lifetime first.service.owner-notices-stop.test.tsholds that import, turns remote access off, then releases it and checks that no notice is sent; it fails when the capture follows the import.openclawId.*methods are markedsince 2026.11; the config schema is in the PR wrapper inventory; chained type assertions are gone and new assertions carrySAFETYnotes; the type-only cycle betweenauthority.tsandbinding-check.tsis removed; the profile provider constant is renamed so it is not counted as an environment variable; the profile reader is listed as worker-only; and the experimental-features page has the OpenClaw ID section that the config docs link to.Evidence
pnpm test src/gateway/openclaw-idplus the profile owner's tests: 30 files, 202 tests passed on90b82ce603c, including the review regressions.service.stall.test.tsruns the real service and Discovery client against a Discovery that never answers: turning the switch off completes and aborts the publication and mailbox requests, well inside the request deadline (it times out against the previous head). The config schema,hello, method, broadcast-scope, config-reload and client-registry suites also pass.authority.test.tschecked the stored record for secrets by matching anykitsubstring, which random signature text can contain, so it failed intermittently. It now matches secret-named fields and theOCK1-kit text.labs-off.test.ts, plusservice.inert.test.tsand thehellotest): with the switch absent orfalse, even with a linked claw record and every service URL configured, the service spawns no child, opens nonet/dgramsocket and calls nofetch; everyopenclawId.authorityaction andopenclawId.peopleis refused for the loopback operator;openclawId.statusreportsoffand no link;helloadvertises noopenclawId.*methods or events.mainat0afeaad457c. The only conflicts were two generated config-baseline files, regenerated withpnpm config:docs:gen.pnpm tsgo:core, the core test typecheck,pnpm build, changed-file lint andpnpm config:docs:checkpass on this head.config/test-lines-allocations/openclaw-id-gateway-core.txtallocates the 4,446 test lines this PR adds, and the ratchet passes on this head. They are new tests for new surface; no existing tests were replaced.claw-store.persistence.test.ts). The protocol's new listing seqs and invite creators are optional, so staging records load unchanged.claw-migration.test.tsloads pre-allowlist records and rewrites them once. No released OpenClaw version has OpenClaw ID state, so there is nothing to upgrade from a stable release.1bc84010c2e, whose Gateway and UI sources match this stack before the rebase fixes). The staging gates recorded in feat(openclaw-id): add protocol contracts package #191469 exercise this authority through the tunnel: removing an owner device also removes the device it approved, the next published snapshot lists neither, and the 21st owner device is refused withlimit_reached.Production-path proof and landing
This stage cannot be exercised end to end on its own. Nothing on ingress calls
checkDeviceTokenPeeruntil #192345, and a relayed device needs that PR's tunnel plus the iroh binding (#191470). The maintainer decided (2026-11-05) to land this stage on the unit and real-storage evidence above, and to supply production-path proof (allowed access, removed-device refusal before effects, saved bindings enforced after a restart with Labs off) on a real Gateway once #192345 and #191470 are in. The notice-preparation race is in-process and has no I/O to observe; its regression test above is the proof.Inherited CI failure:
checks-node-compact-small-13failstest/scripts/ci-workflow-guards.test.ts("keeps private Control UI servers and resource-sensitive files under one serial owner"). Main's #193856 addedui/src/e2e/agents-settings-delete.e2e.test.tswithout registering it with the Control UI e2e owner. This PR changes no UI or e2e files, and the test passes on this branch without the merge.