mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:14:30 +00:00
fix(security): harden runtime command override gating
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";
|
||||
import { resolveConfiguredModelRef } from "../agents/model-selection.js";
|
||||
import type { SkillCommandSpec } from "../agents/skills.js";
|
||||
import { isCommandFlagEnabled } from "../config/commands.js";
|
||||
import type { OpenClawConfig } from "../config/types.js";
|
||||
import { escapeRegExp } from "../utils.js";
|
||||
import { getChatCommands, getNativeCommandSurfaces } from "./commands-registry.data.js";
|
||||
@@ -96,13 +97,13 @@ export function listChatCommands(params?: {
|
||||
|
||||
export function isCommandEnabled(cfg: OpenClawConfig, commandKey: string): boolean {
|
||||
if (commandKey === "config") {
|
||||
return cfg.commands?.config === true;
|
||||
return isCommandFlagEnabled(cfg, "config");
|
||||
}
|
||||
if (commandKey === "debug") {
|
||||
return cfg.commands?.debug === true;
|
||||
return isCommandFlagEnabled(cfg, "debug");
|
||||
}
|
||||
if (commandKey === "bash") {
|
||||
return cfg.commands?.bash === true;
|
||||
return isCommandFlagEnabled(cfg, "bash");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user