fix: unblock control commands during active runs

This commit is contained in:
Peter Steinberger
2026-01-15 07:07:37 +00:00
parent 5a58feefdc
commit 0a1eeedc10
10 changed files with 66 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ import {
listChatCommandsForConfig,
normalizeCommandBody,
} from "./commands-registry.js";
import { isAbortTrigger } from "./reply/abort.js";
export function hasControlCommand(
text?: string,
@@ -31,3 +32,16 @@ export function hasControlCommand(
}
return false;
}
export function isControlCommandMessage(
text?: string,
cfg?: ClawdbotConfig,
options?: CommandNormalizeOptions,
): boolean {
if (!text) return false;
const trimmed = text.trim();
if (!trimmed) return false;
if (hasControlCommand(trimmed, cfg, options)) return true;
const normalized = normalizeCommandBody(trimmed, options).trim().toLowerCase();
return isAbortTrigger(normalized);
}