Skip to content

Workspaces: add scoped Teams control hub#101913

Open
100yenadmin wants to merge 25 commits into
openclaw:mainfrom
100yenadmin:feat/dashboard-control-hub
Open

Workspaces: add scoped Teams control hub#101913
100yenadmin wants to merge 25 commits into
openclaw:mainfrom
100yenadmin:feat/dashboard-control-hub

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Teams need a useful shared control hub without receiving the workspace owner's full dashboard or inheriting a second, device-specific permission system. The previous version grouped tabs and modeled privacy around operator/device identity, which no longer matches the first-class tenant, principal, exact-resource grant, and Teams-session contracts now used by OpenClaw for Teams.

Why This Change Was Made

This rebuild uses the canonical Teams authorization domain and exact Workspaces tab grants introduced by the Teams foundation. It does not add another permission model:

  • tab visibility and actions come from the existing exact-tab grants;
  • access levels remain Read, Read + request changes, and Read + write;
  • grouping uses canonical server-issued createdBy provenance;
  • presence is ephemeral and scoped to the tenant, workspace, and exact authorized tab;
  • member sessions never gain workspace-admin or default-owner authority.

The member portal polls only the tab it is authorized to view and clears stale presence after authorization failure, logout, or expiry.

User Impact

Workspace owners can share selected tabs with external team members at the intended access level. Team members see a focused, grouped control hub and exact-tab presence without learning about unrelated tabs, users, sessions, or workspace state. Agents and external members remain bounded by their assigned resource permissions; v1 does not allow either to become the default workspace administrator.

Evidence

  • Restacked exactly onto Teams foundation e17f216d3fc76dd0490c56196d59e1c7f12140db, based on upstream-main snapshot 151a259f9a9f6fd96ace336416a3e024477cce8c; all four PR commits range-diff identically after the base refresh.
  • Exact PR head: 73700913b9ffc76ff4e2acdd45fb4e1ce1f0a238.
  • Focused Workspaces plugin, Control Hub, and Teams portal suites — 100 tests passed.
  • Strict test-only TypeScript validation found no PR-owned errors; the remaining nine diagnostics are shared environment/Node typing diagnostics outside this change.
  • Focused type-aware lint, formatting, docs-map validation, SDK API baseline, and git diff --check passed.
  • Read-only locale inspection reports 800 generated non-English fallback entries across 20 locales (zh-TW and fr: 41 each; hi and ru: 39 each; the other 16 locales: 40 each). No fallback-generated locale output was written or committed; authenticated locale synchronization remains a required external gate.

@100yenadmin
100yenadmin requested a review from a team as a code owner July 7, 2026 23:42
@100yenadmin

Copy link
Copy Markdown
Contributor Author

