hermes - 💡(How to fix) Fix [Bug]: Runtime footer displays stale TERMINAL_CWD instead of the agent's live working directory [2 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

Additional Logs / Traceback (optional)

Root Cause

Currently, the runtime footer appended to agent messages displays the current working directory by reading the static TERMINAL_CWD environment variable. Because this variable is set when the Hermes process starts, it never updates if the AI agent navigates to a different directory during an active session. As a result, the footer displays a stale directory path that does not reflect where the agent is actually working.

Fix Action

Fixed

Code Example

⚠️  This will upload the following to a public paste service:
System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
Recent log lines (agent.log, errors.log, gateway.log — may contain
    conversation fragments and file paths)
Full agent.log and gateway.log (up to 512 KB each — likely contains
    conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report       https://paste.rs/WCmPP
  agent.log    https://paste.rs/2xqpD
  gateway.log  https://paste.rs/lT93d

Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

---

- cwd=os.environ.get("TERMINAL_CWD", ""),
+ cwd=__import__("tools.file_tools", fromlist=["_get_live_tracking_cwd"])._get_live_tracking_cwd(session_key) or os.environ.get("TERMINAL_CWD", ""),
RAW_BUFFERClick to expand / collapse

Bug Description

Currently, the runtime footer appended to agent messages displays the current working directory by reading the static TERMINAL_CWD environment variable. Because this variable is set when the Hermes process starts, it never updates if the AI agent navigates to a different directory during an active session. As a result, the footer displays a stale directory path that does not reflect where the agent is actually working.

Steps to Reproduce

Start a Hermes session with the runtime footer enabled. Ask the agent to navigate to a different directory (e.g., cd src). Observe the footer on subsequent messages—it continues to display the original startup directory rather than the new src directory.

Expected Behavior

The footer should dynamically track and display the agent's live working directory for the active session.

Actual Behavior

the footer displays a stale directory path that does not reflect where the agent is actually working.

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

⚠️  This will upload the following to a public paste service:
  • System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
  • Recent log lines (agent.log, errors.log, gateway.log — may contain
    conversation fragments and file paths)
  • Full agent.log and gateway.log (up to 512 KB each — likely contains
    conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report       https://paste.rs/WCmPP
  agent.log    https://paste.rs/2xqpD
  gateway.log  https://paste.rs/lT93d

⏱  Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

Operating System

Windows

Python Version

3.12

Hermes Version

0.15

Additional Logs / Traceback (optional)

- cwd=os.environ.get("TERMINAL_CWD", ""),
+ cwd=__import__("tools.file_tools", fromlist=["_get_live_tracking_cwd"])._get_live_tracking_cwd(session_key) or os.environ.get("TERMINAL_CWD", ""),

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

  • cwd=os.environ.get("TERMINAL_CWD", ""),
  • cwd=import("tools.file_tools", fromlist=["_get_live_tracking_cwd"])._get_live_tracking_cwd(session_key) or os.environ.get("TERMINAL_CWD", ""),

Are you willing to submit a PR for this?

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

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 [Bug]: Runtime footer displays stale TERMINAL_CWD instead of the agent's live working directory [2 pull requests]