fix: ignore inline status directives

This commit is contained in:
Peter Steinberger
2026-01-12 07:12:37 +00:00
parent e19a5dc2b1
commit 7466575120
2 changed files with 12 additions and 8 deletions

View File

@@ -66,8 +66,7 @@
- Config: expand `~` in `CLAWDBOT_CONFIG_PATH` and common path-like config fields (including `plugins.load.paths`); guard invalid `$include` paths. (#731) — thanks @pasogott. - Config: expand `~` in `CLAWDBOT_CONFIG_PATH` and common path-like config fields (including `plugins.load.paths`); guard invalid `$include` paths. (#731) — thanks @pasogott.
- Agents: stop pre-creating session transcripts so first user messages persist in JSONL history. - Agents: stop pre-creating session transcripts so first user messages persist in JSONL history.
- Agents: skip pre-compaction memory flush when the session workspace is read-only. - Agents: skip pre-compaction memory flush when the session workspace is read-only.
- Models: normalize Gemini 3 Pro/Flash IDs to preview names for live model lookups. (#769) — thanks @steipete. - Auto-reply: ignore inline `/status` directives unless the message is directive-only.
- CLI: fix guardCancel typing for configure prompts. (#769) — thanks @steipete.
- Auto-reply: align `/think` default display with model reasoning defaults. (#751) — thanks @gabriel-trigo. - Auto-reply: align `/think` default display with model reasoning defaults. (#751) — thanks @gabriel-trigo.
- Auto-reply: flush block reply buffers on tool boundaries. (#750) — thanks @sebslight. - Auto-reply: flush block reply buffers on tool boundaries. (#750) — thanks @sebslight.
- Auto-reply: allow sender fallback for command authorization when `SenderId` is empty (WhatsApp self-chat). (#755) — thanks @juanpablodlc. - Auto-reply: allow sender fallback for command authorization when `SenderId` is empty (WhatsApp self-chat). (#755) — thanks @juanpablodlc.

View File

@@ -64,6 +64,7 @@ import {
persistInlineDirectives, persistInlineDirectives,
resolveDefaultModel, resolveDefaultModel,
} from "./reply/directive-handling.js"; } from "./reply/directive-handling.js";
import { extractStatusDirective } from "./reply/directives.js";
import { import {
buildGroupIntro, buildGroupIntro,
defaultGroupActivation, defaultGroupActivation,
@@ -489,8 +490,16 @@ export async function getReplyFromConfig(
.filter((alias) => !reservedCommands.has(alias.toLowerCase())); .filter((alias) => !reservedCommands.has(alias.toLowerCase()));
let parsedDirectives = parseInlineDirectives(commandSource, { let parsedDirectives = parseInlineDirectives(commandSource, {
modelAliases: configuredAliases, modelAliases: configuredAliases,
allowStatusDirective: command.isAuthorizedSender,
}); });
const hasInlineStatus =
parsedDirectives.hasStatusDirective &&
parsedDirectives.cleaned.trim().length > 0;
if (hasInlineStatus) {
parsedDirectives = {
...parsedDirectives,
hasStatusDirective: false,
};
}
if ( if (
isGroup && isGroup &&
ctx.WasMentioned !== true && ctx.WasMentioned !== true &&
@@ -520,7 +529,6 @@ export async function getReplyFromConfig(
if (noMentions.trim().length > 0) { if (noMentions.trim().length > 0) {
const directiveOnlyCheck = parseInlineDirectives(noMentions, { const directiveOnlyCheck = parseInlineDirectives(noMentions, {
modelAliases: configuredAliases, modelAliases: configuredAliases,
allowStatusDirective: command.isAuthorizedSender,
}); });
if (directiveOnlyCheck.cleaned.trim().length > 0) { if (directiveOnlyCheck.cleaned.trim().length > 0) {
const allowInlineStatus = const allowInlineStatus =
@@ -554,7 +562,6 @@ export async function getReplyFromConfig(
if (!sessionCtx.CommandBody && !sessionCtx.RawBody) { if (!sessionCtx.CommandBody && !sessionCtx.RawBody) {
return parseInlineDirectives(existingBody, { return parseInlineDirectives(existingBody, {
modelAliases: configuredAliases, modelAliases: configuredAliases,
allowStatusDirective: command.isAuthorizedSender,
}).cleaned; }).cleaned;
} }
@@ -562,7 +569,6 @@ export async function getReplyFromConfig(
if (markerIndex < 0) { if (markerIndex < 0) {
return parseInlineDirectives(existingBody, { return parseInlineDirectives(existingBody, {
modelAliases: configuredAliases, modelAliases: configuredAliases,
allowStatusDirective: command.isAuthorizedSender,
}).cleaned; }).cleaned;
} }
@@ -575,7 +581,6 @@ export async function getReplyFromConfig(
); );
const cleanedTail = parseInlineDirectives(tail, { const cleanedTail = parseInlineDirectives(tail, {
modelAliases: configuredAliases, modelAliases: configuredAliases,
allowStatusDirective: command.isAuthorizedSender,
}).cleaned; }).cleaned;
return `${head}${cleanedTail}`; return `${head}${cleanedTail}`;
})(); })();
@@ -697,7 +702,7 @@ export async function getReplyFromConfig(
: directives.rawModelDirective; : directives.rawModelDirective;
if (!command.isAuthorizedSender) { if (!command.isAuthorizedSender) {
cleanedBody = existingBody; cleanedBody = extractStatusDirective(existingBody).cleaned;
sessionCtx.Body = cleanedBody; sessionCtx.Body = cleanedBody;
sessionCtx.BodyStripped = cleanedBody; sessionCtx.BodyStripped = cleanedBody;
directives = { directives = {