Skip to content

Commit 98d7b38

Browse files
authored
docs: document three-layer session ownership (#125334)
* docs: document three-layer session ownership User documentation for the session-ownership feature landed in #125057: the immutable creator / assignable owner / participant-history model, the Assign-to-me and Assign-to session menu actions, the sessions tool assign_owner action, the sidebar Owners facet with Involving-me, the pair-stack owner avatar, and agent-spawned session receipts (sessionUrl + owner acknowledgement). Adds the sessions.assignOwner method and ownership row projections to the protocol reference and a zh-CN glossary entry for the new link label. * docs: drop nonexistent header facepile overflow count The chat header receives the already 4-capped participant projection and no total count, so its overflow branch cannot render. Describe up to four avatars instead (ClawSweeper P2).
1 parent 821f41e commit 98d7b38

6 files changed

Lines changed: 73 additions & 29 deletions

File tree

‎docs/.i18n/glossary.zh-CN.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,10 @@
17071707
"source": "Session management",
17081708
"target": "会话管理"
17091709
},
1710+
{
1711+
"source": "Session tools",
1712+
"target": "会话工具"
1713+
},
17101714
{
17111715
"source": "Presence",
17121716
"target": "在线状态"

‎docs/concepts/multi-user.md‎

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,67 @@
22
summary: "How session ownership and presence work when several people operate one agent"
33
read_when:
44
- You share one OpenClaw agent with other operators
5-
- You need to understand session owner and presence indicators
5+
- You want to hand a session to another person or agent, or filter sessions by owner
66
- You are deciding whether one shared agent provides enough isolation
77
title: "Multi-user mode"
88
---
99

10-
Multi-user mode lets several trusted people operate the same OpenClaw agent. It adds session ownership, live presence, and creator filtering so a team can tell who started work and who is currently watching it.
10+
Multi-user mode lets several trusted people operate the same OpenClaw agent. It adds session ownership, participant history, live presence, and owner filtering so a team can tell who started work, who is responsible for it now, and who has been involved.
1111

1212
## Trust boundary
1313

1414
Everyone who can operate an agent can make it do anything that agent can do. Session ownership, visibility in the sidebar, and presence indicators are usability features, not security boundaries.
1515

1616
If people must not access each other's sessions, tools, credentials, or files, give them separate agents or separate gateway/host trust boundaries. Do not rely on owner avatars or filters for isolation.
1717

18-
## Ownership and presence
18+
## The three ownership layers
1919

20-
New sessions record a write-once `createdActor` when the creation path can prove who caused it. Authenticated people use their durable Gateway profile id; requesting agents and system paths use the same actor field. Sessions created without a proven actor remain unattributed.
20+
Every session carries up to three layers of attribution:
2121

22-
Human display names are resolved from the current Gateway profile when session rows are returned. OpenClaw does not store labels on session entries, so changing a profile name updates the ownership UI without rewriting session history.
22+
- **Creator** (immutable): new sessions record a write-once `createdActor` when the creation path can prove who caused it. Authenticated people use their durable Gateway profile id; sessions spawned by an agent record that agent's id. Sessions created without a proven actor remain unattributed. Sharing and visibility authority stays anchored on the creator, even after the owner changes.
23+
- **Owner** (assignable): the person or agent currently responsible for the session, in the style of a GitHub issue assignee. It defaults to the creator and can be reassigned at any time; the assignment records who reassigned it and when. The sidebar avatar, the owner filter, and People sorting all follow the current owner.
24+
- **Participants** (history): everyone who has actually prompted the session — authenticated people, channel senders, and requesting agents — recorded automatically at each turn. The session's own agent and passive viewers are never recorded. Participant history is bounded (up to 32 distinct actors per session) and recorded best-effort in the background, so it never delays a turn.
2325

24-
The web app keeps ownership and presence visually distinct:
26+
Human display names and avatars are resolved from the current Gateway profile when session rows are returned; agent actors resolve from the configured agent identity. OpenClaw does not store display labels on session entries, so renaming a profile or agent updates the ownership UI without rewriting session history.
2527

26-
- A solid owner avatar is permanent for the lifetime of that session.
27-
- Ringed or translucent presence avatars show people who are currently connected or watching.
28-
- The sidebar's person filter shows sessions created by one identity while preserving the existing custom groups.
28+
## Assigning an owner
2929

30-
When fewer than two distinct creators appear in the loaded session list, OpenClaw hides all ownership and person-filter chrome. A single-user gateway therefore looks unchanged.
30+
In the Control UI, the session context menu (kebab or right-click on a sidebar row, and the same menu on the chat header) offers:
31+
32+
- **Assign to me**: take responsibility for the session yourself.
33+
- **Assign to…**: pick from a submenu of known people and configured agents.
34+
35+
Agents can reassign ownership with the [`sessions` tool](/concepts/session-tool#managing-session-settings-and-groups) using `action: "assign_owner"` with `ownerType` (`"human"` or `"agent"`) and `ownerId`, targeting the current session by default or another visible session via `sessionKey`.
36+
37+
Both paths call the Gateway method `sessions.assignOwner` (`operator.write`). Assignment requires an identified caller — an authenticated Gateway profile or a trusted agent identity — and is authorized by session visibility. Agent owner ids must name a configured agent. After assignment the avatar tooltip switches from "Created by" to "Owned by".
38+
39+
Reassigning the owner changes responsibility and display only. It does not transfer sharing authority (which stays with the creator) and does not grant or remove any access.
40+
41+
## Finding sessions by owner
42+
43+
The sidebar's session filter menu gains an **Owners** section when ownership is visible:
44+
45+
- **All owners** shows everything (the default).
46+
- A specific person or agent shows the sessions they currently own.
47+
- **Involving me** shows sessions you own plus sessions where you have prompted at least once. This filter is evaluated by the Gateway against the full participant history and matches only your authenticated profile identity — channel-native sender ids are display-only and never match, so a numeric channel id cannot collide with your profile.
48+
49+
**Involving me** requires a signed-in Gateway profile. The **People** sort mode groups sessions by current owner and orders the groups by name.
50+
51+
## Reading the avatars
52+
53+
The Control UI keeps ownership and presence visually distinct:
54+
55+
- A solid owner avatar on a session row is permanent for the lifetime of that session and always shows the current owner. It dims slightly while the owner is not connected.
56+
- When other people or agents have prompted the session, the row avatar becomes a **pair-stack**: the owner stays in front, and either the single other participant peeks out behind, or a **+N** count summarizes several. The chat header shows the owner chip plus a participant facepile of up to four avatars. The owner is excluded from the participant display.
57+
- Ringed or translucent presence avatars show people who are currently connected or watching; they come from live presence, not ownership, and disappear when those viewers leave.
58+
59+
When the loaded session list contains fewer than two distinct owner identities and no session has recorded outside participants, OpenClaw hides all ownership and owner-filter chrome. A single-user gateway therefore looks unchanged.
60+
61+
## Agent-spawned sessions
62+
63+
Sessions an agent creates with `sessions_spawn` (`visible: true`) are attributed to the requesting agent: the creator and initial owner is the agent itself, and the sidebar shows the agent's configured identity name and avatar rather than an internal session key.
64+
65+
The accepted spawn result doubles as a receipt: it includes the child session key, the run id, a direct Control UI `sessionUrl` (omitted when the Control UI is disabled), and an `owner` record naming the requesting agent. When an agent acknowledges the spawn in a chat channel, it puts the session URL on the first line and `Owner: <label>` on the second, so you can open the session and see who is responsible at a glance. Reassign the session to yourself with **Assign to me** if you take the work over. See [Sub-agents](/tools/subagents) for the spawn lifecycle.
3166

3267
## Identity-scoped convenience state
3368

@@ -41,11 +76,12 @@ Start a session as a draft to keep work in progress out of teammates' sidebars u
4176

4277
## Turn attribution
4378

44-
Turn sender attribution is best-effort. Steering can merge input into an active turn, so the transcript cannot always represent each person's contribution as a separate turn.
79+
Turn sender attribution is best-effort. Steering can merge input into an active turn, so the transcript cannot always represent each person's contribution as a separate turn. Participant history records that an actor prompted the session, not which words were theirs.
4580

4681
## Related
4782

4883
- [The main session](/concepts/main-session)
4984
- [Session management](/concepts/session)
85+
- [Session tools](/concepts/session-tool)
5086
- [Presence](/concepts/presence)
5187
- [Gateway security](/gateway/security)

‎docs/concepts/session-tool.md‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ OpenClaw gives agents tools to work across sessions, inspect status, and orchest
1111

1212
## Available tools
1313

14-
| Tool | What it does |
15-
| -------------------- | --------------------------------------------------------------------------- |
16-
| `sessions` | Patch, reset, or delete visible sessions and manage session groups |
17-
| `sessions_list` | List sessions with optional filters (kind, label, agent, archive, preview) |
18-
| `sessions_search` | Search visible session transcripts and return matching excerpts |
19-
| `sessions_history` | Read the transcript of a specific session |
20-
| `sessions_send` | Run another session on the same Gateway and optionally wait |
21-
| `conversations_list` | List stable external conversation addresses |
22-
| `conversations_send` | Send to one exact external conversation without running a local session |
23-
| `conversations_turn` | Send to one exact external conversation and wait for its correlated reply |
24-
| `sessions_spawn` | Spawn an isolated sub-agent session for background work |
25-
| `sessions_yield` | End the current turn and wait for follow-up sub-agent results |
26-
| `subagents` | List or cancel background work in this session tree |
27-
| `session_status` | Show a `/status`-style card and optionally set a per-session model override |
14+
| Tool | What it does |
15+
| -------------------- | --------------------------------------------------------------------------------------- |
16+
| `sessions` | Patch, reset, delete, or assign ownership of visible sessions and manage session groups |
17+
| `sessions_list` | List sessions with optional filters (kind, label, agent, archive, preview) |
18+
| `sessions_search` | Search visible session transcripts and return matching excerpts |
19+
| `sessions_history` | Read the transcript of a specific session |
20+
| `sessions_send` | Run another session on the same Gateway and optionally wait |
21+
| `conversations_list` | List stable external conversation addresses |
22+
| `conversations_send` | Send to one exact external conversation without running a local session |
23+
| `conversations_turn` | Send to one exact external conversation and wait for its correlated reply |
24+
| `sessions_spawn` | Spawn an isolated sub-agent session for background work |
25+
| `sessions_yield` | End the current turn and wait for follow-up sub-agent results |
26+
| `subagents` | List or cancel background work in this session tree |
27+
| `session_status` | Show a `/status`-style card and optionally set a per-session model override |
2828

2929
These tools are still subject to the active tool profile and allow/deny policy. `tools.profile: "coding"` includes the full session orchestration set. `tools.profile: "messaging"` includes session self-service, discovery, recall, cross-session messaging, external-conversation tools, and the complete spawn lifecycle (`sessions_spawn`, `sessions_yield`, and `subagents`). The UI-only task-suggestion tools `suggest_task` and `dismiss_task` remain coding-profile tools.
3030

@@ -63,6 +63,7 @@ The owner-gated `sessions` tool exposes bounded self-service surfaces:
6363
- `action: "patch"` changes the current session by default, or another visible session selected by `sessionKey`. It can set the label, persistent sidebar `icon`, pin/archive state, model, and thinking level. The icon must be one emoji grapheme or one of the named icons `braces`, `book`, `monitor`, `bot`, `kanban`, and `coins`; pass an empty string to clear it. The Control UI picker also accepts a custom emoji and shows the macOS (Control-Command-Space) or Windows (Windows-period) system emoji picker shortcut. Archiving or restoring another session requires its `sessions_list` `sessionId` as `expectedSessionId`.
6464
- `action: "reset"` resets another visible session selected by `sessionKey`.
6565
- `action: "delete"` first archives and then deletes the exact same generation of another visible session selected by `sessionKey`. By default its transcript is retained as a deleted archive; pass `deleteTranscript: false` to leave the transcript state untouched. Resetting or deleting the session currently running the tool is rejected.
66+
- `action: "assign_owner"` hands session responsibility to a person or agent. Pass `ownerType` (`"human"` or `"agent"`) and `ownerId`; the target is the current session by default, or another visible session via `sessionKey`. Agent owner ids must name a configured agent. The assignment records who reassigned it and when, and the Control UI reflects the new owner immediately. Ownership is display and responsibility, not access control; see [Multi-user mode](/concepts/multi-user).
6667
- `group_list`, `group_set`, `group_rename`, and `group_delete` manage the global ordered session-group catalog. `group_set` replaces the ordered name list rather than patching one entry.
6768

6869
Use `sessions_spawn` with `visible: true` to create a persistent dashboard session. This keeps session creation on the controlled spawn path, which enforces the parent's tool policy, sandbox, concurrency limits, and run timeout.
@@ -128,7 +129,7 @@ Key options:
128129
- `thread: true` to bind the spawn to a chat thread (Discord, Slack, etc.).
129130
- `sandbox: "require"` to enforce sandboxing on the child.
130131
- `context: "fork"` for native sub-agents when the child needs the current requester transcript; omit it or use `context: "isolated"` for a clean child. `context: "fork"` is only valid with `runtime: "subagent"`. Thread-bound native sub-agents default to `context: "fork"` unless `threadBindings.defaultSpawnContext` says otherwise.
131-
- `visible: true` to create a persistent dashboard session instead of a hidden sub-agent session. Visible spawns support an explicit model, working directory, same-agent transcript fork, and an optional [managed worktree](/concepts/managed-worktrees); see [Sub-agents](/tools/subagents#tool-parameters) for the exact compatibility limits.
132+
- `visible: true` to create a persistent dashboard session instead of a hidden sub-agent session. Visible spawns support an explicit model, working directory, same-agent transcript fork, and an optional [managed worktree](/concepts/managed-worktrees); see [Sub-agents](/tools/subagents#tool-parameters) for the exact compatibility limits. The accepted result is a receipt: it includes the child session key, run id, a Control UI `sessionUrl` (omitted when the Control UI is disabled), and an `owner` record naming the requesting agent. When acknowledging the spawn in a channel, put the session URL on the first line and `Owner: <label>` on the second. The spawned session is attributed to the requesting agent in the sidebar; see [Multi-user mode](/concepts/multi-user#agent-spawned-sessions).
132133

133134
Default leaf sub-agents do not get session tools. When `maxSpawnDepth >= 2`, depth-1 orchestrator sub-agents additionally receive `sessions_spawn`, `subagents`, `sessions_list`, and `sessions_history` so they can manage their own children. Leaf runs still do not get recursive orchestration tools.
134135

0 commit comments

Comments
 (0)