fix: ignore inline status directives
This commit is contained in:
@@ -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.
|
||||
- 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.
|
||||
- Models: normalize Gemini 3 Pro/Flash IDs to preview names for live model lookups. (#769) — thanks @steipete.
|
||||
- CLI: fix guardCancel typing for configure prompts. (#769) — thanks @steipete.
|
||||
- Auto-reply: ignore inline `/status` directives unless the message is directive-only.
|
||||
- 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: allow sender fallback for command authorization when `SenderId` is empty (WhatsApp self-chat). (#755) — thanks @juanpablodlc.
|
||||
|
||||
@@ -64,6 +64,7 @@ import {
|
||||
persistInlineDirectives,
|
||||
resolveDefaultModel,
|
||||
} from "./reply/directive-handling.js";
|
||||
import { extractStatusDirective } from "./reply/directives.js";
|
||||
import {
|
||||
buildGroupIntro,
|
||||
defaultGroupActivation,
|
||||
@@ -489,8 +490,16 @@ export async function getReplyFromConfig(
|
||||
.filter((alias) => !reservedCommands.has(alias.toLowerCase()));
|
||||
let parsedDirectives = parseInlineDirectives(commandSource, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: command.isAuthorizedSender,
|
||||
});
|
||||
const hasInlineStatus =
|
||||
parsedDirectives.hasStatusDirective &&
|
||||
parsedDirectives.cleaned.trim().length > 0;
|
||||
if (hasInlineStatus) {
|
||||
parsedDirectives = {
|
||||
...parsedDirectives,
|
||||
hasStatusDirective: false,
|
||||
};
|
||||
}
|
||||
if (
|
||||
isGroup &&
|
||||
ctx.WasMentioned !== true &&
|
||||
@@ -520,7 +529,6 @@ export async function getReplyFromConfig(
|
||||
if (noMentions.trim().length > 0) {
|
||||
const directiveOnlyCheck = parseInlineDirectives(noMentions, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: command.isAuthorizedSender,
|
||||
});
|
||||
if (directiveOnlyCheck.cleaned.trim().length > 0) {
|
||||
const allowInlineStatus =
|
||||
@@ -554,7 +562,6 @@ export async function getReplyFromConfig(
|
||||
if (!sessionCtx.CommandBody && !sessionCtx.RawBody) {
|
||||
return parseInlineDirectives(existingBody, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: command.isAuthorizedSender,
|
||||
}).cleaned;
|
||||
}
|
||||
|
||||
@@ -562,7 +569,6 @@ export async function getReplyFromConfig(
|
||||
if (markerIndex < 0) {
|
||||
return parseInlineDirectives(existingBody, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: command.isAuthorizedSender,
|
||||
}).cleaned;
|
||||
}
|
||||
|
||||
@@ -575,7 +581,6 @@ export async function getReplyFromConfig(
|
||||
);
|
||||
const cleanedTail = parseInlineDirectives(tail, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: command.isAuthorizedSender,
|
||||
}).cleaned;
|
||||
return `${head}${cleanedTail}`;
|
||||
})();
|
||||
@@ -697,7 +702,7 @@ export async function getReplyFromConfig(
|
||||
: directives.rawModelDirective;
|
||||
|
||||
if (!command.isAuthorizedSender) {
|
||||
cleanedBody = existingBody;
|
||||
cleanedBody = extractStatusDirective(existingBody).cleaned;
|
||||
sessionCtx.Body = cleanedBody;
|
||||
sessionCtx.BodyStripped = cleanedBody;
|
||||
directives = {
|
||||
|
||||
Reference in New Issue
Block a user