refactor: unify typing policy across services
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) =>
|
||||
|
||||
@@ -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<void> {
|
||||
this.resetIdleTimer();
|
||||
if (this.options.deferTypingUntilVisible) {
|
||||
return;
|
||||
}
|
||||
await this.activateTyping('turn:start');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user