mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix: keep queued paste payloads atomic (#74797)
Co-authored-by: eloklam <22125285+eloklam@users.noreply.github.com> Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
parent
126ff7071b
commit
5835201de1
9 changed files with 198 additions and 55 deletions
22
tests/cli/test_cli_queue_paste.py
Normal file
22
tests/cli/test_cli_queue_paste.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""Regression tests for collapsed paste references passed to /queue."""
|
||||
|
||||
from queue import Queue
|
||||
from unittest.mock import patch
|
||||
|
||||
from cli import HermesCLI
|
||||
|
||||
|
||||
def test_queue_expands_collapsed_paste_reference(tmp_path):
|
||||
pasted = "first\nmiddle\nlast"
|
||||
paste_file = tmp_path / "paste.txt"
|
||||
paste_file.write_text(pasted, encoding="utf-8")
|
||||
placeholder = f"[Pasted text #1: 3 lines → {paste_file}]"
|
||||
cli_obj = HermesCLI.__new__(HermesCLI)
|
||||
cli_obj._agent_running = False
|
||||
cli_obj._pending_input = Queue()
|
||||
cli_obj._pending_resume_sessions = None
|
||||
|
||||
with patch("cli._cprint"):
|
||||
assert cli_obj.process_command(f"/queue {placeholder}") is True
|
||||
|
||||
assert cli_obj._pending_input.get_nowait() == pasted
|
||||
Loading…
Add table
Add a link
Reference in a new issue