matrix-js: require explicit thread-bound spawn config

This commit is contained in:
Gustavo Madeira Santana
2026-03-08 19:20:57 -04:00
parent 96d7e4552d
commit a54aa338cd
12 changed files with 286 additions and 25 deletions

View File

@@ -79,6 +79,7 @@ Required feature flags for thread-bound ACP:
- `acp.dispatch.enabled` is on by default (set `false` to pause ACP dispatch)
- Channel-adapter ACP thread-spawn flag enabled (adapter-specific)
- Discord: `channels.discord.threadBindings.spawnAcpSessions=true`
- Matrix-js: `channels["matrix-js"].threadBindings.spawnAcpSessions=true`
- Telegram: `channels.telegram.threadBindings.spawnAcpSessions=true`
### Thread supporting channels
@@ -86,6 +87,7 @@ Required feature flags for thread-bound ACP:
- Any channel adapter that exposes session/thread binding capability.
- Current built-in support:
- Discord threads/channels
- Matrix-js room threads and DMs
- Telegram topics (forum topics in groups/supergroups and DM topics)
- Plugin channels can add support through the same binding interface.
@@ -98,6 +100,7 @@ For non-ephemeral workflows, configure persistent ACP bindings in top-level `bin
- `bindings[].type="acp"` marks a persistent ACP conversation binding.
- `bindings[].match` identifies the target conversation:
- Discord channel or thread: `match.channel="discord"` + `match.peer.id="<channelOrThreadId>"`
- Matrix room or thread: `match.channel="matrix-js"` + `match.peer.id="<roomIdOrThreadRootEventId>"`
- Telegram forum topic: `match.channel="telegram"` + `match.peer.id="<chatId>:topic:<topicId>"`
- `bindings[].agentId` is the owning OpenClaw agent id.
- Optional ACP overrides live under `bindings[].acp`:
@@ -375,6 +378,7 @@ Notes:
- On non-thread binding surfaces, default behavior is effectively `off`.
- Thread-bound spawn requires channel policy support:
- Discord: `channels.discord.threadBindings.spawnAcpSessions=true`
- Matrix-js: `channels["matrix-js"].threadBindings.spawnAcpSessions=true`
- Telegram: `channels.telegram.threadBindings.spawnAcpSessions=true`
## ACP controls
@@ -477,7 +481,7 @@ Core ACP baseline:
}
```
Thread binding config is channel-adapter specific. Example for Discord:
Thread binding config is channel-adapter specific. Example for Discord and Matrix-js:
```json5
{
@@ -495,6 +499,12 @@ Thread binding config is channel-adapter specific. Example for Discord:
spawnAcpSessions: true,
},
},
"matrix-js": {
threadBindings: {
enabled: true,
spawnAcpSessions: true,
},
},
},
}
```
@@ -502,6 +512,7 @@ Thread binding config is channel-adapter specific. Example for Discord:
If thread-bound ACP spawn does not work, verify the adapter feature flag first:
- Discord: `channels.discord.threadBindings.spawnAcpSessions=true`
- Matrix-js: `channels["matrix-js"].threadBindings.spawnAcpSessions=true`
See [Configuration Reference](/gateway/configuration-reference).

View File

@@ -99,7 +99,11 @@ When thread bindings are enabled for a channel, a sub-agent can stay bound to a
### Thread supporting channels
- Discord (currently the only supported channel): supports persistent thread-bound subagent sessions (`sessions_spawn` with `thread: true`), manual thread controls (`/focus`, `/unfocus`, `/agents`, `/session idle`, `/session max-age`), and adapter keys `channels.discord.threadBindings.enabled`, `channels.discord.threadBindings.idleHours`, `channels.discord.threadBindings.maxAgeHours`, and `channels.discord.threadBindings.spawnSubagentSessions`.
- `sessions_spawn` with `thread: true`: currently supported on Discord only.
- Manual thread/conversation controls:
- Discord: `/focus`, `/unfocus`, `/agents`, `/session idle`, `/session max-age`
- Matrix-js: `/focus`, `/unfocus`, `/agents`, `/session idle`, `/session max-age`
- Telegram: `/focus`, `/unfocus`, `/agents`, `/session idle`, `/session max-age`
Quick flow: