mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(code-mode): sharpen exec tool description so models stop wasting turns rediscovering constraints
This commit is contained in:
@@ -826,14 +826,15 @@ export function createCodeModeTools(ctx: CodeModeToolContext): AnyAgentTool[] {
|
||||
name: CODE_MODE_EXEC_TOOL_NAME,
|
||||
label: "exec",
|
||||
description:
|
||||
"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.",
|
||||
'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.',
|
||||
parameters: Type.Object({
|
||||
code: Type.String({
|
||||
description:
|
||||
"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.",
|
||||
}),
|
||||
language: optionalStringEnum(["javascript", "typescript"] as const, {
|
||||
description: "Source language. Must be \"javascript\" or \"typescript\". Defaults to javascript.",
|
||||
description:
|
||||
'Source language. Must be "javascript" or "typescript". Defaults to javascript.',
|
||||
}),
|
||||
}),
|
||||
execute: async (
|
||||
|
||||
Reference in New Issue
Block a user