fix(typing): keep tool-start ttl mode-safe (#452, thanks @thesash)

This commit is contained in:
Peter Steinberger
2026-01-08 06:18:11 +00:00
parent 29c5ed54b2
commit 6a81652ebf
6 changed files with 45 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ export type TypingController = {
startTypingLoop: () => Promise<void>;
startTypingOnText: (text?: string) => Promise<void>;
refreshTypingTtl: () => void;
isActive: () => boolean;
markRunComplete: () => void;
markDispatchIdle: () => void;
cleanup: () => void;
@@ -76,6 +77,8 @@ export function createTypingController(params: {
}, typingTtlMs);
};
const isActive = () => active && !sealed;
const triggerTyping = async () => {
if (sealed) return;
await onReplyStart?.();
@@ -138,6 +141,7 @@ export function createTypingController(params: {
startTypingLoop,
startTypingOnText,
refreshTypingTtl,
isActive,
markRunComplete,
markDispatchIdle,
cleanup,