fix(packaging): bundle certifi CA bundle in PyInstaller binary - #1009
fix(packaging): bundle certifi CA bundle in PyInstaller binary#1009not-knope wants to merge 1 commit into
Conversation
Standalone macOS builds failed LLM preflight with a generic Connection error because cacert.pem was missing from the frozen bundle; also surface STRIX_DEBUG logs and exception cause chains before scan logging starts. Fixes usestrix#1008
Greptile SummaryThe PR bundles certifi’s CA data into PyInstaller builds, configures frozen executables to use that bundle, and improves diagnostics for early LLM connection failures.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking logging lifecycle issue that duplicates scan output after a successful preflight. The CA-bundle and diagnostic changes have no established blocking failure, but the newly attached preflight handler coexists with scan-scoped stderr logging and is never removed. Files Needing Attention: strix/telemetry/logging.py Important Files Changed
Prompt To Fix All With AI### Issue 1
strix/telemetry/logging.py:163-165
**Preflight handler persists into scans**
After a successful non-interactive preflight, `setup_scan_logging()` adds another stderr handler to the same logger roots without removing this preflight handler. Scan records are consequently printed twice, and the preflight handler remains attached after scan teardown.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(packaging): bundle certifi CA bundle..." | Re-trigger Greptile |
| tracked.setLevel(logging.DEBUG) | ||
| tracked.addHandler(stream_handler) | ||
| tracked.propagate = False |
There was a problem hiding this comment.
Preflight handler persists into scans
After a successful non-interactive preflight, setup_scan_logging() adds another stderr handler to the same logger roots without removing this preflight handler. Scan records are consequently printed twice, and the preflight handler remains attached after scan teardown.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/telemetry/logging.py
Line: 163-165
Comment:
**Preflight handler persists into scans**
After a successful non-interactive preflight, `setup_scan_logging()` adds another stderr handler to the same logger roots without removing this preflight handler. Scan records are consequently printed twice, and the preflight handler remains attached after scan teardown.
**Knowledge Base Used:**
- [CLI and Runner: from `strix` invocation to a running scan](https://app.greptile.com/strix-org-3/-/custom-context/knowledge-base/usestrix/strix/-/docs/cli-and-runner.md)
- [Configuration and Telemetry](https://app.greptile.com/strix-org-3/-/custom-context/knowledge-base/usestrix/strix/-/docs/telemetry-and-config.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
certifi'scacert.pemin the PyInstaller build (collect_data_files('certifi')) and setSSL_CERT_FILE/REQUESTS_CA_BUNDLEvia a runtime hook (plus a frozen-entry safety net instrix/interface/main.py), fixing TLS failures that surfaced as generic LLMConnection erroron macOS Apple Silicon standalone binaries.warm_up_llm()soSTRIX_DEBUG=1actually shows preflight failures, and print the full exception cause chain in the connection-error panel when debug is on.Fixes #1008
Test plan
uv run python -c "import certifi; print(certifi.where())"strix.speccontainscollect_data_files('certifi')andruntime_hooks=[...pyi_rth_certifi.py]collect_data_files('certifi')includescacert.pemuv run pytest tests/test_preflight_logging.py tests/test_packaging.py tests/test_provider_hints.pySTRIX_DEBUG=1prints warm-up debug + root SSL cause