Skip to content

Commit 8ff8507

Browse files
fix(code-mode): sharpen exec tool description so models stop wasting turns rediscovering constraints
1 parent bd3dddc commit 8ff8507

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/agents/code-mode.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,15 @@ export function createCodeModeTools(ctx: CodeModeToolContext): AnyAgentTool[] {
826826
name: CODE_MODE_EXEC_TOOL_NAME,
827827
label: "exec",
828828
description:
829-
"Run JavaScript or TypeScript in OpenClaw code mode. Node.js modules and `require`/`import` are NOT availablefor any shell, file, network, or external action, use enabled catalog tools allowed by policy from inside your code: `tools.search(query)` to find catalog entries, `tools.describe(entry.id)` for the input schema, then `tools.call(entry.id, args)`. The `language` field accepts only \"javascript\" or \"typescript\"; do not pass \"bash\", \"shell\", or other values.",
829+
'Run JavaScript or TypeScript in OpenClaw code mode. Node.js modules and `require`/`import` are NOT available; for any shell, file, network, or external action, use enabled catalog tools allowed by policy from inside your code: `tools.search(query)` to find catalog entries, `tools.describe(entry.id)` for the input schema, then `tools.call(entry.id, args)`. The `language` field accepts only "javascript" or "typescript"; do not pass "bash", "shell", or other values.',
830830
parameters: Type.Object({
831831
code: Type.String({
832832
description:
833833
"JavaScript or TypeScript source to run. The `tools` object (search/describe/call) and `ALL_TOOLS` are available in scope; Node built-in modules are not.",
834834
}),
835835
language: optionalStringEnum(["javascript", "typescript"] as const, {
836-
description: "Source language. Must be \"javascript\" or \"typescript\". Defaults to javascript.",
836+
description:
837+
'Source language. Must be "javascript" or "typescript". Defaults to javascript.',
837838
}),
838839
}),
839840
execute: async (

0 commit comments

Comments
 (0)