Skip to content

bug(typing): main reply pipeline missing markDispatchIdle() — same pattern as #26881 but different code path #27172

@clawrl3000

Description

@clawrl3000

Bug Description

PR #26881 correctly identified that the followup runner was missing typing.markDispatchIdle() in its finally block, causing the typing indicator to persist indefinitely on Telegram.

However, the main reply pipeline has the exact same issue. After backporting #26881 to our 2026.2.24 install, the typing indicator was still getting stuck on normal inbound replies (not just followup turns).

Root Cause

The main reply function's finally block (in the compiled source, near finalizeWithFollowup) only calls:

} finally {
    blockReplyPipeline?.stop();
    typing.markRunComplete();
    // markDispatchIdle() is missing here too
}

The expectation is that markDispatchIdle() gets called by the buffered dispatcher's finally block. But if the dispatcher exits early, errors, or the reply path doesn't go through the dispatcher cleanly, the second signal never fires and the typing keepalive loop runs indefinitely — same as the followup runner bug.

Fix

Same one-liner as #26881 — add typing.markDispatchIdle() after typing.markRunComplete() in the main reply pipeline's finally block:

} finally {
    blockReplyPipeline?.stop();
    typing.markRunComplete();
    typing.markDispatchIdle(); // needed as safety net
}

This exists in the same set of dist files:

  • reply-*.js
  • subagent-registry-*.js
  • plugin-sdk/reply-*.js

Why This Matters

Adding markDispatchIdle() as a safety net in both finally blocks is harmless — maybeStopOnIdle() only runs cleanup when BOTH runComplete and dispatchIdle are true, so calling it twice is a no-op. But without it, any case where the dispatcher's finally doesn't fire leaves typing stuck.

Version

2026.2.24

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions