fix: adjust typing TTL

This commit is contained in:
Peter Steinberger
2026-01-04 00:26:29 +00:00
parent 53d954695e
commit a1780efb9f
2 changed files with 7 additions and 2 deletions

View File

@@ -26,6 +26,7 @@
- CI: consolidate checks to avoid redundant installs (#144) — thanks @thewilloftheshadow.
- WhatsApp: support `gifPlayback` for MP4 GIF sends via CLI/gateway.
- Auto-reply: drop final payloads when block streaming to avoid duplicate Discord sends.
- Auto-reply: fix typing TTL to 2 minutes and log TTL with s/m units.
- Bash tool: default auto-background delay to 10s.
- Telegram: chunk block-stream replies to avoid “message is too long” errors (#124) — thanks @mukhtharcm.
- Block streaming: default to text_end and suppress duplicate block sends while in-flight.

View File

@@ -833,7 +833,11 @@ export async function getReplyFromConfig(
const typingIntervalSeconds =
typeof configuredTypingSeconds === "number" ? configuredTypingSeconds : 6;
const typingIntervalMs = typingIntervalSeconds * 1000;
const typingTtlMs = Math.min(Math.max(15_000, typingIntervalMs * 5), 60_000);
const typingTtlMs = 2 * 60_000;
const formatTypingTtl = (ms: number) => {
if (ms % 60_000 === 0) return `${ms / 60_000}m`;
return `${Math.round(ms / 1000)}s`;
};
const cleanupTyping = () => {
if (typingTtlTimer) {
clearTimeout(typingTtlTimer);
@@ -854,7 +858,7 @@ export async function getReplyFromConfig(
typingTtlTimer = setTimeout(() => {
if (!typingTimer) return;
defaultRuntime.log(
`typing TTL reached (${typingTtlMs}ms); stopping typing indicator`,
`typing TTL reached (${formatTypingTtl(typingTtlMs)}); stopping typing indicator`,
);
cleanupTyping();
}, typingTtlMs);