Skip to content

Commit ec4b6ab

Browse files
committed
fix(ui): read exec security from tools config
1 parent cde99c3 commit ec4b6ab

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ Docs: https://docs.openclaw.ai
163163

164164
### Fixes
165165

166+
- Control UI/settings: show the active `tools.exec.security` policy in Quick Settings instead of stale agent-default exec security.
166167
- Gateway/watch: leave `OPENCLAW_TRACE_SYNC_IO` disabled by default in `pnpm gateway:watch:raw` so watch mode avoids noisy Node sync-I/O stack traces unless explicitly requested.
167168
- Codex app-server: close stdio stdin before force-killing the managed app-server, matching Codex single-client shutdown behavior and avoiding unsettled CLI exits after successful runs.
168169
- CLI/Codex: dispose registered agent harnesses during short-lived CLI shutdown so successful Codex-backed `agent --local` runs do not leave app-server child processes alive.

ui/src/ui/app-render.assistant-avatar.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,19 @@ describe("renderApp assistant avatar routing", () => {
241241
expect(shell?.style.getPropertyValue("--chat-message-max-width")).toBe("min(1280px, 82%)");
242242
});
243243

244+
it("passes tools.exec.security to Quick Settings", () => {
245+
renderApp(
246+
createState({
247+
configForm: {
248+
tools: { exec: { security: "full" } },
249+
agents: { defaults: { exec: { security: "deny" } } },
250+
},
251+
}),
252+
);
253+
254+
expect(quickSettingsProps.current?.security.execPolicy).toBe("full");
255+
});
256+
244257
it("does not throw when stale cron state contains a job without a payload", () => {
245258
expect(() =>
246259
renderApp(

ui/src/ui/app-render.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -578,17 +578,14 @@ function extractQuickSettingsSecurity(state: AppViewState): {
578578
gatewayAuth = "none";
579579
}
580580
}
581-
const agents = cfg.agents;
582581
let execPolicy = "allowlist";
583-
if (agents && typeof agents === "object") {
584-
const defaults = (agents as Record<string, unknown>).defaults;
585-
if (defaults && typeof defaults === "object") {
586-
const exec = (defaults as Record<string, unknown>).exec;
587-
if (exec && typeof exec === "object") {
588-
const security = (exec as Record<string, unknown>).security;
589-
if (typeof security === "string") {
590-
execPolicy = security;
591-
}
582+
const tools = cfg.tools;
583+
if (tools && typeof tools === "object") {
584+
const exec = (tools as Record<string, unknown>).exec;
585+
if (exec && typeof exec === "object") {
586+
const security = (exec as Record<string, unknown>).security;
587+
if (typeof security === "string") {
588+
execPolicy = security;
592589
}
593590
}
594591
}

0 commit comments

Comments
 (0)