| 109 | |
| 110 | |
| 111 | class SmokeClient: |
| 112 | def __init__(self): |
| 113 | self.updates = [] |
| 114 | self.ready = asyncio.Event() |
| 115 | self.commands_ready = asyncio.Event() |
| 116 | |
| 117 | def on_connect(self, conn): |
| 118 | pass |
| 119 | |
| 120 | async def session_update(self, session_id, update, **kwargs): |
| 121 | obj = update.model_dump(mode="json", by_alias=True, exclude_none=True) |
| 122 | self.updates.append(obj) |
| 123 | if obj["sessionUpdate"] == "available_commands_update": |
| 124 | self.commands_ready.set() |
| 125 | if obj["sessionUpdate"] == "tool_call_update" and "READY" in obj.get("title", ""): |
| 126 | self.ready.set() |
| 127 | |
| 128 | |
| 129 | def assert_execution(updates, status, expected_lines): |