fix: allow /root workspace path; guard against split on missing [Attached files]

Removes /root from _BLOCKED_SYSTEM_ROOTS in api/workspace.py, allowing
Hermes running as root (e.g. Docker, VPS) to use /root as a workspace
without a 'system directory' rejection.

Fixes a fragile string split in api/streaming.py: base_text extraction
now guards against msg_text that contains no '[Attached files:' marker,
preventing the split from producing empty-string on those messages.

Fixes: #510, partial fix from #521 (workspace + split guard only).
Co-authored-by: ccqqlo <ccqqlo@users.noreply.github.com>
This commit is contained in:
Hermes Agent
2026-04-15 07:41:36 +00:00
parent 0b96f08b3e
commit eb760a2158
2 changed files with 2 additions and 2 deletions

View File

@@ -243,7 +243,7 @@ def resolve_trusted_workspace(path: str | Path | None = None) -> Path:
_BLOCKED_SYSTEM_ROOTS = {
# Linux / macOS
Path('/etc'), Path('/usr'), Path('/var'), Path('/bin'), Path('/sbin'),
Path('/boot'), Path('/proc'), Path('/sys'), Path('/dev'), Path('/root'),
Path('/boot'), Path('/proc'), Path('/sys'), Path('/dev'),
Path('/lib'), Path('/lib64'), Path('/opt/homebrew'),
}