On dependency-guard: inherited from the unmerged Wave 1 base (#101098) — no new dependency. Private-tab visibility is enforced server-side (filterWorkspaceForOperator on every doc-serializing response, fail-closed for unidentified operators — verified a private tab is absent from a non-owner's payload + tab order); presence is id+tab only. Verified by the submitting orchestrator's own gate + security review: extensions/dashboard 92 tests, UI dashboard+plugin 119 tests, ui:build + full type-aware oxlint clean.

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Jul 7, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: 73700913b9ffc76ff4e2acdd45fb4e1ce1f0a238

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 9:32 AM ET / 13:32 UTC.

Summary
The branch adds gateway-local Teams identities and sessions, exact-resource authorization, delegated plugin tools, domain-partitioned Workspaces sharing, change requests and presence, a restricted member portal, persistent authorization schemas, and public plugin API additions.

Reproducibility: not applicable. as a bug reproduction: this PR introduces a new multi-user capability. The relevant verification is a real two-principal deployment exercising authorization and session lifecycle behavior.

Review metrics: 3 noteworthy metrics.

  • Workspace document schema: 1 changed: v1 to v2. Existing Workspaces state gains immutable resource IDs and revisions, so upgrade preservation must be proven before merge.
  • Plugin SDK exports: 5 public exports added. The SDK surface budget rises from 10,645 to 10,650, establishing new compatibility-sensitive Teams contracts.
  • Gateway protocol identity: 1 optional hello auth field added. Server-issued principals become visible to clients and therefore require protocol and client compatibility review.

Stored data model
Persistent data-model change detected: database schema: extensions/workspaces/src/default-workspace.ts, database schema: extensions/workspaces/src/schema.test.ts, database schema: extensions/workspaces/src/schema.ts, database schema: extensions/workspaces/src/ui-gateway-integration.test.ts, database schema: src/state/openclaw-state-schema.generated.ts, database schema: src/state/openclaw-state-schema.sql, and 12 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #105322
Summary: The canonical Teams issue describes this branch's exact local-account, resource-RBAC, Workspaces, and restricted-portal implementation; the history PR is related by a specific private-tab projection integration hazard.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Obtain explicit maintainer approval for the Gateway trust model and public api.teams contract.
  • [P1] Add redacted current-head two-principal runtime proof covering grants, denials, session invalidation, and privacy boundaries.
  • Resolve the dirty merge state and rerun review against the actual prospective merge result.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR reports 100 focused tests and static checks but no inspectable current-head live run showing bootstrap, invite redemption, all three access modes, exact cross-tab denial, presence, logout, expiry, grant revocation, and history denial across two principals; add a redacted recording, terminal transcript, logs, or linked artifact, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] Merging would establish a new multi-human Gateway trust model, authentication system, member role, and authorization kernel before maintainers have confirmed that core product and security direction.
  • [P1] The public plugin API and gateway-method access contract become compatibility-sensitive once external plugins can depend on api.teams and resource policies.
  • [P1] The shared state database receives a large durable authorization model, while the Workspaces document also moves from schema v1 to v2; fresh-install and upgrade behavior need explicit runtime proof.
  • [P1] If the open history PR is later merged without applying the exact-tab projection, members could retrieve private tabs from historical snapshots even though live reads are filtered.
  • [P1] The dirty merge state means the reviewed head is not the actual prospective merge result and conflict repair could alter security-sensitive paths.
  • [P1] Tests and static checks do not demonstrate cookie transport, proxy/TLS handling, two-browser isolation, revocation, expiry, or denial behavior in a real deployment.

Maintainer options:

  1. Approve, split, and prove before merge (recommended)
    Confirm the trust model, separate the security-sensitive layers into bounded landing units, repair conflicts, cover the history projection, and attach redacted two-principal runtime evidence.
  2. Reject the new core trust boundary
    Close or redesign the branch if core should remain a single-owner Gateway without local member identities or a public Teams authorization API.

Next step before merge

  • [P1] A maintainer must decide the core Gateway security model and permanent plugin API direction before conflict repair, upgrade validation, or contributor proof can establish merge readiness.

Maintainer decision needed

  • Question: Should OpenClaw core adopt this gateway-local multi-human Teams trust model and expose its host-bound resource authorization primitives as a permanent public plugin API?
  • Rationale: The patch changes who may authenticate to the Gateway, how devices are approved, which persistent identities and grants core owns, and what external plugins may rely on; tests cannot decide whether that is the intended long-term security and product boundary.
  • Likely owner: 100yenadmin — This person owns the current implementation and the surrounding merged Workspaces history, making them the best available technical owner to prepare the decision packet, though final approval requires repository maintainers.
  • Options:
    • Approve and stage the model (recommended): Sponsor the core direction, settle the public API contract, and split landing into bounded authorization, plugin, Workspaces, and portal stages with upgrade and live security proof.
    • Keep the single-owner boundary: Do not add local multi-human authentication to core and redesign sharing behind an external service or a narrower existing-owner-mediated plugin boundary.
    • Pause for a focused RFC: Keep the implementation open but stop merge work until maintainers document identity ownership, threat model, migration policy, and API stability expectations.

Security
Needs attention: The design contains extensive defensive checks, but it intentionally expands the Gateway's authentication and authorization boundary and therefore requires explicit security ownership plus live adversarial proof.

Review findings

  • [P1] Keep Teams within an approved Gateway trust model — src/gateway/teams-http.ts:38
Review details

Best possible solution:

First obtain explicit maintainer approval for the core multi-user Gateway trust model and permanent plugin API shape; if approved, land the authorization kernel, plugin contract, Workspaces integration, and portal in bounded reviewable stages with documented migrations, history projection coverage, and redacted two-principal live proof for fresh and upgraded installations.

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

Not applicable as a bug reproduction: this PR introduces a new multi-user capability. The relevant verification is a real two-principal deployment exercising authorization and session lifecycle behavior.

