fix(typing): refresh TTL on every startTypingLoop call

Previously, startTypingLoop would return early if the typing timer was
already running, which meant the TTL would never get refreshed during
long tool executions. This caused the typing indicator to stop after
2 minutes even if tools were still running.

Now we refresh the TTL at the start of startTypingLoop, before the
early-return checks. This keeps typing alive during long operations.
This commit is contained in:
Sash Catanzarite authored and Peter Steinberger committed 2026-01-08 05:45:46 +01:00
1 parent dc3e3f27d4
commit a6a550032a
1 file changed
+3 -1
+3 -1
View File
@@ -102,11 +102,13 @@ export function createTypingController(params: {
const startTypingLoop = async () => {
if (sealed) return;
if (runComplete) return;
// Always refresh TTL when called, even if loop already running.
// This keeps typing alive during long tool executions.
refreshTypingTtl();
if (!onReplyStart) return;
if (typingIntervalMs <= 0) return;
if (typingTimer) return;
await ensureStart();
refreshTypingTtl();
typingTimer = setInterval(() => {
void triggerTyping();
}, typingIntervalMs);