channels: mid-turn inbound injected into TUI input box instead of queuing as discrete turn

Resolved 💬 2 comments Opened Jun 9, 2026 by lester2684 Closed Jun 12, 2026

Summary

When a message arrives on a --channels channel (e.g. Telegram) while the Claude session is mid-turn, the channel plugin injects the text directly into the Claude Code TUI input box (❯ <text>) rather than queueing it as its own discrete turn.

Reproduction

  1. Start a session with claude --channels telegram (or any channel plugin).
  2. Trigger a multi-step tool-use turn (so the session is mid-turn for several seconds).
  3. Send a message on the channel while the turn is in progress.

Observed behaviour

  • The arriving message text appears in the input box (❯ <text>).
  • When the in-flight turn ends, the buffered text often does not auto-submit — the box is jammed.
  • While jammed, subsequent inbound messages pile up behind it.
  • The session is effectively deaf to further channel input until the box is manually cleared (e.g. receiver restart).

Expected behaviour

  • Each inbound channel message is delivered as its own turn, via the channel/turn queue, regardless of whether another turn is currently executing.
  • The interactive input box is never used as a buffer for channel-sourced messages.

Impact

  • For always-on relay sessions (Telegram concierge, Slack bot, etc.), this silently drops messages and jams the session without any monitoring signal — indistinguishable from a healthy session by passive PID/heartbeat checks.
  • Recovery requires a full receiver restart (clears the input box, but loses the buffered message since the Telegram offset was already advanced).

Additional data (2026-06-09)

  • Reproduced twice in the same session (same day).
  • A keystroke-injection workaround (tmux send-keys -l) would submit the text, but the Claude Code auto-mode classifier correctly blocks an agent from injecting/submitting into the live founder-facing relay (impersonation guard). So no in-process recovery path exists.
  • Only reliable recovery: full receiver restart.

Environment

  • Platform: macOS Darwin 24.6.0
  • Channel: Telegram (--channels telegram)
  • Session mode: --dangerously-skip-permissions (auto-mode bypass)

Linked

  • Internal tracking: lester2684/company-os#56 (OPS-275)
  • Related: lester2684/company-os#49 (OPS-268 — MCP binding drop detection; shares the --channels surface)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