feat: unify provider history context

This commit is contained in:
Peter Steinberger
2026-01-10 18:53:33 +01:00
parent 8c1d39064d
commit d41372b9d9
19 changed files with 718 additions and 80 deletions

View File

@@ -81,8 +81,10 @@ export async function tryFastAbortFromMessage(params: {
sessionKey: targetKey ?? ctx.SessionKey ?? "",
config: cfg,
});
// Use RawBody for abort detection (clean message without structural context).
const raw = stripStructuralPrefixes(ctx.RawBody ?? ctx.Body ?? "");
// Use RawBody/CommandBody for abort detection (clean message without structural context).
const raw = stripStructuralPrefixes(
ctx.CommandBody ?? ctx.RawBody ?? ctx.Body ?? "",
);
const isGroup = ctx.ChatType?.trim().toLowerCase() === "group";
const stripped = isGroup ? stripMentions(raw, ctx, cfg, agentId) : raw;
const normalized = normalizeCommandBody(stripped);