Skip to content

feat(openclaw-id): link your OpenClaw ID so your owner devices connect as you - #197628

Merged
jalehman merged 7 commits into
mainfrom
feat/ocf-510-link-openclaw-id-profile
Nov 12, 2026
Merged

jalehman merged 7 commits into
mainfrom
feat/ocf-510-link-openclaw-id-profile

Conversation

@jalehman

@jalehman jalehman commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #197559 (stacked on it; review that first)

What Problem This Solves

When you connect to your claw from one of your OpenClaw ID owner devices, the Gateway shows you as "Shared owner" rather than as your own profile.

User Impact

With OpenClaw ID Labs on, you can link your OpenClaw ID account to your own personal profile (Profile → Identity → Link). After that, your owner devices connect as you, while keeping full owner authority. Linking and unlinking affect only future connections. A linked owner device is never limited by the named role on the profile it's linked to.

Why This Change Was Made

  • One link step: both sides are proven on one connection. The device sign-in from feat(openclaw-id): sign in with OpenClaw ID over a verified personal sign-in #197559 proves the account, and the personal sign-in proves the profile. So there is no profile picker.
  • One profile per account: an account can be linked to at most one profile. A profile can hold several accounts, including after a profile merge, and unlink removes all of them.
  • Profile vs. certificate: the linked profile decides who you appear as. Your owner certificate decides what you're allowed to do.
  • Role changes don't touch owner devices: users.setRole publishes a role-only change. A linked owner device's runs, recovered runs, cron streams and socket are rechecked, not revoked, because its certificate is unchanged. A merge is still an identity change and still revokes them.
  • Owner-only bypass: only a real owner tunnel connection whose certificate is currently valid skips the person's role. Synthetic clients, host ingress, members and nodes keep their existing limits. Once the owner certificate lapses, the person's role applies again.
Where owner authority is preserved
  • connect and session attribution
  • operator-run capture, tool dispatch and run recovery
  • cron sandbox streams
  • policy refresh
  • access-grant resumption
  • personal APIs (GitHub, model accounts, personal files, backgrounds)
  • My Skills and session skill seeding

Profile row states (Labs on): the OpenClaw ID row is there from first paint. It shows Loading, then Link/Unlink on a personal sign-in. On other connections it says "Link over a personal sign-in, such as Tailscale", with no action. If loading fails, it shows an error with Retry. With Labs off the row is absent.

Link and unlink writes are fenced through to commit. They check the live personal connection, the profile and the Labs switch at commit time.

Known limitations (fail closed: they deny, never grant)

  • OCF-513: sessions a linked owner device creates are still sandboxed when the person's role requires a sandbox.
  • OCF-514: GitHub publication can refuse a linked owner whose profile is restricted. The publication requester snapshot doesn't carry the owner-device principal, so the person's role applies.

Both are tracked as follow-ups blocked by this PR and are intentionally not fixed here.

Evidence

  • Focused tests pass, including a real-Gateway test with a linked owner whose role is talker (a role with no read access). It checks profile attribution, admin scope, personal APIs, backgrounds, My Skills, and a config refresh that does not drop the connection.

  • Regression tests for each review finding fail without its fix:

    • role resolution in tool dispatch, policy refresh, access-grant resumption, skill-library limits;
    • stale-certificate personal APIs, and a link write fenced after authority changes;
    • be82b88: users.setRole keeps a linked owner's captured run (an identity change still revokes it), and keeps its real-Gateway socket and admin access;
    • be82b88: session skill seeding, checked by the actual seeded skills rather than mock arguments;
    • be82b88: the Profile row is present while loading, and a failed load recovers through Retry.
    • bc7c8ed: a stored role change (written through the profile writer, as users.setRole does) keeps a linked owner's run. Run capture, recovery and cron streams no longer compare the stored role for a current owner certificate; identity and certificate checks still apply. This test fails without the fix.
  • Affected files rerun together after be82b88 (role, merge, request context, run authority and recovery, cron streams, identity scopes, linked owner, Profile UI): 15 files pass.

  • pnpm tsgo:core, tsgo:ui, tsgo:test:src, tsgo:test:ui, oxlint, ui:i18n:verify and check:control-ui-controllers pass.

  • Test lines: config/test-lines-allocations/197628-openclaw-id-link-profile.txt records 483 lines over the allowance. These are the regression tests for each review finding on linked-owner authority: dispatch, policy refresh, recovery, stored-role changes, personal APIs, skill seeding, fenced link writes and the Profile row.

  • Restacked on feat(openclaw-id): sign in with OpenClaw ID over a verified personal sign-in #197559's boot-size change: the link option of the device sign-in now lives in the lazily loaded device-sign-in.ts.

  • Accepted CI failure — control-ui-performance (+68 B): startup ("new"/"chat" boot) JS grows 68 B gzip against feat(openclaw-id): sign in with OpenClaw ID over a verified personal sign-in #197559's head; main is already over this cap, so only 64 B of build variance is allowed. None of this PR's code is in control-ui-boot-shared.js; the only change there is one extra preload-map entry (claw-name) for the Profile page's identity row. Two UI-only workarounds made it larger (+426 B, +228 B). Josh accepted the 68 B on 2026-11-12.

