fix: adjust typing TTL
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
- CI: consolidate checks to avoid redundant installs (#144) — thanks @thewilloftheshadow.
|
- CI: consolidate checks to avoid redundant installs (#144) — thanks @thewilloftheshadow.
|
||||||
- WhatsApp: support `gifPlayback` for MP4 GIF sends via CLI/gateway.
|
- 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: 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.
|
- Bash tool: default auto-background delay to 10s.
|
||||||
- Telegram: chunk block-stream replies to avoid “message is too long” errors (#124) — thanks @mukhtharcm.
|
- 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.
|
- Block streaming: default to text_end and suppress duplicate block sends while in-flight.
|
||||||
|
|||||||
@@ -833,7 +833,11 @@ export async function getReplyFromConfig(
|
|||||||
const typingIntervalSeconds =
|
const typingIntervalSeconds =
|
||||||
typeof configuredTypingSeconds === "number" ? configuredTypingSeconds : 6;
|
typeof configuredTypingSeconds === "number" ? configuredTypingSeconds : 6;
|
||||||
const typingIntervalMs = typingIntervalSeconds * 1000;
|
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 = () => {
|
const cleanupTyping = () => {
|
||||||
if (typingTtlTimer) {
|
if (typingTtlTimer) {
|
||||||
clearTimeout(typingTtlTimer);
|
clearTimeout(typingTtlTimer);
|
||||||
@@ -854,7 +858,7 @@ export async function getReplyFromConfig(
|
|||||||
typingTtlTimer = setTimeout(() => {
|
typingTtlTimer = setTimeout(() => {
|
||||||
if (!typingTimer) return;
|
if (!typingTimer) return;
|
||||||
defaultRuntime.log(
|
defaultRuntime.log(
|
||||||
`typing TTL reached (${typingTtlMs}ms); stopping typing indicator`,
|
`typing TTL reached (${formatTypingTtl(typingTtlMs)}); stopping typing indicator`,
|
||||||
);
|
);
|
||||||
cleanupTyping();
|
cleanupTyping();
|
||||||
}, typingTtlMs);
|
}, typingTtlMs);
|
||||||
|
|||||||
Reference in New Issue
Block a user