fix: bound rendered telegram chunks - #970
Merged
aaronjmars merged 1 commit intoAug 27, 2026
Merged
Conversation
Collaborator
|
Thanks for this - the chunker itself is genuinely correct (fuzzed it: 0 tag imbalances, entities intact,
To justify merging, could you show an actual Telegram API rejection from the current code, and address the UTF-16 case? Otherwise I'll lean toward closing this. Appreciate the thoroughness either way. |
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.
What
Bound Telegram notification chunks after Markdown has been rendered to HTML, while keeping every emitted chunk's HTML tags balanced.
Why
The existing path split the Markdown first and rendered each chunk afterward. HTML escaping and anchor tags can expand a source chunk beyond the formatter's 3,900-character Telegram limit.
Using the current upstream code with 300 valid Markdown links reproduced rendered chunks of 4,521, 4,488, and 4,381 characters. A skill controls its notification Markdown and can therefore produce an oversized Telegram payload that the delivery path cannot send successfully.
Fix
[i/N]footer.Verification
python3 scripts/tests/test_notify_format.py— 26/26 passed.bash scripts/tests/test_notify.sh— all notification integration checks passed.python3 -m py_compile scripts/notify_format.py scripts/tests/test_notify_format.py— passed.git diff --check— passed.Mutation test, performed by reverting only the source fix while keeping the regression test:
Restoring the source fix returned the full formatter and notification integration suites to green. The additional generated-input stress check was local-only and is not presented as committed test coverage.