Reference 导读
Code mode:把它当成随手翻的小字典
Code mode 更像一册放在手边的小字典。别想着一口吞下去,先知道它专门回答哪类小问题、什么时候该回来看、哪些表格是现场查门牌用的。原文最响的一记鼓点,其实是:Code mode is an experimental OpenClaw 机器人朋友-runtime feature. It is off by default. When…。
先听这页的人话版
Code mode
这一页不是在堆术语,它像把“Code mode”这台小机器搬到桌上,当着你的面拆开给你看。你先不用全记住,先抓住它到底在忙什么:Code mode is an experimental OpenClaw 机器人朋友-runtime feature. It is off by default. When you ena…。
如果把这页当成“给普通人看的版本”,你最应该带走的是:它到底在教你一件什么事、什么时候要这样做、以及哪里最容易踩坑。
第 1 站
Start Here
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode is an experimental OpenClaw 机器人朋友-runtime feature. It is off by default. When you enable it, OpenClaw changes…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode is an experimental OpenClaw 机器人朋友-runtime feature. It is off by default. When you enable it, OpenClaw changes…。
Code mode is an experimental OpenClaw agent-runtime feature. It is off by default. When you enable it, OpenClaw changes what the model sees for one run: instead of exposing every enabled tool schema directly, the model sees only exec and wait.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:This page documents OpenClaw code mode. It is not Codex Code mode. The two features share a name, but they are implemen…。
This page documents OpenClaw code mode. It is not Codex Code mode. The two features share a name, but they are implemented by different runtimes and expose different exec contracts:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:工具小帮手 policy disables native code mode. It runs in the Codex coding harness, where the 聪明脑袋模型 writes shell 魔法口令s throug…。
tool policy disables native code mode. It runs in the Codex coding harness, where the model writes shell commands through an exec.command contract.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:设置说明书ured. It runs in the OpenClaw generic 机器人朋友 runtime, where the 聪明脑袋模型 writes JavaScript or TypeScript programs thr…。
configured. It runs in the OpenClaw generic agent runtime, where the model writes JavaScript or TypeScript programs through an exec.code contract.
这一串条目别硬背,把它当成“Start Here”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:Codex Code Mode is enabled for Codex app-…、OpenClaw code mode is disabled unless 工具小…。
- Codex Code Mode is enabled for Codex app-server threads unless restricted
- OpenClaw code mode is disabled unless
tools.codeMode.enabled: trueis
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Codex Code Mode and Codex-native dynamic 工具小帮手 search are stable Codex harness surfaces. OpenClaw code mode is an OpenC…。
Codex Code Mode and Codex-native dynamic tool search are stable Codex harness surfaces. OpenClaw code mode is an OpenClaw-owned experimental tool-surface adapter for generic OpenClaw runs. It uses quickjs-wasi, a hidden OpenClaw tool catalog, and the normal OpenClaw tool executor.
第 2 站
What is this?
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw code mode lets the 聪明脑袋模型 write a small JavaScript or TypeScript program instead of choosing directly from a l…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw code mode lets the 聪明脑袋模型 write a small JavaScript or TypeScript program instead of choosing directly from a l…。
OpenClaw code mode lets the model write a small JavaScript or TypeScript program instead of choosing directly from a long list of tools.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:When code mode is active:。
When code mode is active:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:QuickJS-WASI worker.
QuickJS-WASI worker.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:guest program through ALL_工具小帮手S and 工具小帮手s.
guest program through ALL_TOOLS and tools.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:through the same OpenClaw execution path used by normal 机器人朋友 turns.
through the same OpenClaw execution path used by normal agent turns.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:pending.
pending.
这一串条目别硬背,把它当成“What is this?”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:The 聪明脑袋模型-visible 工具小帮手 list is exactly…、exec evaluates 聪明脑袋模型-generated JavaScrip…、Normal OpenClaw 工具小帮手s are hidden from th…、Guest code can search the hidden catalog,…。
- The model-visible tool list is exactly
execandwait. execevaluates model-generated JavaScript or TypeScript in a constrained- Normal OpenClaw tools are hidden from the model prompt and exposed inside the
- Guest code can search the hidden catalog, describe a tool, and call a tool
waitresumes a suspended code-mode run when nested tool calls are still
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The important distinction: code mode changes the 聪明脑袋模型-facing orchestration surface. It does not replace OpenClaw 工具小帮…。
The important distinction: code mode changes the model-facing orchestration surface. It does not replace OpenClaw tools, plugin tools, MCP tools, auth, approval policy, channel behavior, or model selection.
第 3 站
Why is this good?
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode makes large 工具小帮手 catalogs easier for 聪明脑袋模型s to use. or hundreds of full 工具小帮手 schemas. conditional logic, a…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode makes large 工具小帮手 catalogs easier for 聪明脑袋模型s to use.
Code mode makes large tool catalogs easier for models to use.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:or hundreds of full 工具小帮手 schemas.
or hundreds of full tool schemas.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:conditional logic, and parallel nested 工具小帮手 calls inside one code cell.
conditional logic, and parallel nested tool calls inside one code cell.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:depending on provider-native code execution.
depending on provider-native code execution.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:policy, approvals, hooks, session context, and audit paths.
policy, approvals, hooks, session context, and audit paths.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:unavailable, OpenClaw fails closed instead of falling back to broad direct 工具小帮手 exposure.
unavailable, OpenClaw fails closed instead of falling back to broad direct tool exposure.
这一串条目别硬背,把它当成“Why is this good?”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:Smaller prompt surface: providers receive…、Better orchestration: the 聪明脑袋模型 can use…、Provider neutral: it works for OpenClaw,…、Existing policy stays in force: nested 工具…。
- Smaller prompt surface: providers receive two control tools instead of dozens
- Better orchestration: the model can use loops, joins, small transforms,
- Provider neutral: it works for OpenClaw, plugin, MCP, and client tools without
- Existing policy stays in force: nested tool calls still go through OpenClaw
- Clear failure mode: when code mode is explicitly enabled and the runtime is
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode is especially useful for 机器人朋友s with a large enabled 工具小帮手 catalog or for workflows where the 聪明脑袋模型 repeated…。
Code mode is especially useful for agents with a large enabled tool catalog or for workflows where the model repeatedly needs to search, combine, and call tools before producing an answer.
第 4 站
How to enable it
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
很多文档看起来长,其实是在防你漏掉前置条件。
真正照做时,先找前置条件,再找必填项,最后看验证方法。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Add 工具小帮手s.codeMode.enabled: true to the 机器人朋友 or runtime 设置说明书: The shorthand is also accepted: Code mode remains off…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Add 工具小帮手s.codeMode.enabled: true to the 机器人朋友 or runtime 设置说明书:。
Add tools.codeMode.enabled: true to the agent or runtime config:
这段不是对白,而是一叠设置卡片,像在给系统贴门牌、路线和规矩。
- 大括号像两只手把同一组设置拢住,意思是“这些东西算一伙”。
- 这里在给“tools”挂牌子,告诉系统它该指向“{”。
- 这里在给“codeMode”挂牌子,告诉系统它该指向“{”。
{
tools: {
codeMode: {
enabled: true,
},
},
}
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The shorthand is also accepted:。
The shorthand is also accepted:
这段不是对白,而是一叠设置卡片,像在给系统贴门牌、路线和规矩。
- 大括号像两只手把同一组设置拢住,意思是“这些东西算一伙”。
- 这里在给“tools”挂牌子,告诉系统它该指向“{”。
- 这里在给“codeMode”挂牌子,告诉系统它该指向“true”。
{
tools: {
codeMode: true,
},
}
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode remains off when 工具小帮手s.codeMode is omitted, false, or an object without enabled: true.
Code mode remains off when tools.codeMode is omitted, false, or an object without enabled: true.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Use explicit limits when you want tighter bounds:。
Use explicit limits when you want tighter bounds:
这段不是对白,而是一叠设置卡片,像在给系统贴门牌、路线和规矩。
- 大括号像两只手把同一组设置拢住,意思是“这些东西算一伙”。
- 这里在给“tools”挂牌子,告诉系统它该指向“{”。
- 这里在给“codeMode”挂牌子,告诉系统它该指向“{”。
{
tools: {
codeMode: {
enabled: true,
timeoutMs: 10000,
memoryLimitBytes: 67108864,
maxOutputBytes: 65536,
maxSnapshotBytes: 10485760,
maxPendingToolCalls: 16,
snapshotTtlSeconds: 900,
searchDefaultLimit: 8,
maxSearchLimit: 50,
},
},
}
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:To confirm the 聪明脑袋模型 payload shape while debugging, run the 门口的小门卫 with targeted logging:。
To confirm the model payload shape while debugging, run the Gateway with targeted logging:
这是一串终端口令,像你站在控制台前,一下下按按钮让机器醒过来。
- 这一行“OPENCLAW_DEBUG_CODE_MODE=1 \”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“OPENCLAW_DEBUG_MODEL_TRANSPORT=1 \”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“OPENCLAW_DEBUG_MODEL_PAYLOAD=tools \”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
OPENCLAW_DEBUG_CODE_MODE=1 \
OPENCLAW_DEBUG_MODEL_TRANSPORT=1 \
OPENCLAW_DEBUG_MODEL_PAYLOAD=tools \
openclaw gateway
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:With code mode active, the logged 聪明脑袋模型-facing 工具小帮手 names should be exec and wait. If you need the redacted provider…。
With code mode active, the logged model-facing tool names should be exec and wait. If you need the redacted provider payload, add OPENCLAW_DEBUG_MODEL_PAYLOAD=full-redacted for a short debugging session.
第 5 站
Technical tour
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The rest of this page describes the runtime contract and implementation details. It is intended for maintainers, 新本领插件…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The rest of this page describes the runtime contract and implementation details. It is intended for maintainers, 新本领插件…。
The rest of this page describes the runtime contract and implementation details. It is intended for maintainers, plugin authors debugging tool exposure, and operators validating high-risk deployments.
第 6 站
Runtime status
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Codex harness surface. direct 工具小帮手 exposure.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Codex harness surface.
Codex harness surface.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:direct 工具小帮手 exposure.
direct tool exposure.
这一串条目别硬背,把它当成“Runtime status”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:Runtime: quickjs-wasi.、Default state: disabled.、Stability: experimental OpenClaw surface;…、Target surface: generic OpenClaw 机器人朋友 ru…。
- Runtime:
quickjs-wasi. - Default state: disabled.
- Stability: experimental OpenClaw surface; Codex Code mode is a separate stable
- Target surface: generic OpenClaw agent runs.
- Security posture: model code is hostile.
- User-facing promise: enabling code mode never silently falls back to broad
第 7 站
Scope
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode owns the 聪明脑袋模型-facing orchestration shape for a prepared run. It does not own 聪明脑袋模型 selection, 消息通道 behavio…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode owns the 聪明脑袋模型-facing orchestration shape for a prepared run. It does not own 聪明脑袋模型 selection, 消息通道 behavio…。
Code mode owns the model-facing orchestration shape for a prepared run. It does not own model selection, channel behavior, auth, tool policy, or tool implementations.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:In scope:。
In scope:
这一串条目别硬背,把它当成“Scope”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:聪明脑袋模型-visible exec and wait 工具小帮手 defini…、hidden 工具小帮手 catalog construction、JavaScript and TypeScript guest execution、QuickJS-WASI worker runtime。
- model-visible
execandwaittool definitions - hidden tool catalog construction
- JavaScript and TypeScript guest execution
- QuickJS-WASI worker runtime
- host callbacks for catalog search, schema describe, and tool call
- resumable state for suspended guest programs
- output, timeout, memory, pending-call, and snapshot limits
- telemetry and trajectory projection for nested tool calls
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Out of scope:。
Out of scope:
这一串条目别硬背,把它当成“Scope”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:provider-native remote code execution、shell execution semantics、changing existing 工具小帮手 authorization、persistent user-authored scripts。
- provider-native remote code execution
- shell execution semantics
- changing existing tool authorization
- persistent user-authored scripts
- package manager, file, network, or module access in guest code
- direct reuse of Codex Code mode internals
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Provider-owned 工具小帮手s such as remote Python sandboxes remain separate 工具小帮手s. See Code execution.
Provider-owned tools such as remote Python sandboxes remain separate tools. See Code execution.
第 8 站
Terms
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**Code mode** is the OpenClaw runtime mode that hides normal 聪明脑袋模型 工具小帮手s and exposes only exec and wait. **Guest runt…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**Code mode** is the OpenClaw runtime mode that hides normal 聪明脑袋模型 工具小帮手s and exposes only exec and wait.
**Code mode** is the OpenClaw runtime mode that hides normal model tools and exposes only exec and wait.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**Guest runtime** is the QuickJS-WASI JavaScript VM that evaluates 聪明脑袋模型 code.
**Guest runtime** is the QuickJS-WASI JavaScript VM that evaluates model code.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**Host bridge** is the narrow JSON-compatible callback surface from guest code back into OpenClaw.
**Host bridge** is the narrow JSON-compatible callback surface from guest code back into OpenClaw.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**Catalog** is the run-scoped list of effective 工具小帮手s after normal 工具小帮手 policy, 新本领插件, MCP, and 来帮忙的小伙伴-工具小帮手 resolut…。
**Catalog** is the run-scoped list of effective tools after normal tool policy, plugin, MCP, and client-tool resolution.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**Nested 工具小帮手 call** is a 工具小帮手 call made from guest code through the host bridge.
**Nested tool call** is a tool call made from guest code through the host bridge.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**Snapshot** is serialized QuickJS-WASI VM state saved so wait can continue a suspended code-mode run.
**Snapshot** is serialized QuickJS-WASI VM state saved so wait can continue a suspended code-mode run.
第 9 站
设置说明书uration
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:工具小帮手s.codeMode.enabled is the activation gate. Setting other code-mode fields does not enable the feature. Supported f…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:工具小帮手s.codeMode.enabled is the activation gate. Setting other code-mode fields does not enable the feature.
tools.codeMode.enabled is the activation gate. Setting other code-mode fields does not enable the feature.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Supported fields:。
Supported fields:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:both.
both.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runtime clamp: 100 to 60000.
Runtime clamp: 100 to 60000.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:1048576 to 1073741824.
1048576 to 1073741824.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runtime clamp: 1024 to 10485760.
Runtime clamp: 1024 to 10485760.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runtime clamp: 1024 to 268435456.
Runtime clamp: 1024 to 268435456.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runtime clamp: 1 to 128.
Runtime clamp: 1 to 128.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runtime clamp: 1 to 86400.
Runtime clamp: 1 to 86400.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runtime clamps this to maxSearchLimit.
Runtime clamps this to maxSearchLimit.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runtime clamp: 1 to 50.
Runtime clamp: 1 to 50.
这一串条目别硬背,把它当成“Configuration”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:enabled: boolean. Default false. Enables…、runtime: "quickjs-wasi". Only supported r…、mode: "only". Exposes exec and wait, hide…、languages: array of "javascript" and "typ…。
enabled: boolean. Defaultfalse. Enables code mode only whentrue.runtime:"quickjs-wasi". Only supported runtime.mode:"only". Exposesexecandwait, hides normal model tools.languages: array of"javascript"and"typescript". Default includestimeoutMs: wall-clock cap for oneexecorwait. Default10000.memoryLimitBytes: QuickJS heap cap. Default67108864. Runtime clamp:maxOutputBytes: cap for returned text, JSON, and logs. Default65536.maxSnapshotBytes: cap for serialized VM snapshots. Default10485760.maxPendingToolCalls: cap for concurrent nested tool calls. Default16.snapshotTtlSeconds: how long a suspended VM can be resumed. Default900.searchDefaultLimit: default hidden-catalog search result count. Default8.maxSearchLimit: maximum hidden-catalog search result count. Default50.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:If code mode is enabled but QuickJS-WASI cannot load, OpenClaw fails closed for that run. It does not silently expose n…。
If code mode is enabled but QuickJS-WASI cannot load, OpenClaw fails closed for that run. It does not silently expose normal tools as a fallback.
第 10 站
Activation
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode is evaluated after the effective 工具小帮手 policy is known and before the final 聪明脑袋模型 request is assembled. Acti…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode is evaluated after the effective 工具小帮手 policy is known and before the final 聪明脑袋模型 request is assembled.
Code mode is evaluated after the effective tool policy is known and before the final model request is assembled.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Activation order:。
Activation order:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:1. Resolve the 机器人朋友, 聪明脑袋模型, provider, sandbox, 消息通道, sender, and run policy. 2. Build the effective OpenClaw 工具小帮手 li…。
1. Resolve the agent, model, provider, sandbox, channel, sender, and run policy. 2. Build the effective OpenClaw tool list. 3. Add eligible plugin, MCP, and client tools. 4. Apply allow and deny policy. 5. If tools.codeMode.enabled is false, continue with normal tool exposure. 6. If enabled and tools are active for the run, register the effective tools in the code-mode catalog. 7. Remove all normal tools from the model-visible tool list. 8. Add code-mode exec and wait.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runs that intentionally have no 工具小帮手s, such as raw 聪明脑袋模型 calls, disable工具小帮手s, or an empty allowlist, do not activate…。
Runs that intentionally have no tools, such as raw model calls, disableTools, or an empty allowlist, do not activate the code-mode surface even if the config contains tools.codeMode.enabled: true.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The code-mode catalog is run-scoped. It must not leak 工具小帮手s from another 机器人朋友, session, sender, or run.
The code-mode catalog is run-scoped. It must not leak tools from another agent, session, sender, or run.
第 11 站
聪明脑袋模型-visible 工具小帮手s
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
很多文档看起来长,其实是在防你漏掉前置条件。
真正照做时,先找前置条件,再找必填项,最后看验证方法。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:When code mode is active, the 聪明脑袋模型 sees exactly these top-level 工具小帮手s: All other enabled 工具小帮手s are hidden from the…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:When code mode is active, the 聪明脑袋模型 sees exactly these top-level 工具小帮手s:。
When code mode is active, the model sees exactly these top-level tools:
这一串条目别硬背,把它当成“Model-visible tools”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:exec、wait。
execwait
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:All other enabled 工具小帮手s are hidden from the 聪明脑袋模型-facing 工具小帮手 list and registered in the code-mode catalog.
All other enabled tools are hidden from the model-facing tool list and registered in the code-mode catalog.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The 聪明脑袋模型 should use exec for 工具小帮手 orchestration, data joining, loops, parallel nested calls, and structured transfor…。
The model should use exec for tool orchestration, data joining, loops, parallel nested calls, and structured transformations. The model should use wait only when exec returns a resumable waiting result.
第 12 站
`exec`
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:exec starts a code-mode cell and returns one result. The input code is 聪明脑袋模型 generated and must be treated as hostile.…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:exec starts a code-mode cell and returns one result. The input code is 聪明脑袋模型 generated and must be treated as hostile.
exec starts a code-mode cell and returns one result. The input code is model generated and must be treated as hostile.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Input:。
Input:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“type CodeModeExecInput = {”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这里在给“code?”挂牌子,告诉系统它该指向“string;”。
- 这里在给“command?”挂牌子,告诉系统它该指向“string;”。
type CodeModeExecInput = {
code?: string;
command?: string;
language?: "javascript" | "typescript";
};
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Input rules:。
Input rules:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:trusted rewrites; when both are present, the values must match.
trusted rewrites; when both are present, the values must match.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:include 工具小帮手InputKind: "javascript" "typescript" when the input language is known, so policies can distinguish code-mo…。
include toolInputKind: "javascript" | "typescript" when the input language is known, so policies can distinguish code-mode cells from shell-style exec calls that share the same tool name.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:in v1.
in v1.
这一串条目别硬背,把它当成“`exec`”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:One of code or 魔法口令 must be non-empty.、code is the documented 聪明脑袋模型-facing fiel…、魔法口令 is accepted as an exec-compatible al…、Outer code-mode exec hook events include…。
- One of
codeorcommandmust be non-empty. codeis the documented model-facing field.commandis accepted as an exec-compatible alias for hook policies and- Outer code-mode
exechook events includetoolKind: "code_mode_exec"and languagedefaults to"javascript".- If
languageis"typescript", OpenClaw transpiles before evaluation. execrejectsimport,require, dynamic import, and module-loader patternsexecdoes not expose the normal shellexecimplementation recursively.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Result:。
Result:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“type CodeModeResult = CodeModeCompletedResult | CodeModeWaitingResult | CodeModeFailedResult;”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“type CodeModeCompletedResult = {”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这里在给“status”挂牌子,告诉系统它该指向“completed;”。
type CodeModeResult = CodeModeCompletedResult | CodeModeWaitingResult | CodeModeFailedResult;
type CodeModeCompletedResult = {
status: "completed";
value: unknown;
output?: CodeModeOutput[];
telemetry: CodeModeTelemetry;
};
type CodeModeWaitingResult = {
status: "waiting";
runId: string;
reason: "pending_tools" | "yield";
pendingToolCalls?: CodeModePendingToolCall[];
output?: CodeModeOutput[];
telemetry: CodeModeTelemetry;
};
type CodeModeFailedResult = {
status: "failed";
error: string;
code?: CodeModeErrorCode;
output?: CodeModeOutput[];
telemetry: CodeModeTelemetry;
};
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:exec returns waiting when the QuickJS VM suspends with resumable state. The result includes a runId for wait.
exec returns waiting when the QuickJS VM suspends with resumable state. The result includes a runId for wait.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:exec returns completed only when the guest VM has no pending work and the final value is JSON-compatible after OpenClaw…。
exec returns completed only when the guest VM has no pending work and the final value is JSON-compatible after OpenClaw's output adapter runs.
第 13 站
`wait`
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
很多文档看起来长,其实是在防你漏掉前置条件。
真正照做时,先找前置条件,再找必填项,最后看验证方法。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:wait continues a suspended code-mode VM. Input: The output is the same CodeModeResult union returned by exec. wait exis…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:wait continues a suspended code-mode VM.
wait continues a suspended code-mode VM.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Input:。
Input:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“type CodeModeWaitInput = {”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这里在给“runId”挂牌子,告诉系统它该指向“string;”。
- 大括号像两只手把同一组设置拢住,意思是“这些东西算一伙”。
type CodeModeWaitInput = {
runId: string;
};
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The output is the same CodeModeResult union returned by exec.
The output is the same CodeModeResult union returned by exec.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:wait exists because nested OpenClaw 工具小帮手s can be slow, interactive, approval gated, or 一边说一边送 partial updates. The 聪明脑…。
wait exists because nested OpenClaw tools can be slow, interactive, approval gated, or stream partial updates. The model should not need to keep one long exec call open while the host waits for external work.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:QuickJS-WASI snapshot and restore is the v1 resume mechanism:。
QuickJS-WASI snapshot and restore is the v1 resume mechanism:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:1. exec evaluates code until completion, failure, or suspension. 2. On suspension, OpenClaw snapshots the QuickJS VM an…。
1. exec evaluates code until completion, failure, or suspension. 2. On suspension, OpenClaw snapshots the QuickJS VM and records pending host work. 3. When pending work settles, wait restores the VM snapshot. 4. OpenClaw re-registers host callbacks by stable names. 5. OpenClaw delivers nested tool results into the restored VM. 6. OpenClaw drains QuickJS pending jobs. 7. wait returns completed, failed, or another waiting result.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Snapshots are runtime state, not user artifacts. They are size-limited, expired, and scoped to the run and session that…。
Snapshots are runtime state, not user artifacts. They are size-limited, expired, and scoped to the run and session that created them.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:wait fails when:。
wait fails when:
这一串条目别硬背,把它当成“`wait`”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:runId is unknown.、the snapshot expired.、the parent run or session was aborted.、the caller is not in the same run/session…。
runIdis unknown.- the snapshot expired.
- the parent run or session was aborted.
- the caller is not in the same run/session scope.
- QuickJS-WASI restore fails.
- restoring would exceed configured limits.
第 14 站
Guest runtime 对话接口
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The guest runtime exposes a small global 对话接口: ALL_工具小帮手S is compact metadata for the run-scoped catalog. It does not c…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The guest runtime exposes a small global 对话接口:。
The guest runtime exposes a small global API:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这里在给“declare const ALL_TOOLS”挂牌子,告诉系统它该指向“ToolCatalogEntry[];”。
- 这里在给“declare const tools”挂牌子,告诉系统它该指向“ToolCatalog;”。
- 这里在给“declare function text(value”挂牌子,告诉系统它该指向“unknown): void;”。
declare const ALL_TOOLS: ToolCatalogEntry[];
declare const tools: ToolCatalog;
declare function text(value: unknown): void;
declare function json(value: unknown): void;
declare function yield_control(reason?: string): Promise<void>;
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:ALL_工具小帮手S is compact metadata for the run-scoped catalog. It does not contain full schemas by default.
ALL_TOOLS is compact metadata for the run-scoped catalog. It does not contain full schemas by default.
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“type ToolCatalogEntry = {”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这里在给“id”挂牌子,告诉系统它该指向“string;”。
- 这里在给“name”挂牌子,告诉系统它该指向“string;”。
type ToolCatalogEntry = {
id: string;
name: string;
label?: string;
description: string;
source: "openclaw" | "plugin" | "mcp" | "client";
sourceName?: string;
};
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Full schema is loaded only on demand:。
Full schema is loaded only on demand:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“type ToolCatalogEntryWithSchema = ToolCatalogEntry & {”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这里在给“parameters”挂牌子,告诉系统它该指向“unknown;”。
- 大括号像两只手把同一组设置拢住,意思是“这些东西算一伙”。
type ToolCatalogEntryWithSchema = ToolCatalogEntry & {
parameters: unknown;
};
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Catalog helpers:。
Catalog helpers:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“type ToolCatalog = {”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这里在给“search(query”挂牌子,告诉系统它该指向“string options?: { limit?: number }): Promise”。
- 这一行“ToolCatalogEntry”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
type ToolCatalog = {
search(query: string, options?: { limit?: number }): Promise
ToolCatalogEntry
;
describe(id: string): Promise
ToolCatalogEntryWithSchema
;
call(id: string, input?: unknown): Promise<unknown>;
[safeToolName: string]: unknown;
};
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Convenience 工具小帮手 functions are installed only for unambiguous safe names:。
Convenience tool functions are installed only for unambiguous safe names:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“const files = await tools.search("read local file");”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“const fileRead = await tools.describe(files[0].id);”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这里在给“const content = await tools.call(fileRead.id { path”挂牌子,告诉系统它该指向“README.md });”。
const files = await tools.search("read local file");
const fileRead = await tools.describe(files[0].id);
const content = await tools.call(fileRead.id, { path: "README.md" });
// If the hidden catalog has an unambiguous `web_search` entry:
const hits = await tools.web_search({ query: "OpenClaw code mode" });
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The guest runtime must not expose host objects directly. Inputs and outputs cross the bridge as JSON-compatible values…。
The guest runtime must not expose host objects directly. Inputs and outputs cross the bridge as JSON-compatible values with explicit size caps.
第 15 站
Output 对话接口
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:text(value) appends human-readable output to the output array. json(value) appends a structured output item after JSON-…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:text(value) appends human-readable output to the output array.
text(value) appends human-readable output to the output array.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:json(value) appends a structured output item after JSON-compatible serialization.
json(value) appends a structured output item after JSON-compatible serialization.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The guest code's final returned value becomes value in a completed result.
The guest code's final returned value becomes value in a completed result.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Output item:。
Output item:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这里在给“type CodeModeOutput = { type”挂牌子,告诉系统它该指向“text; text: string } | { type: json; value: unknown };”。
type CodeModeOutput = { type: "text"; text: string } | { type: "json"; value: unknown };
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Output rules:。
Output rules:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:code-mode bridge。
code-mode bridge
这一串条目别硬背,把它当成“Output API”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:output order matches guest calls、output is capped by maxOutputBytes、non-serializable values are converted to…、binary values are not supported in v1。
- output order matches guest calls
- output is capped by
maxOutputBytes - non-serializable values are converted to plain strings or errors
- binary values are not supported in v1
- images and files travel through ordinary OpenClaw tools, not through the
第 16 站
工具小帮手 catalog
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The hidden catalog includes 工具小帮手s after effective policy filtering: 1. OpenClaw core 工具小帮手s. 2. Bundled 新本领插件 工具小帮手s.…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The hidden catalog includes 工具小帮手s after effective policy filtering:。
The hidden catalog includes tools after effective policy filtering:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:1. OpenClaw core 工具小帮手s. 2. Bundled 新本领插件 工具小帮手s. 3. External 新本领插件 工具小帮手s. 4. MCP 工具小帮手s. 5. 来帮忙的小伙伴-provided 工具小帮手s f…。
1. OpenClaw core tools. 2. Bundled plugin tools. 3. External plugin tools. 4. MCP tools. 5. Client-provided tools for the current run.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Catalog ids are stable within one run and deterministic across equivalent 工具小帮手 sets when possible.
Catalog ids are stable within one run and deterministic across equivalent tool sets when possible.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Recommended id shape:。
Recommended id shape:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这里在给“<source>”挂牌子,告诉系统它该指向“<owner>:<tool-name>”。
<source>:<owner>:<tool-name>
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Examples:。
Examples:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这里在给“openclaw”挂牌子,告诉系统它该指向“core:message”。
- 这里在给“plugin”挂牌子,告诉系统它该指向“browser:browser_request”。
- 这里在给“mcp”挂牌子,告诉系统它该指向“github:create_issue”。
openclaw:core:message
plugin:browser:browser_request
mcp:github:create_issue
client:app:select_file
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The catalog omits code-mode control 工具小帮手s:。
The catalog omits code-mode control tools:
这一串条目别硬背,把它当成“Tool catalog”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:exec、wait、工具小帮手_search_code、工具小帮手_search。
execwaittool_search_codetool_searchtool_describetool_call
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:This prevents recursion and keeps the 聪明脑袋模型-facing contract narrow.
This prevents recursion and keeps the model-facing contract narrow.
第 17 站
工具小帮手 Search interaction
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
很多文档看起来长,其实是在防你漏掉前置条件。
真正照做时,先找前置条件,再找必填项,最后看验证方法。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode supersedes the PI 工具小帮手 Search 聪明脑袋模型 surface for runs where it is active. When 工具小帮手s.codeMode.enabled is tr…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode supersedes the PI 工具小帮手 Search 聪明脑袋模型 surface for runs where it is active.
Code mode supersedes the PI Tool Search model surface for runs where it is active.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:When 工具小帮手s.codeMode.enabled is true and code mode activates:。
When tools.codeMode.enabled is true and code mode activates:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:or 工具小帮手_call as 聪明脑袋模型-visible 工具小帮手s.
or tool_call as model-visible tools.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:and call helpers.
and call helpers.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:uses.
uses.
这一串条目别硬背,把它当成“Tool Search interaction”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:OpenClaw does not expose 工具小帮手_search_cod…、The same cataloging idea moves inside the…、The guest runtime receives compact ALL_工具…、Nested calls dispatch through the same Op…。
- OpenClaw does not expose
tool_search_code,tool_search,tool_describe, - The same cataloging idea moves inside the guest runtime.
- The guest runtime receives compact
ALL_TOOLSmetadata and search, describe, - Nested calls dispatch through the same OpenClaw executor path that Tool Search
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The existing 工具小帮手 Search page describes the PI compact catalog bridge. Code mode is the generic OpenClaw alternative f…。
The existing Tool Search page describes the PI compact catalog bridge. Code mode is the generic OpenClaw alternative for runs that can use exec and wait.
第 18 站
工具小帮手 names and collisions
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The 聪明脑袋模型-visible exec 工具小帮手 is the code-mode 工具小帮手. If the normal OpenClaw shell exec 工具小帮手 is enabled, it is hidden…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The 聪明脑袋模型-visible exec 工具小帮手 is the code-mode 工具小帮手. If the normal OpenClaw shell exec 工具小帮手 is enabled, it is hidden…。
The model-visible exec tool is the code-mode tool. If the normal OpenClaw shell exec tool is enabled, it is hidden from the model and cataloged like any other tool.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Inside the guest runtime:。
Inside the guest runtime:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:policy allows it.
policy allows it.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:unambiguous safe name.
unambiguous safe name.
这一串条目别硬背,把它当成“Tool names and collisions”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:工具小帮手s.call("openclaw:core:exec", input)…、工具小帮手s.exec(...) is installed only if the…、the code-mode exec 工具小帮手 is never recursi…。
tools.call("openclaw:core:exec", input)can call the shell exec tool iftools.exec(...)is installed only if the shell exec catalog entry has an- the code-mode
exectool is never recursively available throughtools.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:If two 工具小帮手s normalize to the same safe convenience name, OpenClaw omits the convenience function and requires 工具小帮手s.…。
If two tools normalize to the same safe convenience name, OpenClaw omits the convenience function and requires tools.call(id, input).
第 19 站
Nested 工具小帮手 execution
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Every nested 工具小帮手 call crosses the host bridge and re-enters OpenClaw. Nested execution preserves: Nested calls projec…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Every nested 工具小帮手 call crosses the host bridge and re-enters OpenClaw.
Every nested tool call crosses the host bridge and re-enters OpenClaw.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Nested execution preserves:。
Nested execution preserves:
这一串条目别硬背,把它当成“Nested tool execution”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:active 机器人朋友 id、session id and session key、sender and 消息通道 context、sandbox policy。
- active agent id
- session id and session key
- sender and channel context
- sandbox policy
- approval policy
- plugin
before_tool_callhooks - abort signal
- streaming updates where available
- trajectory and audit events
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Nested calls project into the transcript as real 工具小帮手 calls so support bundles can show what happened. The projection…。
Nested calls project into the transcript as real tool calls so support bundles can show what happened. The projection identifies the parent code-mode tool call and the nested tool id.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Parallel nested calls are allowed up to maxPending工具小帮手Calls.
Parallel nested calls are allowed up to maxPendingToolCalls.
第 20 站
Runtime state
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Each code-mode run has a state machine: State is scoped by 机器人朋友 run, session, and 工具小帮手 call id. A wait call from a di…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Each code-mode run has a state machine:。
Each code-mode run has a state machine:
这一串条目别硬背,把它当成“Runtime state”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:running: VM is executing or nested calls…、waiting: VM snapshot exists and can be re…、completed: final value returned; snapshot…、failed: error returned; snapshot deleted.
running: VM is executing or nested calls are in flight.waiting: VM snapshot exists and can be resumed withwait.completed: final value returned; snapshot deleted.failed: error returned; snapshot deleted.expired: snapshot or pending state exceeded retention; cannot resume.aborted: parent run/session cancelled; snapshot deleted.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:State is scoped by 机器人朋友 run, session, and 工具小帮手 call id. A wait call from a different run or session fails.
State is scoped by agent run, session, and tool call id. A wait call from a different run or session fails.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Snapshot storage is bounded:。
Snapshot storage is bounded:
这一串条目别硬背,把它当成“Runtime state”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:maximum snapshot bytes per run、maximum live snapshots per process、snapshot TTL、cleanup on run end。
- maximum snapshot bytes per run
- maximum live snapshots per process
- snapshot TTL
- cleanup on run end
- cleanup on Gateway shutdown where persistence is not supported
第 21 站
QuickJS-WASI runtime
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw loads quickjs-wasi as a direct dependency in the owning package. The runtime does not rely on a transitive cop…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw loads quickjs-wasi as a direct dependency in the owning package. The runtime does not rely on a transitive cop…。
OpenClaw loads quickjs-wasi as a direct dependency in the owning package. The runtime does not rely on a transitive copy installed for proxy, PAC, or other unrelated dependencies.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Runtime responsibilities:。
Runtime responsibilities:
这一串条目别硬背,把它当成“QuickJS-WASI runtime”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:compile or load the QuickJS-WASI WebAssem…、create one isolated VM per code-mode run…、register host callbacks by stable names、set memory and interrupt limits。
- compile or load the QuickJS-WASI WebAssembly module
- create one isolated VM per code-mode run or resume
- register host callbacks by stable names
- set memory and interrupt limits
- evaluate JavaScript
- drain pending jobs
- snapshot suspended VM state
- restore snapshots for
wait - dispose VM handles and snapshots after terminal states
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The runtime executes outside OpenClaw's main event loop in a worker. A guest infinite loop must not block the 门口的小门卫 pr…。
The runtime executes outside OpenClaw's main event loop in a worker. A guest infinite loop must not block the Gateway process indefinitely.
第 22 站
TypeScript
这一节主要在解释“TypeScript”到底是干什么的,以及你什么时候会遇到它。
这一节主要在解释“TypeScript”到底是干什么的,以及你什么时候会遇到它。
如果你是第一次接触 OpenClaw,这一节最值得看的不是术语本身,而是它背后的使用场景和限制。
真正动手时,先看它有没有默认值、有没有必须打开的选项、以及会不会影响安全边界。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:TypeScript support is a source transform only: The TypeScript compiler is loaded lazily only for TypeScript cells. Plai…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:TypeScript support is a source transform only:。
TypeScript support is a source transform only:
这一串条目别硬背,把它当成“TypeScript”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:accepted input: one TypeScript code string、output: JavaScript string evaluated by Qu…、no typechecking、no module resolution。
- accepted input: one TypeScript code string
- output: JavaScript string evaluated by QuickJS-WASI
- no typechecking
- no module resolution
- no
importorrequirein v1 - diagnostics are returned as
failedresults
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The TypeScript compiler is loaded lazily only for TypeScript cells. Plain JavaScript cells and disabled code mode do no…。
The TypeScript compiler is loaded lazily only for TypeScript cells. Plain JavaScript cells and disabled code mode do not load the compiler.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The transform should preserve useful line numbers where feasible.
The transform should preserve useful line numbers where feasible.
第 23 站
安全守门员 boundary
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:聪明脑袋模型 code is hostile. The runtime uses defense in depth: package host global objects in the guest The sandbox is one…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:聪明脑袋模型 code is hostile. The runtime uses defense in depth:。
Model code is hostile. The runtime uses defense in depth:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:package。
package
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:host global objects in the guest。
host global objects in the guest
这一串条目别硬背,把它当成“Security boundary”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:run QuickJS-WASI outside the main event l…、load quickjs-wasi as a direct dependency,…、no filesystem, network, subprocess, modul…、use QuickJS memory and interrupt limits。
- run QuickJS-WASI outside the main event loop
- load
quickjs-wasias a direct dependency, not through Codex or a transitive - no filesystem, network, subprocess, module import, environment variables, or
- use QuickJS memory and interrupt limits
- enforce parent-process wall-clock timeout
- enforce output, snapshot, log, and pending-call caps
- serialize host bridge values through a narrow JSON adapter
- convert host errors into plain guest errors, never host realm objects
- drop snapshots on timeout, abort, session end, or expiry
- reject recursive access to
exec,wait, and Tool Search control tools - prevent convenience-name collisions from shadowing catalog helpers
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The sandbox is one 安全守门员 layer. Operators can still need OS-level hardening for high-risk deployments.
The sandbox is one security layer. Operators can still need OS-level hardening for high-risk deployments.
第 24 站
Error codes
这一节主要在解释“Error codes”到底是干什么的,以及你什么时候会遇到它。
这一节主要在解释“Error codes”到底是干什么的,以及你什么时候会遇到它。
如果你是第一次接触 OpenClaw,这一节最值得看的不是术语本身,而是它背后的使用场景和限制。
真正动手时,先看它有没有默认值、有没有必须打开的选项、以及会不会影响安全边界。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Errors returned to the guest are plain data. Host Error instances, stack objects, prototypes, and host functions do not…。
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“type CodeModeErrorCode =”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“| "runtime_unavailable"”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“| "invalid_config"”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
type CodeModeErrorCode =
| "runtime_unavailable"
| "invalid_config"
| "invalid_input"
| "unsupported_language"
| "typescript_transform_failed"
| "module_access_denied"
| "timeout"
| "memory_limit_exceeded"
| "output_limit_exceeded"
| "snapshot_limit_exceeded"
| "snapshot_expired"
| "snapshot_restore_failed"
| "too_many_pending_tool_calls"
| "nested_tool_failed"
| "aborted"
| "internal_error";
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Errors returned to the guest are plain data. Host Error instances, stack objects, prototypes, and host functions do not…。
Errors returned to the guest are plain data. Host Error instances, stack objects, prototypes, and host functions do not cross into QuickJS.
第 25 站
Telemetry
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode reports: Telemetry must not include secrets, raw environment values, or unredacted 工具小帮手 inputs beyond existi…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode reports:。
Code mode reports:
这一串条目别硬背,把它当成“Telemetry”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:visible 工具小帮手 names sent to the 聪明脑袋模型、hidden catalog size and source breakdown、exec and wait counts、nested search, describe, and call counts。
- visible tool names sent to the model
- hidden catalog size and source breakdown
execandwaitcounts- nested search, describe, and call counts
- nested tool ids called
- timeout, memory, snapshot, and output cap failures
- snapshot lifecycle events
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Telemetry must not include secrets, raw environment values, or unredacted 工具小帮手 inputs beyond existing OpenClaw traject…。
Telemetry must not include secrets, raw environment values, or unredacted tool inputs beyond existing OpenClaw trajectory policy.
第 26 站
Debugging
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Use targeted 聪明脑袋模型 transport logging when code mode behaves differently from a normal 工具小帮手 run: For payload-shape deb…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Use targeted 聪明脑袋模型 transport logging when code mode behaves differently from a normal 工具小帮手 run:。
Use targeted model transport logging when code mode behaves differently from a normal tool run:
这是一串终端口令,像你站在控制台前,一下下按按钮让机器醒过来。
- 这一行“OPENCLAW_DEBUG_CODE_MODE=1 \”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“OPENCLAW_DEBUG_MODEL_TRANSPORT=1 \”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“OPENCLAW_DEBUG_MODEL_PAYLOAD=tools \”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
OPENCLAW_DEBUG_CODE_MODE=1 \
OPENCLAW_DEBUG_MODEL_TRANSPORT=1 \
OPENCLAW_DEBUG_MODEL_PAYLOAD=tools \
OPENCLAW_DEBUG_SSE=events \
openclaw gateway
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:For payload-shape debugging, use OPENCLAW_DEBUG_聪明脑袋模型_PAYLOAD=full-redacted. This logs a capped, redacted JSON snapsho…。
For payload-shape debugging, use OPENCLAW_DEBUG_MODEL_PAYLOAD=full-redacted. This logs a capped, redacted JSON snapshot of the model request; it should only be used while debugging because prompts and message text can still appear.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:For 一边说一边送 debugging, use OPENCLAW_DEBUG_SSE=peek to log the first five redacted SSE events. Code mode also fails close…。
For stream debugging, use OPENCLAW_DEBUG_SSE=peek to log the first five redacted SSE events. Code mode also fails closed if the final provider payload does not contain exactly exec and wait after the code-mode surface has activated.
第 27 站
Implementation layout
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Implementation units: The implementation reuses catalog and executor concepts from 工具小帮手 Search, but does not use the n…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Implementation units:。
Implementation units:
这一串条目别硬背,把它当成“Implementation layout”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:设置说明书 contract: 工具小帮手s.codeMode、catalog builder: effective 工具小帮手s to comp…、聪明脑袋模型-surface adapter: replace visible 工…、QuickJS-WASI runtime adapter: load, eval,…。
- config contract:
tools.codeMode - catalog builder: effective tools to compact entries and id map
- model-surface adapter: replace visible tools with
execandwait - QuickJS-WASI runtime adapter: load, eval, snapshot, restore, dispose
- worker supervisor: timeout, abort, crash isolation
- bridge adapter: JSON-safe host callbacks and result delivery
- TypeScript transform adapter
- snapshot store: TTL, size caps, run/session scoping
- trajectory projection for nested tool calls
- telemetry counters and diagnostics
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The implementation reuses catalog and executor concepts from 工具小帮手 Search, but does not use the node:vm child as the sa…。
The implementation reuses catalog and executor concepts from Tool Search, but does not use the node:vm child as the sandbox.
第 28 站
Validation checklist
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode coverage should prove: active for the run payload enforcement catalog disabled or JavaScript-only paths。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Code mode coverage should prove:。
Code mode coverage should prove:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:active for the run。
active for the run
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:payload enforcement。
payload enforcement
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:catalog。
catalog
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:disabled or JavaScript-only paths。
disabled or JavaScript-only paths
这一串条目别硬背,把它当成“Validation checklist”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:disabled 设置说明书 leaves existing 工具小帮手 expo…、object 设置说明书 without enabled: true leaves…、enabled 设置说明书 exposes only exec and wait…、raw no-工具小帮手 runs, disable工具小帮手s, and emp…。
- disabled config leaves existing tool exposure unchanged
- object config without
enabled: trueleaves code mode disabled - enabled config exposes only
execandwaitto the model when tools are - raw no-tool runs,
disableTools, and empty allowlists do not trigger code-mode - all effective tools appear in
ALL_TOOLS - denied tools do not appear in
ALL_TOOLS tools.search,tools.describe, andtools.callwork for OpenClaw tools- Tool Search control tools are hidden from both the model surface and the hidden
- nested calls preserve approval and hook behavior
- shell
execis hidden from the model but callable by catalog id when allowed - recursive code-mode
execandwaitare not callable from guest code - TypeScript input is transformed and evaluated without loading TypeScript on
import,require, filesystem, network, and environment access fail- infinite loops time out and cannot block the Gateway
- memory cap failures terminate the guest VM
- output and snapshot caps are enforced for completed and suspended calls
waitresumes a suspended snapshot and returns the final value- expired, aborted, wrong-session, and unknown
runIdvalues fail - transcript replay and persistence preserve code-mode control calls
- transcript and telemetry show nested tool calls clearly
第 29 站
E2E test plan
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
很多文档看起来长,其实是在防你漏掉前置条件。
真正照做时,先找前置条件,再找必填项,最后看验证方法。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Run these as integration or end-to-end tests when changing the runtime: 1. Start a 门口的小门卫 with 工具小帮手s.codeMode.enabled:…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Run these as integration or end-to-end tests when changing the runtime:。
Run these as integration or end-to-end tests when changing the runtime:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:1. Start a 门口的小门卫 with 工具小帮手s.codeMode.enabled: false. 2. Send an 机器人朋友 turn with a small direct 工具小帮手 set. 3. Assert t…。
1. Start a Gateway with tools.codeMode.enabled: false. 2. Send an agent turn with a small direct tool set. 3. Assert the model-visible tools are unchanged. 4. Restart with tools.codeMode.enabled: true. 5. Send an agent turn with OpenClaw, plugin, MCP, and client test tools. 6. Assert the model-visible tool list is exactly exec, wait. 7. In exec, read ALL_TOOLS and assert the effective test tools are present. 8. In exec, call tools.search, tools.describe, and tools.call. 9. Assert denied tools are absent and cannot be called by guessed id. 10. Start a nested tool call that resolves after exec returns waiting. 11. Call wait and assert the restored VM receives the tool result. 12. Assert the final answer contains output produced after restore. 13. Assert timeout, abort, and snapshot expiry clean up runtime state. 14. Export trajectory and assert nested calls are visible under the parent code-mode call.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Docs-only changes to this page should still run pnpm check:docs.
Docs-only changes to this page should still run pnpm check:docs.
第 30 站
Related
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:---。
这一串条目别硬背,把它当成“Related”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:工具小帮手 Search、机器人朋友 runtimes、Exec 工具小帮手、Code execution。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:---。
---
AdSense 连接验证已经放在页面头部;广告单元等站点审批通过后再启用。
google-adsense-account: ca-pub-3833673520933536