mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-13 09:01:54 +00:00
test: assert typing-stop-before-callback as an invariant, not a call count
The shared _stop_typing_refresh cleanup makes up to two bounded stop_typing attempts; the old assertion pinned exactly one typing-stopped event before callback-start.
This commit is contained in:
parent
c2326bc3be
commit
dc467488a7
1 changed files with 9 additions and 1 deletions
|
|
@ -1121,7 +1121,15 @@ async def test_base_processing_stops_typing_before_hung_post_delivery_callback(
|
|||
)
|
||||
|
||||
assert [call["content"] for call in adapter.sent] == ["done"]
|
||||
assert events[:2] == ["typing-stopped", "callback-start"]
|
||||
# Invariant: typing must stop before the (hung) post-delivery callback
|
||||
# starts. Don't pin the exact stop_typing call count — the shared
|
||||
# cleanup path may make more than one bounded stop attempt.
|
||||
assert "typing-stopped" in events
|
||||
assert "callback-start" in events
|
||||
assert events.index("typing-stopped") < events.index("callback-start")
|
||||
assert events[: events.index("callback-start")] == (
|
||||
["typing-stopped"] * events.index("callback-start")
|
||||
)
|
||||
assert any(call["metadata"] == {"stopped": True} for call in adapter.typing)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue