fix: render markdown bold/italic/code in Telegram messages#338
Merged
asheshgoplani merged 1 commit intoasheshgoplani:mainfrom Mar 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Telegram bridge so Conductor responses that contain simple markdown (**bold**, *italic*, `code`) render correctly in Telegram by converting them to Telegram’s HTML parse mode.
Changes:
- Added
md_to_tg_html()inconductor/bridge.pyto escape HTML-sensitive characters and convert basic markdown to Telegram HTML tags. - Applied HTML conversion +
parse_mode="HTML"to interactive Conductor replies sent viamessage.answer(...). - Applied HTML conversion +
parse_mode="HTML"to heartbeat NEED alert notifications sent viabot.send_message(...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Conductor responses use markdown formatting (**bold**, *italic*, `code`) but Telegram displays them as raw text. Add md_to_tg_html() helper that converts markdown to Telegram HTML and escapes unsafe characters. Applied to both interactive responses and heartbeat NEED: alerts.
a3b4219 to
26d8399
Compare
BestSithInEU
added a commit
to BestSithInEU/agent-deck
that referenced
this pull request
Mar 18, 2026
PR asheshgoplani#338 added markdown-to-HTML conversion for Telegram messages in conductor/bridge.py, but the embedded copy in conductor_templates.go was not updated. This meant `conductor setup` would overwrite bridge.py with the unfixed version, losing bold/italic/code rendering in Telegram. Adds md_to_tg_html() and parse_mode="HTML" to both the handle_message response path and the heartbeat Telegram notification path in the embedded template, matching the standalone bridge.py fix.
4 tasks
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
Conductor responses use markdown formatting (
**bold**,*italic*,`code`) but Telegram renders them as raw text with visible asterisks.Changes
md_to_tg_html()helper inconductor/bridge.pythat:<,>,&)**bold**→<b>bold</b>*italic*→<i>italic</i>`code`→<code>code</code>message.answer)NEED:alert notifications (bot.send_message)parse_mode="HTML"Before / After
Before:
NEED: **main** — awaiting decisionAfter: NEED: main — awaiting decision
Test plan
<,>) are escaped properly