Live proof against staging OpenClaw ID

Real Gateways built from this branch, with headless Chromium. The personal identity comes from a trusted proxy on the same host, and approvals happen on the staging issuer.

Upgrade from stable 2026.11.3 → head be82b88 (fsn1, throwaway Gateway and state):

  1. Stable created three personal profiles. It renamed two and added an email alias.
  2. openclaw doctor --fix ran the standard migrations. Agent database schema 27 comes from main; this PR adds no schema.
  3. This build started on the same state with Labs on.
Check Result
Profiles, display names and email aliases load unchanged after upgrade pass (users.list before = after)
Upgraded profile shows OpenClaw ID "Not linked" with Link pass
Link: device code → approve on staging → the row shows the account with Unlink pass
link_status returns the linked account without its account ID pass
The same account linked from another profile refused: "already linked to another profile"; nothing is linked there
Unlink the row returns to "Not linked"

OpenClaw ID testnet, head 63ee6b00. The gateway lab host ran a throwaway Gateway; the claw's live service wasn't touched. It passed the same link → refuse → unlink checks. A testnet rerun at be82b88 was stopped when an SSM port forward stalled, so be82b88 was proven by the upgrade run above.

Not covered live: a real owner-device reconnect over the OpenClaw ID tunnel after linking. Enrolling an owner device needs Discovery enrollment and the tunnel, so the real-Gateway integration test covers that path.

Before (5f6001b): no OpenClaw ID row After, upgraded profile: not linked
Profile identity group without an OpenClaw ID row Upgraded profile with OpenClaw ID Not linked and Link
Link sign-in Issuer confirmation (staging)
Device sign-in dialog opened from Link Issuer asks to confirm the code
Linked Same account on another profile Unlinked
OpenClaw ID row shows the account and Unlink Bob's profile shows the already-linked message Row back to Not linked

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR links OpenClaw ID accounts to personal profiles so owner devices connect as that person while retaining certificate-based owner authority.

Example: Alice links her OpenClaw ID account to her personal profile and reconnects an owner device.

  • Before: The device appears as Shared owner.
  • After: The device appears as Alice and retains owner permissions even if Alice's personal role is reader.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is coherent and the prior blocker is resolved, but behavioral evidence is incomplete.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: An owner's remote devices appear as Shared owner instead of the owner's personal profile.
Reason: The maintainer-authored direction provides coherent personal attribution while explicitly retaining certificate authority and deferring the named adjacent limitations.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed feature addresses a real identity gap, and the previous stored-role finding is fixed. No additional definite blocking code defect was established.

Priority: P2
Reviewed head: bc7c8ed2c4e1a88004dae14a4b0393a42e370e8e

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supply redacted live output or a recording of a genuinely enrolled owner device reconnecting through the OpenClaw ID tunnel after linking, showing the personal profile and retained owner access, then shared-owner attribution after unlinking.
Agent review details

How this fits together

The Control UI proves the account and personal profile, the existing profile worker stores their link, and Gateway connection admission uses it for attribution while certificate authority governs owner access.

flowchart LR
  A[Personal sign-in] --> B[Control UI link action]
  C[OpenClaw ID issuer] --> B
  B --> D[Profile identity worker]
  D --> E[Gateway connection admission]
  F[Owner device certificate] --> E
  E --> G[Personal attribution and owner access]
Loading

Technical review

Best possible solution:

Use the existing profile identity store for attribution and preserve certificate-based owner authority across the existing Gateway consumers.

Do we have a high-confidence way to reproduce the issue?

Current-main connection admission attributes OpenClaw ID owner devices to the shared owner, establishing the reported identity gap from source; no runtime reproduction was performed during this read-only review.

Is this the best way to solve the issue?

The design separates personal attribution from owner authorization and reuses existing sign-in, profile persistence, and certificate owners; the prior stored-role repair now covers all three identified comparisons.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 46350dafd299.

