Skip to content

Commit 3956839

Browse files
committed
feat: add message to DEFAULT_TOOL_ALLOW in sandbox policy
The sandbox default allowlist omitted "message", which prevented agents in workspace-write mode from sending visible replies without an explicit alsoAllow override in openclaw.json. This was the root cause of the Discord channel message tool injection failure (Cycle 2 diagnosis). With this change, the runtime openclaw.json workaround (tools.sandbox.tools.alsoAllow: ["message"]) can be safely withdrawn.
1 parent 743bce2 commit 3956839

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎src/agents/sandbox/constants.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const DEFAULT_TOOL_ALLOW = [
2525
"sessions_yield",
2626
"subagents",
2727
"session_status",
28+
"message",
2829
] as const;
2930

3031
// Provider docking: keep sandbox policy aligned with provider tool names.

‎src/agents/sandbox/tool-policy.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,4 +329,18 @@ describe("sandbox/tool-policy", () => {
329329
expect(message).toContain("openclaw sandbox explain --agent main");
330330
expect(message).not.toContain("--session");
331331
});
332+
333+
it("includes message in the default sandbox allowlist without explicit alsoAllow", () => {
334+
const cfg: OpenClawConfig = {
335+
agents: {
336+
defaults: {
337+
sandbox: { mode: "all", scope: "agent" },
338+
},
339+
list: [{ id: "test-agent" }],
340+
},
341+
};
342+
343+
const resolved = resolveSandboxToolPolicyForAgent(cfg, "test-agent");
344+
expect(resolved.allow).toContain("message");
345+
});
332346
});

0 commit comments

Comments
 (0)