fix(gateway): stop MEDIA tag regex from absorbing following tag or text (#68773) - #68837
Closed
webtecnica wants to merge 2 commits into
Closed
fix(gateway): stop MEDIA tag regex from absorbing following tag or text (#68773)#68837webtecnica wants to merge 2 commits into
webtecnica wants to merge 2 commits into
Conversation
Collaborator
Previously _count_skills() only counted SKILL.md files inside the profile's own skills/ directory, making the WebUI profile card show a misleading low count (e.g. 0 for 'default', 30 for 'webtecnica') even though the profile loaded 150+ skills from global + external dirs. Now it scans three sources: 1. Profile-specific skills/ dir (as before) 2. Global ~/.hermes/skills/ dir (via get_default_hermes_root) 3. External dirs from skills.external_dirs config Deduplication by skill name (from YAML frontmatter) prevents double- counting when the same skill exists in both global and profile dirs, matching how scan_skill_commands() loads skills at runtime. The cache is updated to key on all scanned directories and track their combined mtime signatures.
…xt (NousResearch#68773) Two MEDIA: path tags emitted back-to-back without a separator merged into a single invalid path and were silently dropped. The same happened for extension-less tags. Root cause: both regexes in gateway/platforms/base.py used greedy quantifiers in their path class, causing adjacent tags to be absorbed. Fix: make both regexes non-greedy (add ? to quantifiers) and add MEDIA: to the trailing lookahead boundary set so the next MEDIA: keyword stops the current match cleanly.
webtecnica
force-pushed
the
fix/68773-media-tag-separator
branch
from
July 21, 2026 23:36
9f85f82 to
49e0698
Compare
Contributor
|
Merged via PR #72170 (rebase-merge) — your commit was cherry-picked onto current main with your authorship preserved in git history. Thanks for the fix! PR #72170 consolidated six open MEDIA-delivery fixes (formatting-variant regex misses + the Discord upload race) into one salvage wave so the overlapping regex changes could be resolved together. |
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.
Closes #68773
Problem
MEDIA_TAG_CLEANUP_RE regex requires a separator (space, newline, end) after file extension via lookahead. When there's no separator (e.g. two MEDIA tags back-to-back or tag followed by text), the regex fails — media delivery silently fails and spurious truncation detection occurs.
Fix
Adjusted the lookahead boundary to also accept
MEDIA:as a valid follow boundary, so back-to-back tags and tag+text both match correctly.Tests