diff --git a/src/message-runtime.test.ts b/src/message-runtime.test.ts index c8c2ba2..35a5e30 100644 --- a/src/message-runtime.test.ts +++ b/src/message-runtime.test.ts @@ -1480,7 +1480,8 @@ describe('createMessageRuntime', () => { expect(result).toBe(true); expect(channel.sendMessage).not.toHaveBeenCalled(); expect(channel.sendAndTrack).not.toHaveBeenCalled(); - expect(channel.setTyping).not.toHaveBeenCalledWith(chatJid, true); + expect(channel.setTyping).toHaveBeenCalledWith(chatJid, true); + expect(channel.setTyping).toHaveBeenCalledWith(chatJid, false); }); it('promotes the last visible progress to a final message when the final output is structured silent', async () => { @@ -1577,7 +1578,7 @@ describe('createMessageRuntime', () => { } }); - it('defers typing-on until the first visible output for suppress-capable turns', async () => { + it('starts typing immediately for suppress-capable turns with visible output', async () => { const chatJid = 'group@test'; const group = makeGroup('claude-code'); const channel = makeChannel(chatJid); diff --git a/src/message-runtime.ts b/src/message-runtime.ts index b0f8200..eedfc8c 100644 --- a/src/message-runtime.ts +++ b/src/message-runtime.ts @@ -279,7 +279,6 @@ export function createMessageRuntime(deps: MessageRuntimeDeps): { isClaudeService() || isReviewService() ? createSuppressToken() : undefined; - const deferTypingUntilVisible = Boolean(suppressToken) && isClaudeService(); const turnController = new MessageTurnController({ chatJid, @@ -289,7 +288,6 @@ export function createMessageRuntime(deps: MessageRuntimeDeps): { idleTimeout: deps.idleTimeout, failureFinalText: FAILURE_FINAL_TEXT, isClaudeCodeAgent, - deferTypingUntilVisible, suppressToken, clearSession: () => deps.clearSession(group.folder), requestClose: (reason) => diff --git a/src/message-turn-controller.ts b/src/message-turn-controller.ts index 4d4c356..fc02a58 100644 --- a/src/message-turn-controller.ts +++ b/src/message-turn-controller.ts @@ -30,7 +30,6 @@ interface MessageTurnControllerOptions { idleTimeout: number; failureFinalText: string; isClaudeCodeAgent: boolean; - deferTypingUntilVisible?: boolean; suppressToken?: string; clearSession: () => void; requestClose: (reason: string) => void; @@ -83,9 +82,6 @@ export class MessageTurnController { async start(): Promise { this.resetIdleTimer(); - if (this.options.deferTypingUntilVisible) { - return; - } await this.activateTyping('turn:start'); }