Provenance checked

  • Owner-device identity and tunnel policy keeps the original intent (59b8a11: Authenticate relayed devices from membership authority and preserve full owner authority for owner devices.)
  • Retained operator role checks changes intended behavior with a stated reason (fix: preserve operator authority through queued and child runs #153989: Keep queued and delegated work bound to its authenticated source and current permission ceiling.)
  • Restart recovery identity checks keeps the original intent (fix: preserve operator access after Control UI restart recovery #166553: Preserve authenticated operator access across restart recovery without expanding the original authority.)
  • Personal profile authorization keeps the original intent (4674051: Bind personal account operations to the authenticated person's profile and existing authority.)
  • Personal skill-library role ceiling changes intended behavior with a stated reason (75bcd26: Give shared-Gateway users personal libraries with permission-controlled access and immutable session selections.)
  • Device sign-in dialog keeps the original intent (feat(openclaw-id): sign in with OpenClaw ID over a verified personal sign-in #197559: Prove the browser's OpenClaw ID account over a verified personal connection without granting owner membership.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Raw commit 59b8a11 adds src/gateway/openclaw-id/tunnel-principal.ts:199 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 59b8a114bf6d; files: src/gateway/openclaw-id/tunnel-principal.ts)

PR surface

Source +860, Tests +883, Docs +14, Other +4. Total +1761 across 50 files. Added test files: 5.

View PR surface stats
Area Files Added Removed Net
Source 37 963 103 +860
Tests 11 887 4 +883
Docs 1 16 2 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 0 +4
Total 50 1870 109 +1761

Preflight source

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

Review metrics

Metric Value Why it matters
Account RPC surface 2 new actions and 1 optional request field Adds link_status and unlink to openclawId.account, plus link on device_poll; these extend the existing RPC rather than adding a second endpoint.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Useful identity attribution improvement behind an existing, disabled-by-default Labs feature.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

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

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-12T08:34:50.442Z sha 63ee6b0 :: blocked before merge. :: [P2] Preserve owner work across personal role assignments | [P2] Expose identity-load failures with a retry action | [P3] Reserve space for the identity row while it loads
  • reviewed 2026-11-12T11:56:18.684Z sha be82b88 :: needs changes before merge. :: [P2] Preserve owner work across persisted role assignments
  • reviewed 2026-11-12T14:31:09.646Z sha d777cdb0d1fe04ad4f5177a52e3ee896f57fe5d6 :: needs changes before merge. :: [P2] Preserve owner work across persisted role assignments

Reviewed November 12, 2026, 10:22 AM ET / 15:22 UTC (Revision 4).

@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@jalehman
jalehman force-pushed the feat/ocf-509-ocid-personal-sign-in branch from 5f6001b to 5bfe343 Compare November 12, 2026 14:18
@jalehman
jalehman force-pushed the feat/ocf-510-link-openclaw-id-profile branch from be82b88 to d777cdb Compare November 12, 2026 14:23
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@jalehman
jalehman marked this pull request as ready for review November 12, 2026 14:36
@jalehman
jalehman force-pushed the feat/ocf-510-link-openclaw-id-profile branch from d777cdb to bc7c8ed Compare November 12, 2026 15:14
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
Base automatically changed from feat/ocf-509-ocid-personal-sign-in to main November 12, 2026 20:02
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 3a065174763fae12ce4148d8e335c0138910e39d
  • Maintainer: @jalehman
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/cron-stream-sandbox-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/operator-role-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/operator-run-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/personal-profile-authorization.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/connect-session.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/connect-user-profile.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-origin-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

…y refresh, recovery grants, backgrounds and skills
…e in personal APIs; seed session skills with it
…row keeps its place and retries

- users.setRole publishes a role-only change; linked owner runs, recovered runs, cron streams
  and owner sockets recheck instead of being revoked. Merges still revoke.
- The Profile OpenClaw ID row renders from first paint while Labs is on: loading, unavailable
  on ineligible connections, failed with Retry, or Link/Unlink.
- Session skill seeding is tested by the seeded skills, not the mock's arguments.
…xes for role-only publication

- Run capture, recovery and cron streams skip the stored-role comparison for a current owner
  certificate; identity and certificate checks still apply.
- The accepted-work regression persists the role change through the profile writer.
- users.setRole test expects the role-only publication; link handler mocks keep real exports.
- Record the test-line growth for the linked-owner authority tests.
@jalehman
jalehman force-pushed the feat/ocf-510-link-openclaw-id-profile branch from bc7c8ed to 3a06517 Compare November 12, 2026 20:11
@jalehman
jalehman merged commit 07c8e14 into main Nov 12, 2026
132 checks passed
@jalehman
jalehman deleted the feat/ocf-510-link-openclaw-id-profile branch November 12, 2026 20:47
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…t as you (openclaw#197628)

* feat(openclaw-id): link your OpenClaw ID to your profile so owner devices arrive as you

* fix(openclaw-id): fence link writes, keep linked owner devices' owner authority, keep merged links

* fix(openclaw-id): keep linked owner authority through dispatch, policy refresh, recovery grants, backgrounds and skills

* fix(openclaw-id): a linked sign-in releases its token only to the live connection that started it

* fix(openclaw-id): owner exemption only for a current owner certificate in personal APIs; seed session skills with it

* fix(openclaw-id): role-only changes keep linked owner work; identity row keeps its place and retries

- users.setRole publishes a role-only change; linked owner runs, recovered runs, cron streams
  and owner sockets recheck instead of being revoked. Merges still revoke.
- The Profile OpenClaw ID row renders from first paint while Labs is on: loading, unavailable
  on ineligible connections, failed with Retry, or Link/Unlink.
- Session skill seeding is tested by the seeded skills, not the mock's arguments.

* fix(openclaw-id): stored role changes keep linked owner work; test fixes for role-only publication

- Run capture, recovery and cron streams skip the stored-role comparison for a current owner
  certificate; identity and certificate checks still apply.
- The accepted-work regression persists the role change through the profile writer.
- users.setRole test expects the role-only publication; link handler mocks keep real exports.
- Record the test-line growth for the linked-owner authority tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant