Fix Telegram formatting: avoid tables, use code blocks for commands#54
Merged
Conversation
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.
Problem
Problem 1: Telegram does not render Markdown or ASCII tables properly. When the agent includes tabular data in a response the result is a garbled wall of text.
Problem 2: Commands and code snippets like
run_command: gh issue create --repo ...are sent as plain text, making them hard to distinguish from the surrounding message.Changes
Prompt-level instructions (all character definitions)
character.md.examplewith three rules:#heading syntaxpersonae/coding-helper.mdpersonae/finance-assistant.mdpersonae/fitness-coach.mdpersonae/language-tutor.mdpersonae/travel-planner.mdpersonae/writing-editor.mdPost-processing safety net (
channels/markdown_tg.py)_strip_tables()— a belt-and-suspenders function that detects ASCII/Markdown tables (pipe-delimited rows with a---|---separator line) and converts them to bullet lists before renderingto_telegram_html()so tables are neutralised even if the prompt instruction is missedTests
Closes #51