Skip to content

fix: keep Telegram chunk markers outside code fences - #48517

Closed
whoislikemiha wants to merge 1 commit into
NousResearch:mainfrom
whoislikemiha:fix/telegram-stream-markdown-chunking
Closed

fix: keep Telegram chunk markers outside code fences#48517
whoislikemiha wants to merge 1 commit into
NousResearch:mainfrom
whoislikemiha:fix/telegram-stream-markdown-chunking

Conversation

@whoislikemiha

Copy link
Copy Markdown
Contributor

Summary

  • move Telegram chunk indicators off closing fenced-code lines before sending MarkdownV2
  • apply the same repair to legacy send chunks and overflow finalization chunks
  • add a regression test for long streamed/legacy Telegram replies with fenced code blocks

Test Plan

  • uv run --with pytest --with pytest-asyncio python -m pytest tests/gateway/test_telegram_format.py::test_legacy_send_keeps_chunk_indicators_outside_fenced_code_lines -q
  • uv run --with pytest --with pytest-asyncio python -m pytest tests/gateway/test_telegram_format.py tests/gateway/test_telegram_overflow_partial.py tests/gateway/test_telegram_rich_messages.py -q

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants