anthropics / anthropics/claude-plugins-official

telegram channel: injected messages paste into the input but are not submitted (sit as an unsubmitted draft on headless sessions)

オープン
#3,203 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
36.3k
フォーク
4.1k
平均マージ
2日 14時間
マージ済み PR(30日)
539

説明

## Summary

When the Telegram channel plugin (`external_plugins/telegram`, v0.0.6) receives an inbound message, the message is **pasted into the Claude Code input buffer but is not submitted** — no Enter is sent. On an **interactive** session a human just presses Enter, so it's invisible. But on a **headless / remote-driven** session (no human at the TUI — e.g. an agent driven entirely over Telegram in tmux), the message sits as an **unsubmitted draft in the prompt indefinitely**, and the agent silently stalls until something external presses Enter.

This appears to be a **broader channel-inject behavior** (the `mcp.notification('notifications/claude/channel')` path pastes content into the input but does not request a submit), so it likely affects other channel plugins too — but Telegram is where we hit it hardest because we run Telegram-driven agents headless.

## Repro

1. Run a Claude Code session headless in tmux with the Telegram channel loaded (`--channels plugin:telegram@claude-plugins-official`), no human typing at the TUI.
2. From an allow-listed chat, DM the bot.
3. Observe: the message text appears after the `❯` prompt marker (pasted into the input buffer) but is **never submitted** — the agent does not process it.
4. It stays parked until an Enter keystroke is delivered externally (e.g. `tmux send-keys Enter`, or a watchdog).

Notably, on these parked drafts a plain `Enter` sometimes does **not** submit (the content behaves like a pending-paste overlay); a clear-line + retype + Enter reliably submits.

## Impact

Headless/remote agents driven over Telegram stall on **every** inbound message — each reply from the operator does nothing until externally unstuck. For unattended/always-on agents this is a silent hang.

## Workaround we use

In our own (separate) channel plugin we added a post-inject auto-submit: after the `notifications/claude/channel` inject, schedule a `tmux send-keys -t Enter` (short delay to let the paste settle), gated to non-interactive hosts. That reliably submits channel-injected messages without a human. The Telegram plugin has no equivalent.

## Suggested fix

Offer an **auto-submit on channel inject** for non-interactive sessions — either:
- in the plugin: send Enter (e.g. `tmux send-keys`) after the inject when running headless, or
- at the protocol level: a flag on `notifications/claude/channel` to request the host submit the injected input.

Should only fire when there is no human mid-typing (headless host), to avoid submitting a half-typed line on interactive terminals.

## Environment

- Telegram plugin: 0.0.6
- Claude Code: 2.1.186
- Host: Linux, headless (tmux), no interactive TTY user

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start with external_plugins/telegram and trace the mcp.notification('notifications/claude/channel') injection path described in the report. Reproduce the draft behavior in a headless tmux session, then verify that injected messages are submitted without interrupting typing in interactive sessions; no test file is named in the issue.

索引モデルが issue の本文から書いたものです。

評価

領域
api, cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。