Is this the best way to solve the issue?

No, not yet. The implementation is technically substantial, but establishing the entire trust model and public API in one conflict-prone PR is not the safest maintainable landing path without explicit sponsorship and staged review.

Full review comments:

  • [P1] Keep Teams within an approved Gateway trust model — src/gateway/teams-http.ts:38
    This patch creates a second human authentication system, silently recognized member devices, durable multi-tenant authorization state, and a public plugin authorization API inside a Gateway whose supported product boundary has not yet been approved for multi-human tenancy. This remains the prior P1 blocker at the current head: obtain explicit maintainer sponsorship for this security model and API contract, or redesign it outside the core Gateway boundary before merging.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against afdc3931a80a.

Label changes

Label justifications:

  • P2: This is a substantial but non-emergency feature requiring normal-priority product, security, compatibility, and proof review.
  • merge-risk: 🚨 compatibility: The PR changes persisted Workspaces and shared-state schemas, Gateway protocol output, device approval behavior, and the public plugin API.
  • merge-risk: 🚨 security-boundary: The PR adds local human authentication, member sessions, exact-resource grants, delegated agent authority, and restricted remote Gateway access.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports 100 focused tests and static checks but no inspectable current-head live run showing bootstrap, invite redemption, all three access modes, exact cross-tab denial, presence, logout, expiry, grant revocation, and history denial across two principals; add a redacted recording, terminal transcript, logs, or linked artifact, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

Security concerns:

  • [high] Unapproved multi-human Gateway security boundary — src/gateway/teams-http.ts:38
    Local accounts, opaque member sessions, automatic Teams-session device approval, durable grants, and delegated agent authority turn the single-owner Gateway into a multi-principal service; maintainers must approve the threat model and ownership boundary before merge.
    Confidence: 0.92
  • [high] Historical snapshots can bypass live tab filtering — extensions/workspaces/src/gateway.ts:31
    The discussion establishes a concrete compositional leak if the related history endpoint returns raw snapshots after exact private-tab sharing lands; the integration needs shared projection coverage before both features can coexist.
    Confidence: 0.9
  • [medium] Public authorization API stability — src/plugins/teams-types.ts:23
    External plugins could begin relying on api.teams resource operations and gateway access policies, so later security-driven contract changes would become compatibility-sensitive.
    Confidence: 0.88

What I checked:

  • Canonical product proposal: The open Teams proposal defines this PR's local-account, exact-tab RBAC, restricted-portal, and delegated-agent direction and is explicitly marked for maintainer product and security review.
  • Unresolved prior P1 finding: The latest completed ClawSweeper cycle at the exact current head still reports “Keep Teams within the supported Gateway trust model”; no later commit exists to resolve that finding. (src/gateway/teams-http.ts:38, 73700913b9ff)
  • New core authentication boundary: The patch introduces gateway-hosted login, invite, session, and logout endpoints with opaque cookies, creating a second human authentication and authorization domain inside the Gateway. (src/gateway/teams-http.ts:38, 73700913b9ff)
  • Public plugin contract expansion: The patch adds the host-bound api.teams namespace and resource-policy registration options to the public plugin API, making the product direction compatibility-sensitive for external plugins. (src/plugins/teams-types.ts:23, 73700913b9ff)
  • Persistent schema expansion: The branch adds durable principals, domains, memberships, grants, resources, delegations, agent-session bindings, operations, local accounts, invites, and sessions to the shared state database. (src/state/openclaw-state-schema.sql:352, 73700913b9ff)
  • Workspace upgrade surface: The canonical Workspaces document changes from schema version 1 to 2 with new immutable workspace and tab resource identifiers and per-tab revisions. (extensions/workspaces/src/schema.ts:34, 73700913b9ff)

