feat: streaming drafts, rich formatting, follow-up interrupts, and UX improvements#152
Open
Fr4nzz wants to merge 2 commits intoRichardAtCT:mainfrom
Open
feat: streaming drafts, rich formatting, follow-up interrupts, and UX improvements#152Fr4nzz wants to merge 2 commits intoRichardAtCT:mainfrom
Fr4nzz wants to merge 2 commits intoRichardAtCT:mainfrom
Conversation
… improvements Major improvements to the Telegram bot UX: **Streaming draft responses** - Real-time token streaming via sendMessageDraft (private chats) - Falls back to editMessageText for group chats - Draft cleared before final response to prevent stale bubbles - Draft text reset after each 💬 message to avoid accumulation **Rich HTML formatting** - Parse Claude's markdown into Telegram HTML (bold, italic, code, links) - Smart message splitting for long responses - Proper escaping of HTML entities **Follow-up message interrupts** - Send a new message while Claude is working to interrupt and redirect - Like vanilla Claude Code's behavior **Per-event verbose messages** - Tool calls, thinking, and assistant text shown as individual messages - Configurable verbosity (0=quiet, 1=normal, 2=detailed) - Progress timer shows elapsed seconds **Image sending via MCP** - Intercept send_file_to_user MCP tool calls - Validate image paths (approved directory + /tmp for Playwright screenshots) - Send as Telegram photos with optional captions **SDK integration improvements** - Use setting_sources=["project"] to avoid plugin MCP conflicts - Support SSE-based MCP servers (persistent Playwright) - Improved error handling and stderr capture **Other** - Keep progress messages visible after response - Telegram MCP server improvements (file sending, better error handling) - Updated tests for image path validation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move 🧠 thinking and 💬 assistant text processing BEFORE tool calls so messages appear in chronological order (💬 before 💻/✏️) - Remove draft_streamer.clear() calls that caused "Deleted message" ghost and empty [] messages — upstream never clears drafts, the bubble disappears naturally when the final message arrives - Only use the LAST AssistantMessage text for the final response, preventing intermediate reasoning from being repeated at the end Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sendMessageDraft— real-time token streaming in private chats with fallback toeditMessageTextfor groups. Draft cleared before final response to prevent stale bubbles; draft text reset after each 💬 message to avoid accumulationsend_file_to_usertool calls, validate paths, send as Telegram photossetting_sources=["project"]to avoid plugin MCP conflicts, support SSE-based MCP serversTest plan
/verbose 0,/verbose 1,/verbose 2— verify output levelssend_file_to_userpytest tests/unit/ -o "addopts="— all tests pass🤖 Generated with Claude Code