diff --git a/docs/concepts/session.md b/docs/concepts/session.md index b2b2a7f8e71..5ff9a284ff5 100644 --- a/docs/concepts/session.md +++ b/docs/concepts/session.md @@ -53,6 +53,31 @@ If the same person contacts you from multiple channels, use `session.identityLinks` to link their identities so they share one session. +### Dock linked channels + +Dock commands let a user move the current direct-chat session's reply route to +another linked channel without starting a new session. For example, with: + +```json5 +{ + session: { + identityLinks: { + alice: ["telegram:123", "discord:456"], + }, + }, +} +``` + +if Telegram sender `123` sends `/dock_discord`, OpenClaw keeps the current +session context and stores Discord as the route for future replies from that +session. The command updates the session delivery fields (`lastChannel`, +`lastTo`, and `lastAccountId`) and persists them in the session store. + +Docking requires the source sender and target peer to appear in the same +`session.identityLinks` group. If no linked target exists, the command replies +with a setup hint and does not fall through to normal chat. Docking does not +grant channel access or bypass channel allowlists. + Verify your setup with `openclaw security audit`. ## Session lifecycle diff --git a/docs/gateway/config-agents.md b/docs/gateway/config-agents.md index 51628a5092a..b96851dfac0 100644 --- a/docs/gateway/config-agents.md +++ b/docs/gateway/config-agents.md @@ -1182,7 +1182,7 @@ See [Multi-Agent Sandbox & Tools](/tools/multi-agent-sandbox-tools) for preceden - `per-peer`: isolate by sender id across channels. - `per-channel-peer`: isolate per channel + sender (recommended for multi-user inboxes). - `per-account-channel-peer`: isolate per account + channel + sender (recommended for multi-account). -- **`identityLinks`**: map canonical ids to provider-prefixed peers for cross-channel session sharing. +- **`identityLinks`**: map canonical ids to provider-prefixed peers for cross-channel session sharing. Dock commands such as `/dock_discord` use the same map to switch the active session's reply route to another linked channel peer. - **`reset`**: primary reset policy. `daily` resets at `atHour` local time; `idle` resets after `idleMinutes`. When both configured, whichever expires first wins. Daily reset freshness uses the session row's `sessionStartedAt`; idle reset freshness uses `lastInteractionAt`. Background/system-event writes such as heartbeat, cron wakeups, exec notifications, and gateway bookkeeping can update `updatedAt`, but they do not keep daily/idle sessions fresh. - **`resetByType`**: per-type overrides (`direct`, `group`, `thread`). Legacy `dm` accepted as alias for `direct`. - **`parentForkMaxTokens`**: max parent-session `totalTokens` allowed when creating a forked thread session (default `100000`). diff --git a/docs/tools/slash-commands.md b/docs/tools/slash-commands.md index c14ae13acd1..02d5e7c6072 100644 --- a/docs/tools/slash-commands.md +++ b/docs/tools/slash-commands.md @@ -195,7 +195,11 @@ Dock commands are generated from channel plugins with native-command support. Cu - `/dock-slack` (alias: `/dock_slack`) - `/dock-telegram` (alias: `/dock_telegram`) -Use dock commands from a direct chat to switch the current session's reply route to another linked channel. The source sender and target peer must be in the same `session.identityLinks` group, for example `["telegram:123", "discord:456"]`. +Use dock commands from a direct chat to switch the current session's reply route to another linked channel. The agent keeps the same session context, but future replies for that session are delivered to the selected channel peer. + +Dock commands require `session.identityLinks`. The source sender and target peer must be in the same identity group, for example `["telegram:123", "discord:456"]`. If a Telegram user with id `123` sends `/dock_discord`, OpenClaw stores `lastChannel: "discord"` and `lastTo: "456"` on the active session. If the sender is not linked to a Discord peer, the command replies with a setup hint instead of falling through to normal chat. + +Docking changes the active session route only. It does not create channel accounts, grant access, bypass channel allowlists, or move transcript history to another session. Use `/dock-telegram`, `/dock-slack`, `/dock-mattermost`, or another generated dock command to switch the route again. ### Bundled plugin commands