fix(typing): start typing on reasoning deltas in thinking mode before… · openclaw/openclaw@319e41d
xialonglee
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -755,16 +755,23 @@ describe("createTypingSignaler", () => {
|
755 | 755 | expect(typing.startTypingLoop).not.toHaveBeenCalled(); |
756 | 756 | }); |
757 | 757 | |
758 | | -it("starts typing and refreshes ttl on text for thinking mode", async () => { |
| 758 | +it("starts typing on reasoning delta and refreshes ttl on text for thinking mode", async () => { |
759 | 759 | const typing = createMockTypingController(); |
760 | 760 | const signaler = createTypingSignaler({ |
761 | 761 | typing, |
762 | 762 | mode: "thinking", |
763 | 763 | isHeartbeat: false, |
764 | 764 | }); |
765 | 765 | |
| 766 | +// Reasoning delta starts the typing loop and refreshes TTL, |
| 767 | +// even before any renderable assistant text has arrived. |
766 | 768 | await signaler.signalReasoningDelta(); |
767 | | -expect(typing.startTypingLoop).not.toHaveBeenCalled(); |
| 769 | +expect(typing.startTypingLoop).toHaveBeenCalledTimes(1); |
| 770 | +expect(typing.refreshTypingTtl).toHaveBeenCalledTimes(1); |
| 771 | + |
| 772 | +// Once typing is active, text delta only refreshes TTL. |
| 773 | +(typing.isActive as ReturnType<typeof vi.fn>).mockReturnValue(true); |
| 774 | +(typing.refreshTypingTtl as ReturnType<typeof vi.fn>).mockClear(); |
768 | 775 | await signaler.signalTextDelta("hi"); |
769 | 776 | expect(typing.startTypingLoop).toHaveBeenCalledTimes(1); |
770 | 777 | expect(typing.refreshTypingTtl).toHaveBeenCalledTimes(1); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。