Typing: keep indicators active during tool runs
Closes #450 Closes #447
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user