hermes - ✅(Solved) Fix [Bug]: (cli)(windows)Path completion failed if target path is in a different drive [1 pull requests]

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…

Error Message

Unhandled exception in event loop: File "C:\Users*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\buffer.py", line 1923, in new_coroutine await coroutine(*a, **kw) File "C:\Users*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\buffer.py", line 1740, in async_completer async for completion in async_generator: ...<12 lines>... break File "C:\Users*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\completion\base.py", line 310, in get_completions_async async for completion in completer.get_completions_async( ...<2 lines>... yield completion File "C:\Users*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\completion\base.py", line 186, in get_completions_async for item in self.get_completions(document, complete_event): ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\Downloads\hermes-agent\hermes_cli\commands.py", line 1184, in get_completions yield from self._context_completions(ctx_word) File "C:\Users*\Downloads\hermes-agent\hermes_cli\commands.py", line 953, in _context_completions display_path = os.path.relpath(full_path) File "<frozen ntpath>", line 763, in relpath

Exception path is on mount 'C:', start on mount 'E:' Press ENTER to continue...

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #12802: fix(windows): display path calculation for cross-drive scenarios

Description (problem / solution / changelog)

Handle ValueError for relative path on Windows when the current folder is on a different drive; Use OS native path separator instead of hard coded '/'.

What does this PR do?

<!-- Describe the change clearly. What problem does it solve? Why is this approach the right one? -->

Fix relative path calculation that failed on Windows.

Related Issue

<!-- Link the issue this PR addresses. If no issue exists, consider creating one first. -->

Fixes #13261

Type of Change

<!-- Check the one that applies. -->
  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

<!-- List the specific changes. Include file paths for code changes. -->

Catch exception on Windows relative path failure.

Use OS-native path separator.

How to Test

<!-- Steps to verify this change works. For bugs: reproduction steps + proof that the fix works. -->
  1. Start hermes on Drive E
  2. try to auto complet with @folder:C: or @file:C:, where the current folder is different from target folder.

Checklist

<!-- Complete these before requesting review. -->

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: <!-- e.g. Ubuntu 24.04, macOS 15.2, Windows 11 -->

Documentation & Housekeeping

<!-- Check all that apply. It's OK to check "N/A" if a category doesn't apply to your change. -->
  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

<!-- Only fill this out if you're adding a skill. Delete this section otherwise. -->
  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

<!-- If applicable, add screenshots or log output showing the fix/feature in action. -->

Changed files

  • hermes_cli/commands.py (modified, +8/-2)

Code Example

Report     https://paste.rs/CEzLc
  agent.log  https://paste.rs/iMUbm

---

Unhandled exception in event loop:
  File "C:\Users\*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\buffer.py", line 1923, in new_coroutine
    await coroutine(*a, **kw)
  File "C:\Users\*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\buffer.py", line 1740, in async_completer
    async for completion in async_generator:
    ...<12 lines>...
            break
  File "C:\Users\*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\completion\base.py", line 310, in get_completions_async
    async for completion in completer.get_completions_async(
    ...<2 lines>...
        yield completion
  File "C:\Users\*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\completion\base.py", line 186, in get_completions_async
    for item in self.get_completions(document, complete_event):
                ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\*\Downloads\hermes-agent\hermes_cli\commands.py", line 1184, in get_completions
    yield from self._context_completions(ctx_word)
  File "C:\Users\*\Downloads\hermes-agent\hermes_cli\commands.py", line 953, in _context_completions
    display_path = os.path.relpath(full_path)
  File "<frozen ntpath>", line 763, in relpath

Exception path is on mount 'C:', start on mount 'E:'
Press ENTER to continue...
RAW_BUFFERClick to expand / collapse

Bug Description

@folder: or @file: should autocomplete paths in windows

Steps to Reproduce

1 run hermes 2 type @folder: or @file: with an absolute path starting with drive letter other than current drive.

Expected Behavior

path auto completion works

Actual Behavior

Python exception raised

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report     https://paste.rs/CEzLc
  agent.log  https://paste.rs/iMUbm

Operating System

Windows 10

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Unhandled exception in event loop:
  File "C:\Users\*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\buffer.py", line 1923, in new_coroutine
    await coroutine(*a, **kw)
  File "C:\Users\*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\buffer.py", line 1740, in async_completer
    async for completion in async_generator:
    ...<12 lines>...
            break
  File "C:\Users\*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\completion\base.py", line 310, in get_completions_async
    async for completion in completer.get_completions_async(
    ...<2 lines>...
        yield completion
  File "C:\Users\*\Downloads\hermes-agent\venv\Lib\site-packages\prompt_toolkit\completion\base.py", line 186, in get_completions_async
    for item in self.get_completions(document, complete_event):
                ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\*\Downloads\hermes-agent\hermes_cli\commands.py", line 1184, in get_completions
    yield from self._context_completions(ctx_word)
  File "C:\Users\*\Downloads\hermes-agent\hermes_cli\commands.py", line 953, in _context_completions
    display_path = os.path.relpath(full_path)
  File "<frozen ntpath>", line 763, in relpath

Exception path is on mount 'C:', start on mount 'E:'
Press ENTER to continue...

Root Cause Analysis (optional)

os.path.relpath(tar_path) would raise ValueError if the drive is different from current drive in Windows

Proposed Fix (optional)

fix relative path call. see #12802

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The issue can be fixed by modifying the os.path.relpath call to handle different drive letters in Windows.

Guidance

  • The error occurs because os.path.relpath raises a ValueError when the drive letter of the target path is different from the current drive.
  • To fix this, the relpath call needs to be modified to handle this case, possibly by using a different method to calculate the relative path.
  • The proposed fix is to update the os.path.relpath call as mentioned in issue #12802.
  • Verify the fix by running the same steps to reproduce and checking if the path auto-completion works as expected.

Example

No code snippet is provided as the exact fix is not specified, but it would involve modifying the get_completions method in hermes_cli\commands.py to handle the relpath call correctly.

Notes

The fix may not be applicable if the hermes-agent version or Python version is different from the ones used in the issue.

Recommendation

Apply workaround: Modify the os.path.relpath call to handle different drive letters in Windows, as proposed in issue #12802, to fix the path auto-completion issue.

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]: (cli)(windows)Path completion failed if target path is in a different drive [1 pull requests]