#10746: feat: add 'deferred' typing mode to suppress typing indicator for NO_REPLY
stale
Cluster:
Messaging Platform Improvements
## Problem
In Discord group chats, when a message arrives the bot immediately shows "is typing..." even when processing messages it will ultimately ignore (responding with `NO_REPLY`). This creates annoying UX — users see the bot typing and expect a response that never comes.
## Solution
Add a new `"deferred"` typing mode that suppresses the typing indicator until the agent has confirmed it will actually reply.
### How it works
1. **Accumulates streamed text** — instead of firing typing on the first text delta, deferred mode buffers characters and checks if they could still become `NO_REPLY`
2. **Fires typing once text diverges** — as soon as the accumulated text can no longer be a prefix of the silent reply token, typing begins normally
3. **Tool execution = confirmation** — if the agent starts executing tools, that confirms real work is happening and typing fires immediately
4. **Falls back to message-mode** — after confirmation, subsequent deltas use the same behavior as `"message"` mode
### Configuration
Set `typingMode: "deferred"` at the agent or session level:
```json
{
"agents": {
"main": {
"typingMode": "deferred"
}
}
}
```
### Backwards compatibility
- Default behavior is **unchanged** — existing modes (`instant`, `message`, `thinking`, `never`) work exactly as before
- The default for group chats remains `"message"` unless explicitly configured
- Opt-in only via explicit configuration
## Changes
- `src/config/types.base.ts` — Added `"deferred"` to `TypingMode` union
- `src/config/zod-schema.agent-defaults.ts` / `zod-schema.session.ts` — Added `"deferred"` to validation schemas
- `src/auto-reply/reply/typing-mode.ts` — Implemented deferred mode logic with prefix buffering in `createTypingSignaler`
- `src/auto-reply/reply/typing-mode.deferred.test.ts` — 9 unit tests covering all deferred mode behaviors
## Test results
All existing tests pass (20/20 agent-runner typing tests + 1 typing-controller-idle test), plus 9 new deferred-mode tests.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Adds a new `TypingMode` value (`deferred`) and wires it into agent/session config Zod schemas.
- Implements deferred typing logic in `createTypingSignaler` by buffering early streamed text and only triggering typing once the output is confirmed not to be the silent reply token (`NO_REPLY`) or when tool execution starts.
- Adds a new vitest suite covering deferred-mode behaviors around prefixes, divergence, tool start, and message start.
<h3>Confidence Score: 3/5</h3>
- This PR is close to mergeable, but deferred-mode behavior around message-start signaling appears inconsistent with the intended semantics.
- Core changes are localized and tests exist, but `signalMessageStart` gating in deferred mode likely prevents typing-loop start at the intended moment (once non-silent is confirmed), making behavior deviate from the PR’s stated UX goals.
- src/auto-reply/reply/typing-mode.ts
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#6546: Reply: avoid typing before text in message mode
by aldoeliacim · 2026-02-01
81.7%
#20622: feat: add configurable typingTtlSeconds to config schema
by chungjchris · 2026-02-19
78.6%
#19816: feat(slack): add typingReaction config for DM typing indicator fall...
by dalefrieswthat · 2026-02-18
76.3%
#15864: feat: add deliverOnlyToolMessages config for clean messaging channe...
by gandalf-the-engineer · 2026-02-14
75.8%
#15467: feat(messages): add debounceMedia option for inbound debouncing
by tangcruz · 2026-02-13
73.5%
#14057: feat(telegram): add ignoreMediaTypes config to skip specific inboun...
by pavelsamoylenko · 2026-02-11
73.2%
#19917: feat(discord): allow disabling intermediate status reactions
by Gitjay11 · 2026-02-18
73.1%
#20009: fix(discord): immediately defer interactions to prevent timeouts
by Gitjay11 · 2026-02-18
72.4%
#19932: feat(agents): suppressPreToolText config + onBlockReply buffering
by Milofax · 2026-02-18
72.2%
#14274: feat: add collapseReplyPayloads to collapse multi-message replies
by Henry-Roff-AI · 2026-02-11
71.9%