hermes - ✅(Solved) Fix Bug: Backslash before dot in Windows path gets stripped in message rendering [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#16458Fetched 2026-04-28 06:53:12
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×3cross-referenced ×2commented ×1

When user inputs a Windows path containing \., the backslash before the dot disappears. For example, D:\\Projects\\SourceCode\\hermes-agent\\.ai\\skills\\ renders as hermes-agent.ai\\skills.

Root Cause

When user inputs a Windows path containing \., the backslash before the dot disappears. For example, D:\\Projects\\SourceCode\\hermes-agent\\.ai\\skills\\ renders as hermes-agent.ai\\skills.

Fix Action

Fixed

PR fix notes

PR #16543: fix(cli): preserve Windows hidden-dir paths in markdown

Description (problem / solution / changelog)

Summary

  • protect Windows path tokens like D:\repo\.ai\skills\ before Rich Markdown rendering so CommonMark does not treat \. as an escaped dot
  • keep normal non-path Markdown escapes such as 1\. unchanged
  • add CLI markdown rendering regression coverage for both cases

Fixes #16458

Verification

  • python -m py_compile cli.py
  • python -m pytest tests/cli/test_cli_markdown_rendering.py -q -n 0 --basetemp .pytest_tmp_issue_16458 -p no:cacheprovider

Changed files

  • cli.py (modified, +23/-0)
  • tests/cli/test_cli_markdown_rendering.py (modified, +17/-0)

PR #16595: fix(gateway): preserve backslash before dot in Telegram MarkdownV2 cleanup

Description (problem / solution / changelog)

Fixes NousResearch/hermes-agent#16458

Problem

Windows paths containing \. (backslash before dot) are incorrectly stripped to just . in Telegram message rendering. For example, D:\Projects\.ai\skills\ renders as D:\Projects.ai\skills\.

Root Cause

The _strip_md2_escapes regex in telegram.py includes . in its character class for backslash-escape removal. Since . is not a MarkdownV2 formatting character (it doesn't produce any visible formatting), including it causes false matches on Windows paths.

Fix

Removed . from the character class in the escape-stripping regex. This preserves backslash-dot sequences in Windows paths while still correctly stripping escapes for actual MarkdownV2 formatting characters (_, *, [, ], etc.).

Files Changed

  • gateway/platforms/telegram.py — 3 lines changed (regex character class + comment)

Changed files

  • gateway/platforms/telegram.py (modified, +5/-2)
RAW_BUFFERClick to expand / collapse

Description

When user inputs a Windows path containing \., the backslash before the dot disappears. For example, D:\\Projects\\SourceCode\\hermes-agent\\.ai\\skills\\ renders as hermes-agent.ai\\skills.

Steps to Reproduce

  1. Send a message in Hermes Agent CLI or supported chat platform
  2. Include a Windows path with \. in the message
  3. Observe the output - the backslash before . vanishes

Expected Behavior

Path \. should be preserved as-is, without losing the backslash character.

Actual Behavior

\. gets interpreted/rendered as ., backslash is lost. Likely being treated as an escape sequence somewhere in the message pipeline (input parsing, JSON serialization, or terminal rendering layer).

Environment

  • Platform: CLI (WSL)
  • Model: deepseek-v4-pro
  • Hermes Agent: latest version

Possible Cause

\. is interpreted as escape sequence \. -> . in string processing. Could occur during JSON serialization or terminal output rendering.

Note

The path is correct when typed by the user, but the backslash vanishes when echoed/rendered back. This is a display-layer bug, not filesystem.

extent analysis

TL;DR

The issue can be fixed by properly escaping the backslash in the Windows path to prevent it from being interpreted as an escape sequence.

Guidance

  • Verify if the issue occurs during JSON serialization by checking the serialized output for the path before it is rendered.
  • Check the terminal rendering layer to see if it is interpreting the backslash as an escape sequence and if there are any options to disable this behavior.
  • Consider using a different method to render the path, such as using a raw string or a dedicated path rendering function.
  • Test if the issue occurs with other special characters or sequences to determine if it is a specific problem with the backslash or a more general issue.

Example

import json

# Example of how to properly escape a backslash in a Windows path
path = "D:\\\\Projects\\\\SourceCode\\\\hermes-agent\\\\.ai\\\\skills\\\\"
print(json.dumps(path))  # Should print the path with the backslash preserved

Notes

The issue seems to be related to the interpretation of the backslash as an escape sequence, but the exact cause and solution may depend on the specific implementation of the JSON serialization and terminal rendering layers.

Recommendation

Apply a workaround by properly escaping the backslash in the Windows path, as this is a display-layer bug and not a filesystem issue. This can be done by replacing each backslash with a double backslash (\\) before rendering the path.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix Bug: Backslash before dot in Windows path gets stripped in message rendering [2 pull requests, 1 comments, 2 participants]