Files
hermes-agent/tools
teknium1 10433003ec fix(tools): surface a bad working directory on every file-tool read path (#98723)
The exec wrapper's own `builtin cd -- <cwd> || exit 126` failure was only
named on paths that embed stdout (write_file, cat). Stat-probe reads
(read_file/read_file_raw/read_file_bytes) reported "Terminal environment
unavailable", the patch pre-image read "Failed to read file", and search
"requires rg or find" — and _has_command cached {'find': False} for the
instance lifetime from a probe that never ran.

Carry the signal as ExecuteResult.cwd_error: _probe_regular_file /
_env_unavailable_error, patch_replace and the search existence probe surface
the named working-directory error verbatim; _has_command returns False
without caching when the probe died at the wrapper.

Wording: "check terminal.cwd or the session cwd"; the in-container path hint
is appended only when the env's env_type is a container backend, so a
local/ssh cwd failure no longer gets a docker hint.
2026-09-18 09:54:45 -07:00
..