fix(safe): escape Markdown in protocol and additional_info#234
Merged
Conversation
Telegram Markdown V1 was unable to parse messages for YEARN_MS because the unescaped underscore opened an italic entity that never closed, producing "Bad Request: can't parse entities". Routing all dev-controlled label strings through escape_markdown prevents the same class of failure for any future protocol or additional_info value containing _ * ` [ \. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
These entries were stored in checksum (mixed-case) form, but check_for_pending_transactions lowercases tx["proposer"] before doing a case-sensitive set lookup. The filter silently failed for those safes — expected-proposer txs would now alert instead of being skipped. The module docstring already specifies lowercase; this brings the new entries in line with the convention and with the existing SAM/Curation entries below. Co-Authored-By: Claude Opus 4.7 (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
YEARN_MSmultisig alerts with400 Bad Request: can't parse entitiesbecause the_in the protocol name opens an italic entity that never closes.protocolandadditional_info(both dev-controlled label strings fromsafe/addresses.py) throughescape_markdownso any_ * \[ \` chars are escaped.Why this slipped through
YEARN_MSis the only protocol inALL_SAFE_ADDRESSESwhose name contains an underscore, so the bug only triggered once that safe had a pending tx. Every multisig run has been failing every 10 minutes since the first qualifying queued tx appeared (see failing run 26330640801).Verification
Reproduced locally against Telegram's API:
Protocol: YEARN_MS):400 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 64Protocol: YEARN\_MS):200 OK, renders as plainYEARN_MStextTest plan
Monitor Safe Multisigsrun succeedsYEARN_MSrendered as plain text🤖 Generated with Claude Code