strix icon indicating copy to clipboard operation
strix copied to clipboard

[BUG] v1.6.0 release binary crashes on --resume: KeyError 'agents.models' (PyInstaller missing openai-agents submodules)

Open thecannabisapp opened this issue 3 months ago • 1 comments

Describe the bug

The v1.6.0 PyInstaller binary crashes on --resume with KeyError: 'agents.models' during LLM warm-up. Fresh scans work; resume does not. The agents.models submodule (from the openai-agents SDK, importable as top-level agents) is not collected into the frozen app.

To Reproduce

  1. Install the release binary: curl -sSL https://strix.ai/install | bash (installs 1.6.0, macos-x86_64)
  2. Run any scan and interrupt it partway (or let it be killed): strix --target ./some-app -n
  3. Resume it: strix --resume <run-name> -n
  4. Crash at warm-up:
File "main.py", line 474, in main
File "main.py", line 402, in _bootstrap_scan
...
File "main.py", line 138, in warm_up_llm
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1314, in _find_and_load_unlocked
KeyError: 'agents.models'
[PYI-98908:ERROR] Failed to execute script 'main' due to unhandled exception!

Expected behavior

--resume restores the run state and continues the scan, using the same LLM configuration as the original run.

Root cause (from the 1.6.0 tree)

strix.spec builds hiddenimports with an explicit strix.* list plus collect_submodules('litellm') and collect_submodules('rich'), but never collects the agents package (the openai-agents SDK). The resume code path in warm_up_llm triggers a lazy importlib resolution of agents.models, which the frozen bootstrapper cannot find (KeyError from importlib._bootstrap._find_and_load). Fresh scans never touch that import path, which is why only resume fails.

Suggested fix: add hiddenimports += collect_submodules('agents') to strix.spec, or make the warm-up import static so PyInstaller's analysis picks it up.

Confirmation by elimination

Same run directory, same env — resuming with an editable source install (uv pip install -e . in a venv, which skips the Go TUI hook and runs unfrozen) resumes successfully. Only the packaging differs.

Workarounds

  • Run from source (editable install) for resume; or
  • Start a fresh scan instead of resuming.

System Information:

  • OS: macOS (x86_64)
  • Strix Version: 1.6.0 (release binary from strix.ai/install)
  • LLM Used: OpenAI-compatible endpoint (openai/k3-256k via LLM_API_BASE), though the crash is provider-independent — it happens before any API call

Additional context

Two adjacent resume papercuts observed while diagnosing (happy to file separately if you prefer):

  1. --resume appears to ignore --config <file> — with config only in ~/.strix/cli-config.json's sibling file passed via --config, resume aborts with "STRIX_LLM is not set" even though the same --config flag works for fresh scans. Env vars must be exported manually for resume.
  2. The docs page for the deduplication model implies STRIX_DEDUPE_LLM-style names, but the actual v1.6.0 aliases in strix/config/settings.py are STRIX_DEDUPE_MODEL, DEDUPE_LLM_API_KEY, DEDUPE_LLM_API_BASE.

thecannabisapp avatar Sep 02 '26 09:09 thecannabisapp

A fix is available in https://github.com/usestrix/strix/pull/1243

The official v1.6.1 release binary was reproduced with the same KeyError: 'agents.models'. The release archive already contains agents.models and agents.models.interface, so this is not caused by a missing PyInstaller hidden import. The failure is an import race between the background warm-up thread and the main thread entering the agents SDK graph.

The PR waits for the warm-up to finish before scan bootstrap while preserving its overlap with startup I/O. Validation includes 1679 passing tests and an exact PyInstaller binary reproduction. The patched binary completes frozen import bootstrap and reaches model preflight successfully.

utkutugrul avatar Sep 02 '26 22:09 utkutugrul