The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(pty): handle replay send failures cleanly
MKanso941d8b59a7db
diff --git a/hermes_cli/pty_session.py b/hermes_cli/pty_session.pyindex 7a35bd1aec4..a1e5623f177 100644--- a/hermes_cli/pty_session.py+++ b/hermes_cli/pty_session.py@@ -113,7 +113,7 @@ class PtySession:await ws.send_bytes(snap)except Exception:self.detach(ws)- raise+ return Falseif force_redraw:return await self.write(ws, TUI_FORCE_REDRAW)return Truediff --git a/tests/hermes_cli/test_pty_session.py b/tests/hermes_cli/test_pty_session.pyindex ee69295db0d..2ad3f6c849e 100644--- a/tests/hermes_cli/test_pty_session.py+++ b/tests/hermes_cli/test_pty_session.py@@ -95,9 +95,9 @@ async def test_failed_replay_detaches_session():s = PtySession("k", FakeBridge([b""]), buffer_cap=1024, read_timeout=0.01)s.buffer.append(b"replay")+ ws = FailingWS()- with pytest.raises(RuntimeError, match="socket closed"):- await s.attach(FailingWS())+ assert await s.attach(ws) is Falseassert s.attached is Falseassert s.last_detached_at is not None