diff --git a/src/auto-reply/reply/get-reply-directives-utils.ts b/src/auto-reply/reply/get-reply-directives-utils.ts index c6b926ee6d..430a51c692 100644 --- a/src/auto-reply/reply/get-reply-directives-utils.ts +++ b/src/auto-reply/reply/get-reply-directives-utils.ts @@ -45,3 +45,23 @@ export function clearInlineDirectives(cleaned: string): InlineDirectives { hasQueueOptions: false, }; } + +export function clearExecInlineDirectives(directives: InlineDirectives): InlineDirectives { + return { + ...directives, + hasExecDirective: false, + execHost: undefined, + execSecurity: undefined, + execAsk: undefined, + execNode: undefined, + rawExecHost: undefined, + rawExecSecurity: undefined, + rawExecAsk: undefined, + rawExecNode: undefined, + hasExecOptions: false, + invalidExecHost: false, + invalidExecSecurity: false, + invalidExecAsk: false, + invalidExecNode: false, + }; +} diff --git a/src/auto-reply/reply/get-reply-directives.ts b/src/auto-reply/reply/get-reply-directives.ts index 683011ae13..116dca1d2e 100644 --- a/src/auto-reply/reply/get-reply-directives.ts +++ b/src/auto-reply/reply/get-reply-directives.ts @@ -14,7 +14,7 @@ import { resolveBlockStreamingChunking } from "./block-streaming.js"; import { buildCommandContext } from "./commands.js"; import { type InlineDirectives, parseInlineDirectives } from "./directive-handling.js"; import { applyInlineDirectiveOverrides } from "./get-reply-directives-apply.js"; -import { clearInlineDirectives } from "./get-reply-directives-utils.js"; +import { clearExecInlineDirectives, clearInlineDirectives } from "./get-reply-directives-utils.js"; import { defaultGroupActivation, resolveGroupRequireMention } from "./groups.js"; import { CURRENT_MESSAGE_MARKER, stripMentions, stripStructuralPrefixes } from "./mentions.js"; import { createModelSelectionState, resolveContextTokens } from "./model-selection.js"; @@ -215,23 +215,7 @@ export async function resolveReplyDirectives(params: { } if (isGroup && ctx.WasMentioned !== true && parsedDirectives.hasExecDirective) { if (parsedDirectives.execSecurity !== "deny") { - parsedDirectives = { - ...parsedDirectives, - hasExecDirective: false, - execHost: undefined, - execSecurity: undefined, - execAsk: undefined, - execNode: undefined, - rawExecHost: undefined, - rawExecSecurity: undefined, - rawExecAsk: undefined, - rawExecNode: undefined, - hasExecOptions: false, - invalidExecHost: false, - invalidExecSecurity: false, - invalidExecAsk: false, - invalidExecNode: false, - }; + parsedDirectives = clearExecInlineDirectives(parsedDirectives); } } const hasInlineDirective =