fix(strix): resolve strix.interface.main package-attribute shadow crash - #1783
Merged
Conversation
strix/interface/__init__.py in strix-agent 1.5.3 runs `from .main import main`, which rebinds the package attribute `strix.interface.main` to the `main` function it imports, shadowing the submodule of the same name. `from strix.interface import main as strix_main` therefore returned the function, not the module, and `strix_main.asyncio = ...` raised `AttributeError: 'function' object has no attribute 'asyncio'` on every single invocation of the launcher this repo installs for every Strix run (CWL_STRIX_UNBOUNDED_INFERENCE=1 is set unconditionally by the installer). Confirmed live: every sampled completed Strix run across the org crashes in ~2 seconds, before any LLM call, with this exact traceback (e.g. DiagramWeave run 33598375361, job 100146441461) -- and the gate script fails the required check closed on any non-zero exit, so this has been failing Strix's required check on every PR org-wide since the launcher merged (f59bad1, 2026-09-01). Fix: look the submodule up directly in sys.modules by its exact dotted path, which the shadow never touches (verified against a real strix-agent 1.5.3 install). The existing test suite's synthetic strix.interface fake never replicated the shadow (it set the package attribute directly to the module), so it never caught the crash the real package produces -- updated both fakes to replicate the real __init__.py's shadowing behavior and added a dedicated regression test that reproduces it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 24 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
f59bad1(2026-09-01) merged theCWL_STRIX_UNBOUNDED_INFERENCE=1compat launcher — before any LLM call, always withAttributeError: 'function' object has no attribute 'asyncio'. Confirmed live against a real completed run (DiagramWeave run33598375361, job100146441461).strix/interface/__init__.pyin strix-agent 1.5.3 runsfrom .main import main, which rebinds the package attributestrix.interface.mainto the imported function, shadowing the submodule of the same name.from strix.interface import main as strix_main(andimport strix.interface.main as strix_main, which also resolves via attribute traversal) both return the function, not the module — sostrix_main.asyncio = ...fails.sys.modulesby its exact dotted path, which the__init__.pyshadow never touches. Verified end-to-end against a real, freshlyuv venv-installedstrix-agent==1.5.3(not just a synthetic mock) — the fix resolvesstrix_mainto the true submodule with a realasynciomodule attribute and callablemain.strix.interfacefake never replicated this shadow (it set the package attribute directly to the module object, which is not how the real__init__.pybehaves), so it never caught the crash. Updated both existing fakes to replicate the real shadowing and added a dedicated regression test (test_runtime_compatibility_survives_the_package_level_main_shadow) that reproduces it.Test plan
coverage run -m pytest tests/test_strix_llm_timeout_contract.py -q— 16 passed (new regression test included)coverage run -m pytest tests -q— 2681 passed, 1 skipped, 21 subtests passedcoverage report— 100% (scripts/ci/strix_timeout_compat.py: 100%)interrogate— 100% docstring coverage on the changed filestrix-agent==1.5.3install in an isolateduv venv(not just the synthetic test fakes): confirmed the exact live crash reproduces with the old code and is resolved with the fix🤖 Generated with Claude Code