mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix terminal workdir validation for Windows paths
This commit is contained in:
parent
eb3d928da6
commit
de3f8bc6ce
3 changed files with 20 additions and 3 deletions
|
|
@ -148,9 +148,10 @@ def _check_all_guards(command: str, env_type: str) -> dict:
|
|||
|
||||
|
||||
# Allowlist: characters that can legitimately appear in directory paths.
|
||||
# Covers alphanumeric, path separators, tilde, dot, hyphen, underscore, space,
|
||||
# plus, at, equals, and comma. Everything else is rejected.
|
||||
_WORKDIR_SAFE_RE = re.compile(r'^[A-Za-z0-9/_\-.~ +@=,]+$')
|
||||
# Covers alphanumeric, path separators, Windows drive/UNC separators, tilde,
|
||||
# dot, hyphen, underscore, space, plus, at, equals, and comma. Everything
|
||||
# else is rejected.
|
||||
_WORKDIR_SAFE_RE = re.compile(r'^[A-Za-z0-9/\\:_\-.~ +@=,]+$')
|
||||
|
||||
|
||||
def _validate_workdir(workdir: str) -> str | None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue