惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
F
Fortinet All Blogs
D
Docker
博客园 - 司徒正美
腾讯CDC
Recent Announcements
Recent Announcements
The Cloudflare Blog
B
Blog RSS Feed
GbyAI
GbyAI
T
Tailwind CSS Blog
雷峰网
雷峰网
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(code-mode): sharpen exec tool description so models s...
clawsweeper · 2026-05-20 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -11,6 +11,7 @@ Docs: https://docs.openclaw.ai

1111
1212

### Fixes

1313
14+

- Agents/code mode: spell out the `exec` tool's JavaScript/TypeScript, no Node module, and catalog-bridge constraints in model-visible schema text so agents can use enabled tools without trial-and-error. (#84269) Thanks @Kaspre.

1415

- CLI/message: include a stable top-level `messageId` in `openclaw message --json` output when channel sends return one. (#84191) Thanks @100menotu001.

1516

- Gateway/agents: use an agent's `identity.name` in Gateway agent summaries when `agents.list[].name` is unset, so configured agent labels remain visible in clients. (#84355; refs #57835) Thanks @luoyanglang.

1617

- Plugins/hooks: apply a default 30-second timeout to `before_compaction` and `after_compaction` hooks so a hung plugin handler no longer blocks compaction completion. (#84153)

Original file line numberDiff line numberDiff line change

@@ -245,6 +245,29 @@ describe("Code Mode", () => {

245245

expect(language).not.toHaveProperty("oneOf");

246246

});

247247
248+

it("describes code-mode runtime constraints in the model-visible exec schema", () => {

249+

const { tools } = createCodeModeHarness();

250+

const execTool = tools[0];

251+

const parameters = execTool.parameters as {

252+

properties?: Record<string, Record<string, unknown>>;

253+

};

254+
255+

expect(execTool.description).toContain("Node.js modules");

256+

expect(execTool.description).toContain("`require`/`import` are NOT available");

257+

expect(execTool.description).toContain("`tools.search(query)`");

258+

expect(execTool.description).toContain("enabled catalog tools allowed by policy");

259+

expect(execTool.description).toContain("`tools.describe(entry.id)`");

260+

expect(execTool.description).toContain("`tools.call(entry.id, args)`");

261+

expect(execTool.description).toContain('"javascript" or "typescript"');

262+
263+

expect(parameters.properties?.code?.description).toContain("`tools` object");

264+

expect(parameters.properties?.code?.description).toContain("`ALL_TOOLS`");

265+

expect(parameters.properties?.code?.description).toContain("Node built-in modules are not");

266+

expect(parameters.properties?.language?.description).toContain(

267+

'Must be "javascript" or "typescript"',

268+

);

269+

});

270+
248271

it("removes legacy Tool Search controls from the visible code mode surface", () => {

249272

const { config, catalogRef, tools: codeModeTools } = createCodeModeHarness();

250273

const compacted = applyCodeModeCatalog({

Original file line numberDiff line numberDiff line change

@@ -826,11 +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. Use ALL_TOOLS and tools.search/describe/call inside the code to discover and call enabled tools.",

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({

831-

code: Type.String({ description: "JavaScript or TypeScript source to run." }),

831+

code: Type.String({

832+

description:

833+

"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.",

834+

}),

832835

language: optionalStringEnum(["javascript", "typescript"] as const, {

833-

description: "Source language. Defaults to javascript.",

836+

description:

837+

'Source language. Must be "javascript" or "typescript". Defaults to javascript.',

834838

}),

835839

}),

836840

execute: async (