Skip to content

fix: resolve lazy login imports relative to the loaded package - #15

Merged
MaximeRivest merged 1 commit into
lm15-dev:mainfrom
cmpnd-ai:fix/relative-lazy-exports
Sep 28, 2026
Merged

MaximeRivest merged 1 commit into
lm15-dev:mainfrom
cmpnd-ai:fix/relative-lazy-exports

Conversation

@isaacbmiller

Copy link
Copy Markdown

Description:


The lazy login exports added in 1.0.1 use absolute imports such as lm15.login and lm15.interactive. When lm15 is vendored under another namespace, those imports resolve outside the loaded package.

This breaks plain import dspy: DSPy bundles lm15 as dspy._vendor.lm15 and re-exports its public names. Resolving Auth raises ModuleNotFoundError: No module named 'lm15'. A separately installed lm15 could instead supply objects from the wrong package. Login account-flow discovery has the same absolute-import problem. The issue remains in 1.1.0.

Use relative imports with __package__ in both lazy-import paths. This preserves lazy loading and normal top-level imports without requiring a sys.modules alias or a separate lm15 installation.

Two isolated-process regression cases load lm15 under another namespace while blocking the top-level lm15 name. They verify public exports, class identity, and xAI account-flow discovery without network access or credentials. Both fail before the fix and pass afterward.

@MaximeRivest
MaximeRivest merged commit a0a4a27 into lm15-dev:main Sep 28, 2026
17 checks passed
@MaximeRivest

Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants