mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-11-12 22:20:33 +00:00
* fix(typesafe): build the per-evaluation HTTPX client off the event loop TypeSafeClient.aask constructs httpx.AsyncClient on the running loop, and that constructor loads the certificate store synchronously (create_ssl_context -> ssl.create_default_context(cafile=certifi.where())). aask is the path GuardrailMiddleware.awrap_tool_call awaits, plus both memory paths, so every guarded tool call stalls the Gateway loop for the duration of the trust-store load. Move the construction into asyncio.to_thread, the shape backend/AGENTS.md records for the other HTTPX clients and the one the merged Crawl4AI anchor tests. Requests and cleanup stay on-loop, so the deadline scope, retry loop, bounded body read and the error taxonomy are untouched. * fix(typesafe): close clients built during cancellation Co-authored-by: Niranjan Bajgai <2053809+bajgai@users.noreply.github.com> --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com> Co-authored-by: Niranjan Bajgai <2053809+bajgai@users.noreply.github.com>