test(audit): fix critical test suite deadlocks and write exhaustive architectural report
- Fix 'Triple Bingo' history synchronization explosion during streaming - Implement stateless event buffering in ApiHookClient to prevent dropped events - Ensure 'tool_execution' events emit consistently across all LLM providers - Add hard timeouts to all background thread wait() conditions - Add thorough teardown cleanup to conftest.py's reset_ai_client fixture - Write highly detailed report_gemini.md exposing asyncio lifecycle flaws
This commit is contained in:
@@ -38,6 +38,10 @@ class EventEmitter:
|
||||
for callback in self._listeners[event_name]:
|
||||
callback(*args, **kwargs)
|
||||
|
||||
def clear(self) -> None:
|
||||
"""Clears all registered listeners."""
|
||||
self._listeners.clear()
|
||||
|
||||
class AsyncEventQueue:
|
||||
"""
|
||||
Asynchronous event queue for decoupled communication using asyncio.Queue.
|
||||
@@ -66,6 +70,14 @@ class AsyncEventQueue:
|
||||
"""
|
||||
return await self._queue.get()
|
||||
|
||||
def task_done(self) -> None:
|
||||
"""Signals that a formerly enqueued task is complete."""
|
||||
self._queue.task_done()
|
||||
|
||||
async def join(self) -> None:
|
||||
"""Blocks until all items in the queue have been gotten and processed."""
|
||||
await self._queue.join()
|
||||
|
||||
class UserRequestEvent:
|
||||
"""
|
||||
Payload for a user request event.
|
||||
|
||||
Reference in New Issue
Block a user