fix: platform base extract_images and truncate_message bugs - #200
Merged
teknium1 merged 1 commit intoMar 5, 2026
Merged
Conversation
- extract_images: only remove extracted image tags from content, preserve non-image markdown links (e.g. PDFs) that were previously silently lost - truncate_message: walk only chunk_body (not prepended prefix) so the reopened code fence does not toggle in_code off, leaving continuation chunks with unclosed code blocks - Add 49 unit tests covering MessageEvent command parsing, extract_images, extract_media, truncate_message code block handling, and _get_human_delay
Contributor
|
Merged in commit 4fcfa32. Both fixes verified — extract_images now preserves non-image markdown links, and truncate_message correctly tracks code block state across chunks. All 1529 tests pass including 49 new ones. Nice catches! 🙏 |
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…gs in platform base Authored by 0xbyt4. Two fixes: - extract_images(): only remove extracted image tags, not all markdown image tags. Previously  was silently dropped when real images were also present. - truncate_message(): walk chunk_body not full_chunk when tracking code block state, so the reopened fence prefix doesn't toggle in_code off and leave continuation chunks with unclosed code blocks.
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…gs in platform base Authored by 0xbyt4. Two fixes: - extract_images(): only remove extracted image tags, not all markdown image tags. Previously  was silently dropped when real images were also present. - truncate_message(): walk chunk_body not full_chunk when tracking code block state, so the reopened fence prefix doesn't toggle in_code off and leave continuation chunks with unclosed code blocks.
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
which were silently lost.chunk_body(not the prepended reopening prefix) when tracking code block state. The reopened fence (\``python) was being counted by the line-walking loop, togglingin_code` off and leaving continuation chunks with unclosed code blocks.Test plan
is_command,get_command,get_command_argsextract_images: markdown/HTML patterns, CDN URLs, non-image preservation (regression)extract_media: MEDIA tags,[[audio_as_voice]]directivetruncate_message: splitting, chunk indicators, code block fence balancing (regression)_get_human_delay: off/natural/custom modes