Severity: high | Category: infra | Phase: P1.5
Problem
Multiple async def endpoints call long-blocking core functions (full test-suite runs, LLM calls, tool installs) directly on the event-loop thread, freezing all other requests — SSE heartbeats, terminal/chat WebSockets, and /health — for minutes. The run_in_threadpool/to_thread pattern is already used elsewhere but not on the heaviest endpoints.
Evidence
codeframe/ui/routers/proof_v2.py:408, gates_v2.py:115, discovery_v2.py:270, diagnose_v2.py:166, environment_v2.py:217
Acceptance criteria
- The listed handlers offload via
run_in_threadpool/asyncio.to_thread or are declared plain def.
- A proof run no longer blocks a concurrent
/health request.
Dependencies
None
Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).
Severity: high | Category: infra | Phase: P1.5
Problem
Multiple
async defendpoints call long-blocking core functions (full test-suite runs, LLM calls, tool installs) directly on the event-loop thread, freezing all other requests — SSE heartbeats, terminal/chat WebSockets, and/health— for minutes. Therun_in_threadpool/to_threadpattern is already used elsewhere but not on the heaviest endpoints.Evidence
codeframe/ui/routers/proof_v2.py:408,gates_v2.py:115,discovery_v2.py:270,diagnose_v2.py:166,environment_v2.py:217Acceptance criteria
run_in_threadpool/asyncio.to_threador are declared plaindef./healthrequest.Dependencies
None
Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).