mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-23 05:31:23 +00:00
fix(review): address Copilot follow-up on sanitizer and file decode errors
Consume multi-byte non-CSI ESC sequences during ANSI sanitization and handle UnicodeDecodeError for `hermes send --file` so review findings are resolved without regressions.
This commit is contained in:
parent
7e1788db5d
commit
a65f723e68
4 changed files with 24 additions and 1 deletions
|
|
@ -59,7 +59,7 @@ def _read_message_body(
|
|||
return sys.stdin.read()
|
||||
try:
|
||||
return Path(file_path).read_text(encoding="utf-8")
|
||||
except OSError as exc:
|
||||
except (OSError, UnicodeDecodeError) as exc:
|
||||
print(f"hermes send: cannot read {file_path}: {exc}", file=sys.stderr)
|
||||
sys.exit(_USAGE_EXIT)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue