semblance-dev/backend/app
michael 6ee80e67aa Create fresh LLM clients per call instead of caching
The previous event loop tracking approach still caused issues - when replacing
a cached client, its garbage collection triggers aclose() which tries to close
the aiohttp session on the wrong event loop.

Simplest fix: create a fresh client for each call. The overhead is minimal
compared to the actual LLM API call, and this completely avoids all event
loop mismatch issues in ASGI environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 16:56:36 -06:00
..
auth changed permissions 2025-12-19 19:26:16 +00:00
models Remove __pycache__ files from git tracking 2025-12-19 13:28:19 -06:00
routes Remove __pycache__ files from git tracking 2025-12-19 13:28:19 -06:00
services Create fresh LLM clients per call instead of caching 2025-12-19 16:56:36 -06:00
utils Remove __pycache__ files from git tracking 2025-12-19 13:28:19 -06:00
.DS_Store changed permissions 2025-12-19 19:26:16 +00:00
__init__.py changed permissions 2025-12-19 19:26:16 +00:00
db.py changed permissions 2025-12-19 19:26:16 +00:00
extensions.py changed permissions 2025-12-19 19:26:16 +00:00
utils.py changed permissions 2025-12-19 19:26:16 +00:00
websocket_debug_tap.py changed permissions 2025-12-19 19:26:16 +00:00
websocket_manager.py changed permissions 2025-12-19 19:26:16 +00:00
websocket_manager_async.py changed permissions 2025-12-19 19:26:16 +00:00