Likely related people:

  • 100yenadmin: The contributor authored the merged Workspaces foundation referenced by the canonical Teams proposal and has carried the authorization, Workspaces, portal, and related history integration work across this feature family. (role: Workspaces and Teams feature owner; confidence: high; commits: e17f216d3fc7, 56f1abae759f, 520068cf6aa0; files: extensions/workspaces/src/gateway.ts, extensions/workspaces/src/store.ts, src/gateway/teams-http.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (7 earlier review cycles)
  • reviewed 2026-07-07T23:53:10.711Z sha 1d92fb6 :: needs real behavior proof before merge. :: [P1] Persist dashboard state in SQLite-backed plugin state | [P2] Use the approved widget manifest entrypoint | [P2] Apply the widget CSP on handled 404 responses | [P2] Restore labeler routing and add the dashboard route | [P3] Remove the root carve spec artifact
  • reviewed 2026-07-08T00:04:09.059Z sha 1d92fb6 :: needs real behavior proof before merge. :: [P1] Persist dashboard state in SQLite-backed plugin state | [P2] Use the approved widget manifest entrypoint | [P2] Apply the widget CSP on handled 404 responses | [P2] Add dashboard labeler routing | [P3] Remove the root carve spec artifact
  • reviewed 2026-07-08T04:32:28.974Z sha 1d92fb6 :: needs real behavior proof before merge. :: [P1] Persist dashboard state in SQLite-backed plugin state | [P2] Use the approved widget manifest entrypoint | [P2] Apply the widget CSP on handled 404 responses | [P2] Add dashboard labeler routing | [P3] Remove the root carve spec artifact
  • reviewed 2026-07-10T07:15:21.455Z sha 54e9649 :: needs real behavior proof before merge. :: [P1] Authorize private-tab mutations before touching the full document | [P1] Keep private tab slugs out of global broadcasts | [P1] Filter private tabs from agent tools | [P1] Move dashboard persistence into SQLite-backed plugin state | [P2] Apply the widget CSP to handled 404 responses | [P2] Add dashboard labeler routing
  • reviewed 2026-07-13T08:33:33.252Z sha 0e71316 :: needs real behavior proof before merge. :: [P1] Align the Teams endpoint with the supported trust model
  • reviewed 2026-07-13T09:53:55.458Z sha 1849e4d :: needs real behavior proof before merge. :: [P1] Align the Teams endpoint with the supported trust model
  • reviewed 2026-07-13T13:24:06.642Z sha 7370091 :: needs real behavior proof before merge. :: [P1] Keep Teams within the supported Gateway trust model

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 7, 2026
@100yenadmin

Copy link
Copy Markdown
Contributor Author

Security (cross-PR, surfaced by the downstream Boardstate extraction's audit — SPEC invariant I6): private-tab leak via workspace history, emergent when this PR and #101913 both land.

Neither branch has the hole in isolation (this one has no private tabs yet; that one has no history endpoint). But once both are on main, history.get returns snapshots unfiltered, so a non-owner can read another operator's private tab out of any older version — bypassing the live-read filter.

Fix at integration: route the history.get snapshot through the same filterWorkspaceForOperator(doc, operatorId) that respondDoc uses for live reads (the version field stays the real/unfiltered value so client change-dedup is unaffected). Reference: the extracted Boardstate applies exactly this in its dashboard.workspace.history.get handler.

Flagging on both PRs so it isn't lost at merge. (The other two audit findings — approval-elevation via workspace.replace, and CSP on widget-route 404s — were single-branch and are fixed directly in #101094 and #101098.)

@100yenadmin
100yenadmin force-pushed the feat/dashboard-control-hub branch from 54e9649 to 6d35276 Compare July 13, 2026 07:31
@100yenadmin 100yenadmin changed the title Dashboard: control hub — per-agent nesting, shared/private tabs, presence Workspaces: add scoped Teams control hub Jul 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling plugin: workspaces Agent-composable Workspaces plugin labels Jul 13, 2026
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jul 13, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Jul 13, 2026
@100yenadmin
100yenadmin force-pushed the feat/dashboard-control-hub branch from 0e71316 to 0fa3bb7 Compare July 13, 2026 09:04
@100yenadmin
100yenadmin force-pushed the feat/dashboard-control-hub branch from 0fa3bb7 to 1849e4d Compare July 13, 2026 09:30
Eva added 25 commits July 13, 2026 19:33
Port the useful parts of the legacy Control Hub work onto the first-class Teams authorization contract. Keep tab access owner-controlled through exact resource grants, group canonical server-authored tabs by agent provenance, and expose bounded tenant/workspace/tab-scoped presence only after exact-tab authorization.
@100yenadmin
100yenadmin force-pushed the feat/dashboard-control-hub branch from 1849e4d to 7370091 Compare July 13, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: workspaces Agent-composable Workspaces plugin rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant