fix(warmup): drop docker from WARMUP_MODULES

The Docker checks import the Docker SDK on the main thread before the
warm-up join, so warming it saves nothing and leaves one module shared
between the two threads during the startup window.
This commit is contained in:
Ahmed Allam 2026-09-04 21:43:41 +00:00 committed by Ahmed Allam
parent a3bf864e1e
commit 9cc9de8cdc

View file

@ -1,10 +1,11 @@
"""Background pre-import of the heavy scan dependencies.
The scan engine's import graph (the agents SDK, OpenAI client, LiteLLM, the
Caido SDK, the Docker SDK) costs seconds to import cold, but none of it is
needed until a scan actually starts. Importing it on a daemon thread at CLI
entry overlaps that cost with the I/O-bound startup work that always precedes
a scan (argument parsing, Docker checks, image pull, TUI setup).
Caido SDK) costs seconds to import cold, but none of it is needed until a scan
actually starts. Importing it on a daemon thread at CLI entry overlaps that
cost with the I/O-bound startup work that always precedes a scan (argument
parsing, Docker checks, image pull, TUI setup). The Docker SDK is not on the
list: the Docker checks import it on the main thread during that same window.
The main thread must call :func:`wait_for_import_warmup` before its first
import from that graph. Two threads that enter the same package graph from
@ -25,7 +26,6 @@ WARMUP_MODULES = (
"strix.core.runner",
"litellm",
"caido_sdk_client",
"docker",
)
_thread: threading.Thread | None = None