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:
@@ -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'),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user