Skip to content

Commit fcd30e7

Browse files
committed
fix(sessions): clarify accepted empty attachment hints
1 parent 45cbb0e commit fcd30e7

7 files changed

Lines changed: 31 additions & 27 deletions

‎src/agents/tool-description-presets.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function describeSessionsSpawnTool(options?: {
140140
? '`mode="run"` one-shot; `mode="session"` persistent/thread-bound only on supporting requester channel.'
141141
: '`mode="run"` one-shot background.',
142142
"`agentId` targets a configured agent; `model` overrides its model; `cleanup` delete|keep hidden child session; `sandbox` inherit|require.",
143-
'`visible=true`: durable visible session. Default for coding, multi-step work, or results user may revisit/steer/keep — not only when a thread is requested. Shows in web UI sidebar; works without UI: completion announces back, progress checkable. `category` explicitly groups it; omission or an empty string leaves it ungrouped. Subagent only; omit `mode` (`mode="run"` is also accepted), `thread`, `thinking`, `lightContext`, `attachments`, `attachAs`; inherits the caller tool-policy ceiling; may check out a git worktree via `worktree`/`worktreeName`/`worktreeBaseRef`. When its accepted result includes `sessionUrl`, channel acknowledgements put the session URL on the first line and `Owner: <label>` on the second line.',
143+
'`visible=true`: durable visible session. Default for coding, multi-step work, or results user may revisit/steer/keep — not only when a thread is requested. Shows in web UI sidebar; works without UI: completion announces back, progress checkable. `category` explicitly groups it; omission or an empty string leaves it ungrouped. Subagent only; omit `mode` (`mode="run"` is also accepted), `thread`, `thinking`, and `lightContext`; `attachments=[]` and omitted/blank `attachAs.mountPath` are accepted, but nonempty attachment staging is unsupported; inherits the caller tool-policy ceiling; may check out a git worktree via `worktree`/`worktreeName`/`worktreeBaseRef`. When its accepted result includes `sessionUrl`, channel acknowledgements put the session URL on the first line and `Owner: <label>` on the second line.',
144144
visibilityLine,
145145
...(options?.swarmEnabled
146146
? [

‎src/agents/tools/sessions-spawn-tool.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,10 @@ describe("sessions_spawn tool", () => {
526526
expect(tool.description).toContain("`visible=true`: durable visible session");
527527
expect(tool.description).toContain("Default for coding, multi-step work");
528528
expect(tool.description).toContain('`mode="run"` is also accepted');
529+
expect(tool.description).toContain(
530+
"`attachments=[]` and omitted/blank `attachAs.mountPath` are accepted",
531+
);
532+
expect(tool.description).toContain("nonempty attachment staging is unsupported");
529533
expect(tool.description).toContain("inherits the caller tool-policy ceiling");
530534
expect(tool.description).toContain("session URL on the first line");
531535
expect(tool.description).toContain("`Owner: <label>` on the second line");

‎test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/codex-dynamic-tools.discord-group.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"base": "codex-dynamic-tools.telegram-direct.json",
33
"replace": {
44
"sessions_spawn": {
5-
"description": "Spawn child session; default `runtime=\"subagent\"`. `mode=\"run\"` one-shot; `mode=\"session\"` persistent/thread-bound only on supporting requester channel. `agentId` targets a configured agent (see agents_list); `model` overrides its model; `cleanup` delete|keep hidden child session; `sandbox` inherit|require. `visible=true`: durable visible session. Default for coding, multi-step work, or results user may revisit/steer/keep — not only when a thread is requested. Shows in web UI sidebar; works without UI: completion announces back, progress checkable. `category` explicitly groups it; omission or an empty string leaves it ungrouped. Subagent only; omit `mode` (`mode=\"run\"` is also accepted), `thread`, `thinking`, `lightContext`, `attachments`, `attachAs`; inherits the caller tool-policy ceiling; may check out a git worktree via `worktree`/`worktreeName`/`worktreeBaseRef`. When its accepted result includes `sessionUrl`, channel acknowledgements put the session URL on the first line and `Owner: <label>` on the second line. Session listing/addressing obeys `tools.sessions.visibility` (tree: current session + own spawn subtree; the main session sees all sessions of its agent). Inherits parent workspace. Native task arrives in the child's initial `[Subagent Task]` message. Native: explicit context=\"isolated\" starts clean; context=\"fork\" copies requester transcript and requires the same agent. Omitted context follows configured threadBindings.defaultSpawnContext policy (fork by default) with thread=true; without a thread it is isolated. Hidden child: research, parallel/batch reads, throwaway side tasks. Coding, PRs, long builds, anything worth keeping: `visible=true`. No spawn for quick lookup/single read. Check spawns via `subagents`/`sessions_history`. After spawn, do non-overlap work. Run result returns; session output stays thread.",
5+
"description": "Spawn child session; default `runtime=\"subagent\"`. `mode=\"run\"` one-shot; `mode=\"session\"` persistent/thread-bound only on supporting requester channel. `agentId` targets a configured agent (see agents_list); `model` overrides its model; `cleanup` delete|keep hidden child session; `sandbox` inherit|require. `visible=true`: durable visible session. Default for coding, multi-step work, or results user may revisit/steer/keep — not only when a thread is requested. Shows in web UI sidebar; works without UI: completion announces back, progress checkable. `category` explicitly groups it; omission or an empty string leaves it ungrouped. Subagent only; omit `mode` (`mode=\"run\"` is also accepted), `thread`, `thinking`, and `lightContext`; `attachments=[]` and omitted/blank `attachAs.mountPath` are accepted, but nonempty attachment staging is unsupported; inherits the caller tool-policy ceiling; may check out a git worktree via `worktree`/`worktreeName`/`worktreeBaseRef`. When its accepted result includes `sessionUrl`, channel acknowledgements put the session URL on the first line and `Owner: <label>` on the second line. Session listing/addressing obeys `tools.sessions.visibility` (tree: current session + own spawn subtree; the main session sees all sessions of its agent). Inherits parent workspace. Native task arrives in the child's initial `[Subagent Task]` message. Native: explicit context=\"isolated\" starts clean; context=\"fork\" copies requester transcript and requires the same agent. Omitted context follows configured threadBindings.defaultSpawnContext policy (fork by default) with thread=true; without a thread it is isolated. Hidden child: research, parallel/batch reads, throwaway side tasks. Coding, PRs, long builds, anything worth keeping: `visible=true`. No spawn for quick lookup/single read. Check spawns via `subagents`/`sessions_history`. After spawn, do non-overlap work. Run result returns; session output stays thread.",
66
"inputSchema": {
77
"properties": {
88
"agentId": {

‎test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/codex-dynamic-tools.telegram-direct.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
"type": "function"
152152
},
153153
{
154-
"description": "Spawn child session; default `runtime=\"subagent\"`. `mode=\"run\"` one-shot background. `agentId` targets a configured agent (see agents_list); `model` overrides its model; `cleanup` delete|keep hidden child session; `sandbox` inherit|require. `visible=true`: durable visible session. Default for coding, multi-step work, or results user may revisit/steer/keep — not only when a thread is requested. Shows in web UI sidebar; works without UI: completion announces back, progress checkable. `category` explicitly groups it; omission or an empty string leaves it ungrouped. Subagent only; omit `mode` (`mode=\"run\"` is also accepted), `thread`, `thinking`, `lightContext`, `attachments`, `attachAs`; inherits the caller tool-policy ceiling; may check out a git worktree via `worktree`/`worktreeName`/`worktreeBaseRef`. When its accepted result includes `sessionUrl`, channel acknowledgements put the session URL on the first line and `Owner: <label>` on the second line. Session listing/addressing obeys `tools.sessions.visibility` (tree: current session + own spawn subtree; the main session sees all sessions of its agent). Inherits parent workspace. Native task arrives in the child's initial `[Subagent Task]` message. Native: explicit context=\"isolated\" starts clean; context=\"fork\" copies requester transcript and requires the same agent. Omitted context is isolated. Hidden child: research, parallel/batch reads, throwaway side tasks. Coding, PRs, long builds, anything worth keeping: `visible=true`. No spawn for quick lookup/single read. Check spawns via `subagents`/`sessions_history`. After spawn, do non-overlap work while run result returns.",
154+
"description": "Spawn child session; default `runtime=\"subagent\"`. `mode=\"run\"` one-shot background. `agentId` targets a configured agent (see agents_list); `model` overrides its model; `cleanup` delete|keep hidden child session; `sandbox` inherit|require. `visible=true`: durable visible session. Default for coding, multi-step work, or results user may revisit/steer/keep — not only when a thread is requested. Shows in web UI sidebar; works without UI: completion announces back, progress checkable. `category` explicitly groups it; omission or an empty string leaves it ungrouped. Subagent only; omit `mode` (`mode=\"run\"` is also accepted), `thread`, `thinking`, and `lightContext`; `attachments=[]` and omitted/blank `attachAs.mountPath` are accepted, but nonempty attachment staging is unsupported; inherits the caller tool-policy ceiling; may check out a git worktree via `worktree`/`worktreeName`/`worktreeBaseRef`. When its accepted result includes `sessionUrl`, channel acknowledgements put the session URL on the first line and `Owner: <label>` on the second line. Session listing/addressing obeys `tools.sessions.visibility` (tree: current session + own spawn subtree; the main session sees all sessions of its agent). Inherits parent workspace. Native task arrives in the child's initial `[Subagent Task]` message. Native: explicit context=\"isolated\" starts clean; context=\"fork\" copies requester transcript and requires the same agent. Omitted context is isolated. Hidden child: research, parallel/batch reads, throwaway side tasks. Coding, PRs, long builds, anything worth keeping: `visible=true`. No spawn for quick lookup/single read. Check spawns via `subagents`/`sessions_history`. After spawn, do non-overlap work while run result returns.",
155155
"inputSchema": {
156156
"properties": {
157157
"agentId": {

‎test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/discord-group-codex-message-tool.md.diff‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- telegram-direct-codex-message-tool.md sha256=8e1686c415a1a34b5c5d898184eb3368fad40de23444a309225861c010765d8e
2-
+++ discord-group-codex-message-tool.md sha256=3ccddcf1fc9369403c5251b49ffe5c6aea2403b492d8e9bf296abf9652822ec6
1+
--- telegram-direct-codex-message-tool.md sha256=f9ed57bced25274b6bb70336eea5c172e5af609393f62d6e36acc69218da3e61
2+
+++ discord-group-codex-message-tool.md sha256=a6956daaaa6928bf887138c92a59eef55450a63d5b07ac5ab84cd9acacedcdea
33
@@ -1,1 +1,1 @@
44
-# Telegram Direct Codex Message Tool Turn
55
+# Discord Group Codex Message Tool Turn
@@ -29,10 +29,10 @@
2929
- "dynamicToolsFrom": "codex-dynamic-tools.telegram-direct.json",
3030
+ "dynamicToolsFrom": "codex-dynamic-tools.discord-group.json",
3131
@@ -235,2 +235,2 @@
32-
- "chars": 55791,
33-
- "roughTokens": 13948
34-
+ "chars": 56371,
35-
+ "roughTokens": 14093
32+
- "chars": 55886,
33+
- "roughTokens": 13972
34+
+ "chars": 56466,
35+
+ "roughTokens": 14117
3636
@@ -239,2 +239,2 @@
3737
- "chars": 3518,
3838
- "roughTokens": 880
@@ -44,10 +44,10 @@
4444
+ "chars": 28944,
4545
+ "roughTokens": 7236
4646
@@ -247,2 +247,2 @@
47-
- "chars": 83257,
48-
- "roughTokens": 20815
49-
+ "chars": 85317,
50-
+ "roughTokens": 21330
47+
- "chars": 83352,
48+
- "roughTokens": 20838
49+
+ "chars": 85412,
50+
+ "roughTokens": 21353
5151
@@ -251,2 +251,2 @@
5252
- "chars": 863,
5353
- "roughTokens": 216

‎test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/telegram-direct-codex-message-tool.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
232232
"roughTokens": 0
233233
},
234234
"dynamicToolsJson": {
235-
"chars": 55791,
236-
"roughTokens": 13948
235+
"chars": 55886,
236+
"roughTokens": 13972
237237
},
238238
"openClawDeveloperInstructions": {
239239
"chars": 3518,
@@ -244,8 +244,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
244244
"roughTokens": 6866
245245
},
246246
"totalWithDynamicToolsJson": {
247-
"chars": 83257,
248-
"roughTokens": 20815
247+
"chars": 83352,
248+
"roughTokens": 20838
249249
},
250250
"userInputText": {
251251
"chars": 863,

‎test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/telegram-heartbeat-codex-tool.md.diff‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- telegram-direct-codex-message-tool.md sha256=8e1686c415a1a34b5c5d898184eb3368fad40de23444a309225861c010765d8e
2-
+++ telegram-heartbeat-codex-tool.md sha256=4aaa1b3e7cd23ee0657e6fc2a6e0be411d7285fbaf1696330b308fe44522d55d
1+
--- telegram-direct-codex-message-tool.md sha256=f9ed57bced25274b6bb70336eea5c172e5af609393f62d6e36acc69218da3e61
2+
+++ telegram-heartbeat-codex-tool.md sha256=11aa983f4713025afa0d749800ccdc837ee9ce878049fc5878ae71f3a77a069f
33
@@ -1,1 +1,1 @@
44
-# Telegram Direct Codex Message Tool Turn
55
+# Telegram Direct Codex Heartbeat Tool Turn
@@ -32,20 +32,20 @@
3232
- "dynamicToolsFrom": "codex-dynamic-tools.telegram-direct.json",
3333
+ "dynamicToolsFrom": "codex-dynamic-tools.heartbeat-turn.json",
3434
@@ -235,2 +230,2 @@
35-
- "chars": 55791,
36-
- "roughTokens": 13948
37-
+ "chars": 57284,
38-
+ "roughTokens": 14321
35+
- "chars": 55886,
36+
- "roughTokens": 13972
37+
+ "chars": 57379,
38+
+ "roughTokens": 14345
3939
@@ -243,2 +238,2 @@
4040
- "chars": 27464,
4141
- "roughTokens": 6866
4242
+ "chars": 27806,
4343
+ "roughTokens": 6952
4444
@@ -247,2 +242,2 @@
45-
- "chars": 83257,
46-
- "roughTokens": 20815
47-
+ "chars": 85092,
48-
+ "roughTokens": 21273
45+
- "chars": 83352,
46+
- "roughTokens": 20838
47+
+ "chars": 85187,
48+
+ "roughTokens": 21297
4949
@@ -251,2 +246,2 @@
5050
- "chars": 863,
5151
- "roughTokens": 216

0 commit comments

Comments
 (0)