hermes - 💡(How to fix) Fix terminal tool fails with `cd: hermes-agent: No such file or directory` when CWD is already the target directory

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

Any terminal tool invocation produces the error: Even simple commands like echo test123 or pwd fail with the same error. 4. The error appears even though the actual command still executes

Root Cause

The terminal tool's wrapper automatically prepends cd hermes-agent before executing commands. However:

  1. The current working directory is already ~/.hermes/hermes-agent
  2. The cd command uses a relative path (hermes-agent)
  3. This resolves to ~/.hermes/hermes-agent/hermes-agent which does not exist
  4. The error appears even though the actual command still executes

Fix Action

Workaround

Use execute_code (Python) or browser_navigate instead of terminal for now.

Code Example

$ echo "test"
/opt/homebrew/bin/bash: line 2: cd: hermes-agent: No such file or directory
RAW_BUFFERClick to expand / collapse

Bug Description

The terminal tool consistently fails with cd: hermes-agent: No such file or directory before executing any command, polluting all output.

Environment

  • OS: macOS (Darwin)
  • Shell: zsh (default on macOS)
  • Hermes Agent version: v0.13.0 (2026.5.7)
  • Working directory: ~/.hermes/hermes-agent
  • Terminal backend: local

Reproduction

Any terminal tool invocation produces the error:

$ echo "test"
/opt/homebrew/bin/bash: line 2: cd: hermes-agent: No such file or directory

Even simple commands like echo test123 or pwd fail with the same error.

Root Cause Analysis

The terminal tool's wrapper automatically prepends cd hermes-agent before executing commands. However:

  1. The current working directory is already ~/.hermes/hermes-agent
  2. The cd command uses a relative path (hermes-agent)
  3. This resolves to ~/.hermes/hermes-agent/hermes-agent which does not exist
  4. The error appears even though the actual command still executes

Verification

  • Shell configs are clean: Checked ~/.bashrc, ~/.bash_profile, ~/.profile, ~/.zshrc, ~/.zprofile — none contain cd hermes-agent
  • Other tools work fine: execute_code and browser_navigate are unaffected
  • Network access works: Confirmed via execute_code with urllib.request

Expected Behavior

The terminal tool should either:

  1. Use an absolute path: cd ~/.hermes/hermes-agent
  2. Check if already in the target directory before cd
  3. Or not prepend cd at all if already in the correct directory

Workaround

Use execute_code (Python) or browser_navigate instead of terminal for now.

Additional Context

This appears to be a regression or oversight in the terminal backend wrapper, where the cd prefix doesn't account for the case where the CWD is already the target directory.

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 - 💡(How to fix) Fix terminal tool fails with `cd: hermes-agent: No such file or directory` when CWD is already the target directory