Typing: keep indicators active during tool runs

Closes #450
Closes #447
This commit is contained in:
Shadow
2026-01-12 22:20:29 -06:00
parent e15d5d0533
commit da95b58a2a
4 changed files with 10 additions and 5 deletions

View File

@@ -704,7 +704,7 @@ export async function runReplyAgent(params: {
if (evt.stream === "tool") {
const phase =
typeof evt.data.phase === "string" ? evt.data.phase : "";
if (phase === "start") {
if (phase === "start" || phase === "update") {
void typingSignals.signalToolStart();
}
}

View File

@@ -123,7 +123,7 @@ describe("createTypingSignaler", () => {
expect(typing.startTypingOnText).not.toHaveBeenCalled();
});
it("does not start typing on tool start when inactive", async () => {
it("starts typing on tool start when inactive", async () => {
const typing = createMockTypingController();
const signaler = createTypingSignaler({
typing,
@@ -133,8 +133,8 @@ describe("createTypingSignaler", () => {
await signaler.signalToolStart();
expect(typing.refreshTypingTtl).not.toHaveBeenCalled();
expect(typing.startTypingLoop).not.toHaveBeenCalled();
expect(typing.startTypingLoop).toHaveBeenCalled();
expect(typing.refreshTypingTtl).toHaveBeenCalled();
});
it("refreshes ttl on tool start when active", async () => {

View File

@@ -68,7 +68,11 @@ export function createTypingSignaler(params: {
const signalToolStart = async () => {
if (disabled) return;
if (!typing.isActive()) return;
if (!typing.isActive()) {
await typing.startTypingLoop();
typing.refreshTypingTtl();
return;
}
// Keep typing indicator alive during tool execution without changing mode semantics.
typing.refreshTypingTtl();
};