chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-09-04: - update .custodian-brief.md for rein-aharness Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a06ba0-10aa-7ea0-b20a-4f3fac39efe9
This commit is contained in:
parent
7641fcde40
commit
f01b765668
20 changed files with 1027 additions and 165 deletions
|
|
@ -257,3 +257,31 @@ def test_get_client_requires_env(monkeypatch) -> None:
|
|||
from rein_aharness.llm_connect_client import get_llm_connect_client
|
||||
|
||||
get_llm_connect_client()
|
||||
|
||||
|
||||
def test_llm_connect_cancel_closes_client_and_raises(monkeypatch) -> None:
|
||||
import rein_aharness.llm_connect_client as mod
|
||||
from rein_aharness.execution_cancel import ExecutionCancel, ExecutionCancelled
|
||||
|
||||
closed = []
|
||||
cancel = ExecutionCancel()
|
||||
|
||||
class FakeClient:
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
return False
|
||||
|
||||
def close(self):
|
||||
closed.append("closed")
|
||||
|
||||
def post(self, url, json=None): # noqa: A002
|
||||
cancel.cancel("timeout")
|
||||
raise mod.httpx.ConnectError("connection reset")
|
||||
|
||||
monkeypatch.setattr(mod.httpx, "Client", lambda timeout=None: FakeClient())
|
||||
client = LLMConnectClient("http://llm.test", timeout_seconds=5)
|
||||
with pytest.raises(ExecutionCancelled, match="timeout"):
|
||||
client.complete("hi", cancel=cancel)
|
||||
assert closed == ["closed"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue