Skip to content

Commit 1668097

Browse files
committed
feat(tools): Add workspace discovery and session targeting
SessionControl previously ignored the requested workspace when creating or listing sessions, using the caller's workspace instead. - Add read-only ListWorkspaces discovery with recent-access sorting, filtering, cursor pagination, and readable model results. - Resolve SessionControl.workspace by registered ID or caller-scoped absolute path, enabling local assistants to select remote workspaces. - Reject missing or ambiguous selections and preserve worktree execution targets and session-bound mutation routing. - Update assistant defaults, prompts, catalogs, UI metadata, and regression coverage for workspace discovery and selection.
1 parent 32cca12 commit 1668097

27 files changed

Lines changed: 1459 additions & 72 deletions

File tree

‎docs/interactive-capabilities/capabilities.json‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"title": "OpenBitFun Playbook",
55
"origin": "https://playbook.openbitfun.com",
66
"source": "src/shared/interactive-capabilities/catalog.json",
7-
"digest": "63afe6c13213f11a7089fbb6208db930d563e4d3098f7c6dcf4c20a1f4e87271",
7+
"digest": "434dc78df2ba3fa225ab75ab2839d8dcacebbf2e65123a49da3ceb4081c2988f",
88
"ownerDigest": "c0e5c187cf62bc6ed06196ce8520b3eb427bf268cf24659b72d2552fb1d99c54",
99
"searchAcceptance": [
1010
{
@@ -563,6 +563,7 @@
563563
"additionalProperties": true
564564
},
565565
"delegateTools": [
566+
"ListWorkspaces",
566567
"SessionControl",
567568
"SessionHistory",
568569
"Read",
@@ -611,6 +612,7 @@
611612
"additionalProperties": true
612613
},
613614
"delegateTools": [
615+
"ListWorkspaces",
614616
"SessionControl",
615617
"SessionMessage"
616618
],
@@ -19317,6 +19319,7 @@
1931719319
"control": {
1931819320
"kind": "delegate",
1931919321
"tools": [
19322+
"ListWorkspaces",
1932019323
"SessionControl",
1932119324
"SessionHistory",
1932219325
"Read",
@@ -19339,15 +19342,16 @@
1933919342
"control": {
1934019343
"kind": "delegate",
1934119344
"tools": [
19345+
"ListWorkspaces",
1934219346
"SessionControl",
1934319347
"SessionMessage"
1934419348
],
1934519349
"workflowZh": [
19346-
"用 SessionControl 在明确工作区内创建或列出会话;取消只终止当前运行轮次,删除是独立动作",
19350+
"用 ListWorkspaces 获取运行主机登记的 workspace_id,再传给 SessionControl.workspace 创建或列出本地或远程会话;绝对路径仅在调用者执行环境中解析;取消只终止当前轮次,删除是独立动作",
1934719351
"需要让另一持久会话接手工作时用 SessionMessage,并保留异步返回;跨远程边界时沿用目标会话绑定,不得复用控制器路径"
1934819352
],
1934919353
"workflowEn": [
19350-
"Use SessionControl to create or list sessions in an explicit workspace; cancel affects only the active turn and delete is separate",
19354+
"Use ListWorkspaces to discover runtime-host workspace IDs, then pass one as SessionControl.workspace to create or list local or remote sessions; absolute paths resolve in the caller environment; cancel affects only the active turn and delete is separate",
1935119355
"Use SessionMessage when another persisted session should take over work and retain its asynchronous result; preserve the target session binding across remote boundaries"
1935219356
]
1935319357
}
@@ -19575,6 +19579,7 @@
1957519579
"Call FrontendWorkbench prepare on the local Desktop in Creative mode, read the packaged API, and edit only draft CSS, JavaScript and owned assets without source or build tools",
1957619580
"Apply with the original draft ID; the host starts the immutable review window's 15-second countdown only after the real shell and customization activate, and apply waits for a final confirmed or rolled_back outcome",
1957719581
"Compose commands, state and events into reusable capabilities; use FrontendWorkbench inspect to discover schemas and diagnostics, then invoke to verify execution",
19582+
"ListWorkspaces",
1957819583
"SessionControl",
1957919584
"SessionHistory",
1958019585
"Grep",
@@ -19583,9 +19588,9 @@
1958319588
"Use SessionControl list to find the target session, then export its indexed transcript with SessionHistory",
1958419589
"Read only the exported index first, then use Read or Grep for the required turns instead of loading the entire history into context",
1958519590
"SessionMessage",
19586-
"用 SessionControl 在明确工作区内创建或列出会话;取消只终止当前运行轮次,删除是独立动作",
19591+
"用 ListWorkspaces 获取运行主机登记的 workspace_id,再传给 SessionControl.workspace 创建或列出本地或远程会话;绝对路径仅在调用者执行环境中解析;取消只终止当前轮次,删除是独立动作",
1958719592
"需要让另一持久会话接手工作时用 SessionMessage,并保留异步返回;跨远程边界时沿用目标会话绑定,不得复用控制器路径",
19588-
"Use SessionControl to create or list sessions in an explicit workspace; cancel affects only the active turn and delete is separate",
19593+
"Use ListWorkspaces to discover runtime-host workspace IDs, then pass one as SessionControl.workspace to create or list local or remote sessions; absolute paths resolve in the caller environment; cancel affects only the active turn and delete is separate",
1958919594
"Use SessionMessage when another persisted session should take over work and retain its asynchronous result; preserve the target session binding across remote boundaries",
1959019595
"get_goal",
1959119596
"create_goal",

‎docs/interactive-capabilities/capabilities/feature.ai-assistant.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Work with AI in project context, create sessions, continue tasks, answer permiss
2929
- Start, steer, interrupt, cancel, or recover an agent turn
3030
- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 查看并逐个或批量回答等待中的权限请求
3131
- Review and answer pending permission requests individually or in a batch
32-
- **由专用智能体工具控制 / Delegated Agent tool** · `SessionControl` / `SessionHistory` / `Read` / `Grep` · 分页加载、搜索和回填历史消息与会话内容
32+
- **由专用智能体工具控制 / Delegated Agent tool** · `ListWorkspaces` / `SessionControl` / `SessionHistory` / `Read` / `Grep` · 分页加载、搜索和回填历史消息与会话内容
3333
- Page through, search, and backfill historical turns and session content
34-
- **由专用智能体工具控制 / Delegated Agent tool** · `SessionControl` / `SessionMessage` · 让智能体创建、列出、取消、删除会话或向另一会话发送消息
34+
- **由专用智能体工具控制 / Delegated Agent tool** · `ListWorkspaces` / `SessionControl` / `SessionMessage` · 让智能体创建、列出、取消、删除会话或向另一会话发送消息
3535
- Let an agent create, list, cancel, or delete sessions and send messages to another session
3636
- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 在对话中通过 @ 选择当前模式可用的 MCP 服务
3737
- Use @ in chat to select MCP servers available to the current mode

‎docs/interactive-capabilities/technical/product-control-open-audit.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schemaVersion": 1,
33
"generatedFrom": "src/shared/interactive-capabilities/catalog.json",
4-
"catalogDigest": "63afe6c13213f11a7089fbb6208db930d563e4d3098f7c6dcf4c20a1f4e87271",
4+
"catalogDigest": "434dc78df2ba3fa225ab75ab2839d8dcacebbf2e65123a49da3ceb4081c2988f",
55
"count": 212,
66
"reasonCounts": {
77
"externalAuth": 4,

‎docs/interactive-capabilities/technical/tauri-command-map.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schemaVersion": 2,
33
"generatedFrom": "src/shared/interactive-capabilities/catalog.json",
4-
"catalogDigest": "63afe6c13213f11a7089fbb6208db930d563e4d3098f7c6dcf4c20a1f4e87271",
4+
"catalogDigest": "434dc78df2ba3fa225ab75ab2839d8dcacebbf2e65123a49da3ceb4081c2988f",
55
"commandCount": 668,
66
"coverage": {
77
"commandCount": 668,

‎src/crates/assembly/agent-content/prompts/agents/claw_mode.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Choose the session type intentionally:
4343

4444
- `Standard` for implementation, debugging, code changes, and planning tasks; ask it to use the built-in `plan` Skill when a plan artifact is the deliverable.
4545
- `Cowork` for research, documents, presentations, summaries, and other office-related work.
46+
- `DeepResearch` for systematic investigation and evidence-driven reports.
4647

4748
Local computer/desktop work is not a SessionControl session type; use the `ComputerUse` tool directly when available.
4849

‎src/crates/assembly/core/AGENTS.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@ Skill discovery, installation provenance, and local/remote registry regressions:
283283
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git --lib agentic::tools::implementations::skills::
284284
```
285285

286+
SessionControl workspace selection, remote routing, and session-targeted actions:
287+
288+
```bash
289+
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git --lib session_control_tool::tests
290+
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git --lib list_workspaces
291+
```
292+
286293
Skill hook activation, session cleanup, and tool preflight/permission ordering:
287294

288295
```bash

‎src/crates/assembly/core/builtin_skills/create-agent/references/tool-catalog.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ Use these tables to select tools for the user's tasks, then put their exact name
109109
| `ReadMCPResource` | Read a connected MCP server's resource by URI. |
110110
| `ListMCPPrompts` | List prompt templates exposed by a connected MCP server. |
111111
| `GetMCPPrompt` | Fetch and render a named prompt template from a connected MCP server. |
112-
| `SessionControl` | Create, list, rename, cancel, and delete persisted agent sessions. |
112+
| `ListWorkspaces` | Discover registered local, assistant, and remote workspace IDs on the runtime host without activating them. |
113+
| `SessionControl` | Create or list sessions by workspace ID or caller-scoped absolute path; rename, cancel, or delete by session ID. |
113114
| `SessionMessage` | Send a message to another agent session and receive its result asynchronously. |
114115
| `SessionHistory` | Export an agent session transcript and index for targeted history reads. |
115116
| `PortForward` | Forward a port from an SSH host to the user's machine. |

‎src/crates/assembly/core/src/agentic/agents/definitions/modes/claw.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ impl ClawMode {
4343
"create_goal".to_string(),
4444
"update_goal".to_string(),
4545
"Skill".to_string(),
46+
"ListWorkspaces".to_string(),
4647
"SessionControl".to_string(),
4748
"SessionMessage".to_string(),
4849
"SessionHistory".to_string(),
@@ -112,6 +113,7 @@ mod tests {
112113
assert!(!tools.contains(&"PublishMiniApp".to_string()));
113114
assert!(!tools.contains(&"FrontendWorkbench".to_string()));
114115
assert!(tools.contains(&"ListModels".to_string()));
116+
assert!(tools.contains(&"ListWorkspaces".to_string()));
115117
}
116118

117119
#[test]

‎src/crates/assembly/core/src/agentic/tools/agent-tool-exposure.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Notes:
6161
| `ReadCanvas` | Direct | None | - |
6262
| `UpdateCanvas` | Direct | None | - |
6363
| `PatchCanvas` | Direct | None | - |
64+
| `ListWorkspaces` | Deferred | None | - |
6465
| `SessionControl` | Deferred | None | - |
6566
| `SessionMessage` | Deferred | None | - |
6667
| `SessionHistory` | Deferred | None | - |

0 commit comments

Comments
 (0)