Skip to content

Commit 2d6e0a2

Browse files
[AI] docs(tools): clarify per-action required params in gateway and process tool schemas (#114879)
Update gateway path and process sessionId schema descriptions so models know which actions require them at runtime. Includes regenerated Codex prompt snapshots (base telegram catalog + md token counts) matching the descriptions. Fixes #
1 parent a16722a commit 2d6e0a2

6 files changed

Lines changed: 31 additions & 26 deletions

File tree

‎src/agents/bash-tools.schemas.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const processSchema = Type.Object({
9494
enum: [...PROCESS_TOOL_ACTIONS],
9595
description: "Process action (list|poll|log|write|send-keys|submit|paste|kill|clear|remove)",
9696
}),
97-
sessionId: Type.Optional(Type.String({ description: "Session id for actions other than list" })),
97+
sessionId: Type.Optional(Type.String({ description: "Required for every action except list." })),
9898
data: Type.Optional(Type.String({ description: "Data to write for write" })),
9999
keys: Type.Optional(
100100
Type.Array(Type.String(), { description: "Key tokens to send for send-keys" }),

‎src/agents/tools/gateway-tool.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ const GATEWAY_ACTIONS = ["config.get", "config.schema.lookup"] as const;
102102
const GatewayToolSchema = Type.Object({
103103
action: stringEnum(GATEWAY_ACTIONS),
104104
...gatewayCallOptionSchemaProperties(),
105-
path: Type.Optional(Type.String()),
105+
path: Type.Optional(
106+
Type.String({
107+
description: "Required for config.schema.lookup; optional for config.get.",
108+
}),
109+
),
106110
});
107111

108112
export function createGatewayTool(): AnyAgentTool {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@
845845
"type": "string"
846846
},
847847
"path": {
848+
"description": "Required for config.schema.lookup; optional for config.get.",
848849
"type": "string"
849850
},
850851
"timeoutMs": {

‎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=0a75703590d0c2198fdadbf2e427bd7f3242ebfb7d10ae339585e17f566be58c
2-
+++ discord-group-codex-message-tool.md sha256=4f7a8ee79c437a370ba71c39e53ae27d1f84ad4e11fe9528b7ae708ec5c4a21b
1+
--- telegram-direct-codex-message-tool.md sha256=b0de445838f6401181bbddf3584aeac126d1409ef8fc1c36071e3b86a4b3359d
2+
+++ discord-group-codex-message-tool.md sha256=02deff9f51b92a9fcbddab38492f043d5e5e5ecb9fec7310955a5a643afc1d5d
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": 54893,
33-
- "roughTokens": 13724
34-
+ "chars": 55201,
35-
+ "roughTokens": 13801
32+
- "chars": 54985,
33+
- "roughTokens": 13747
34+
+ "chars": 55293,
35+
+ "roughTokens": 13824
3636
@@ -239,2 +239,2 @@
3737
- "chars": 3390,
3838
- "roughTokens": 848
@@ -44,10 +44,10 @@
4444
+ "chars": 28816,
4545
+ "roughTokens": 7204
4646
@@ -247,2 +247,2 @@
47-
- "chars": 82231,
48-
- "roughTokens": 20558
49-
+ "chars": 84019,
50-
+ "roughTokens": 21005
47+
- "chars": 82323,
48+
- "roughTokens": 20581
49+
+ "chars": 84111,
50+
+ "roughTokens": 21028
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": 54893,
236-
"roughTokens": 13724
235+
"chars": 54985,
236+
"roughTokens": 13747
237237
},
238238
"openClawDeveloperInstructions": {
239239
"chars": 3390,
@@ -244,8 +244,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
244244
"roughTokens": 6834
245245
},
246246
"totalWithDynamicToolsJson": {
247-
"chars": 82231,
248-
"roughTokens": 20558
247+
"chars": 82323,
248+
"roughTokens": 20581
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=0a75703590d0c2198fdadbf2e427bd7f3242ebfb7d10ae339585e17f566be58c
2-
+++ telegram-heartbeat-codex-tool.md sha256=3d557f5b83324ad5ff9ab39c3fed596c3aaf935f084674a0a620d452a1102489
1+
--- telegram-direct-codex-message-tool.md sha256=b0de445838f6401181bbddf3584aeac126d1409ef8fc1c36071e3b86a4b3359d
2+
+++ telegram-heartbeat-codex-tool.md sha256=fa5e5537eb8a980ce83c654e95469eed2afbcdf86d52bf606723688d222bb4ee
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": 54893,
36-
- "roughTokens": 13724
37-
+ "chars": 56386,
38-
+ "roughTokens": 14097
35+
- "chars": 54985,
36+
- "roughTokens": 13747
37+
+ "chars": 56478,
38+
+ "roughTokens": 14120
3939
@@ -243,2 +238,2 @@
4040
- "chars": 27336,
4141
- "roughTokens": 6834
4242
+ "chars": 27678,
4343
+ "roughTokens": 6920
4444
@@ -247,2 +242,2 @@
45-
- "chars": 82231,
46-
- "roughTokens": 20558
47-
+ "chars": 84066,
48-
+ "roughTokens": 21017
45+
- "chars": 82323,
46+
- "roughTokens": 20581
47+
+ "chars": 84158,
48+
+ "roughTokens": 21040
4949
@@ -251,2 +246,2 @@
5050
- "chars": 863,
5151
- "roughTokens": 216

0 commit comments

Comments
 (0)