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:
committed by
Peter Steinberger
parent
dc3e3f27d4
commit
a6a550032a
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user