fix(whatsapp): suppress typing during heartbeats

- Prevent typing indicator during heartbeat runs
- Add regression tests

Co-authored-by: Jake <mcinteerj@gmail.com>
This commit is contained in:
Jake
2026-01-05 12:03:36 +13:00
committed by GitHub
parent 4dd515b65f
commit 946b32c842
5 changed files with 286 additions and 9 deletions

View File

@@ -467,7 +467,8 @@ export async function getReplyFromConfig(
const isFirstTurnInSession = isNewSession || !systemSent;
const isGroupChat = sessionCtx.ChatType === "group";
const wasMentioned = ctx.WasMentioned === true;
const shouldEagerType = !isGroupChat || wasMentioned;
const isHeartbeat = opts?.isHeartbeat === true;
const shouldEagerType = (!isGroupChat || wasMentioned) && !isHeartbeat;
const shouldInjectGroupIntro = Boolean(
isGroupChat &&
(isFirstTurnInSession || sessionEntry?.groupActivationNeedsSystemIntro),