mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 16:31:56 +08:00
On macOS (bash 3.2 and certain Homebrew builds), sourcing a file containing declare -x statements prints each declaration to stdout. The session snapshot (written by export -p) is full of these, so every command execution prepends ~60 lines of env vars into the LLM's context window, wasting tokens and potentially exceeding context limits (issue #15459). Fix: redirect both stdout and stderr to /dev/null when sourcing the snapshot. The source builtin still sets the variables in the current shell — only the print output is suppressed. On Linux this is already silent, so the redirect is harmless. Fixes #15459