hermes - 💡(How to fix) Fix [Bug]: tool execute_code no longer inherits from the machine's environment

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…

terminal() and execute_code() do not inherit environment variables from the shell that launched the agent like it used to before.

Variables and other state in set by the shell session to the hermes agent can't be used. This breaks any workflow that relies on env vars like the use of API keys.

Error Message

Additional Logs / Traceback (optional)

Root Cause

Back then it was able to run CLI commands because the commands ran in the same bash session as where the agent was running.

Code Example

export HERMES_BUG="hello!"
echo $HERMES_BUG # see hello! being printed

---

hermes

---

run echo $HERMES_BUG
The agent calls terminal(command="echo $HERMES_BUG").

    Expected


    hello!


    Actual


    (empty output — var is unset)

the same happens if the agent calls the tool execute_code

---

Report       https://paste.rs/88HSM
  agent.log    https://paste.rs/h0DsW
  gateway.log  https://paste.rs/XR735

---

Hermes Agent v0.14.0 (2026.5.16)
Project: /Users/shellandbull/.hermes/hermes-agent
Python: 3.11.14
OpenAI SDK: 2.24.0
Up to date
RAW_BUFFERClick to expand / collapse

Bug Description

Summary

terminal() and execute_code() do not inherit environment variables from the shell that launched the agent like it used to before.

Variables and other state in set by the shell session to the hermes agent can't be used. This breaks any workflow that relies on env vars like the use of API keys.

Steps to Reproduce

  1. Set an env var in your shell
export HERMES_BUG="hello!"
echo $HERMES_BUG # see hello! being printed
  1. Start hermes
hermes
  1. Inside the agent session, try to read it
run echo $HERMES_BUG
The agent calls terminal(command="echo $HERMES_BUG").

    Expected


    hello!


    Actual


    (empty output — var is unset)

the same happens if the agent calls the tool execute_code

Expected Behavior

execute_code should have access to my environment, like it used to, so I can run scripts that rely on things like environment variables

Actual Behavior

The last time I used the hermes agent was on May 25th 2026,

Back then it was able to run CLI commands because the commands ran in the same bash session as where the agent was running.

P.S both yesterday(last time it worked) and today(the first time it broke) have the same agent config. This issue can't be attributed to a configuration setting

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

Report       https://paste.rs/88HSM
  agent.log    https://paste.rs/h0DsW
  gateway.log  https://paste.rs/XR735

Operating System

Mac OS 26.3.1

Python Version

3.12.12

Hermes Version

Agent v0.11.0 (2026.4.23)

Additional Logs / Traceback (optional)

Hermes Agent v0.14.0 (2026.5.16)
Project: /Users/shellandbull/.hermes/hermes-agent
Python: 3.11.14
OpenAI SDK: 2.24.0
Up to date

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

I'm open to fix this myself as a means of interview process,

long live Nous Research, long live Hermes!

<img width="589" height="1080" alt="Image" src="https://github.com/user-attachments/assets/b81258e5-67ec-48b7-84ee-46f85aec1884" />

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