Skip to content

fix: phantom grounding/retrieval exports, headless version/doctor; check all sibling seams#1003

Open
abrichr wants to merge 1 commit into
mainfrom
test/all-sibling-seams
Open

fix: phantom grounding/retrieval exports, headless version/doctor; check all sibling seams#1003
abrichr wants to merge 1 commit into
mainfrom
test/all-sibling-seams

Conversation

@abrichr

@abrichr abrichr commented Jun 13, 2026

Copy link
Copy Markdown
Member

Extends the cross-package guards from #1002 to every sibling seam (openadapt-ml, -capture, -evals, -viewer, -grounding, -retrieval). The extended checks immediately found more live bugs, all fixed here:

  1. Five more phantom lazy exports in openadapt/__init__.py: Grounder, OmniGrounder, GeminiGrounder (openadapt-grounding has none of them — its real API is ElementLocator/OmniParserClient), and DemoRetriever/DemoLibrary (openadapt-retrieval has MultimodalDemoRetriever; DemoLibrary lives in openadapt-evals). Every advertised name in __all__ always raised. Replaced with the real exports.
  2. openadapt version crashed in headless environments: it imported each sibling to read __version__, and importing openadapt-capture executes a screenshot at module scope (recorder.py). Now reads importlib.metadata — no package code executed. Same class of fix for doctor (find_spec).
  3. CI now installs all six siblings, so every seam is AST-checked and the version/doctor commands run in their real (headless) environment on every PR.

The capture-side bug (screenshot at import time, which breaks any headless import of openadapt-capture) gets a separate PR in that repo.

Verification: 10/10 tests pass in the clean venv with all siblings installed; openadapt version and doctor verified headless; lazy attrs (DemoLibrary, MultimodalDemoRetriever, ElementLocator, OmniParserClient) all resolve.

🤖 Generated with Claude Code

…eck all sibling seams

Extending the #999 guards to every sibling seam the meta-package
touches. The extended checks immediately found more live bugs, all
fixed here:

- openadapt/__init__.py lazy __getattr__ exported Grounder,
  OmniGrounder, and GeminiGrounder from openadapt-grounding and
  DemoRetriever/DemoLibrary from openadapt-retrieval. None of these
  five names exist in those packages; every one always raised.
  Replaced with the real exports (ElementLocator, OmniParserClient,
  MultimodalDemoRetriever) and pointed DemoLibrary at openadapt-evals
  where it actually lives.
- `openadapt version` imported each sibling package to read
  __version__. Importing openadapt-capture takes a screenshot at
  module scope (recorder.py), which crashes headless environments
  including CI. Now reads importlib.metadata instead of executing
  package code. Same fix for `openadapt doctor` (find_spec instead of
  __import__).
- tests/test_import_integrity.py: EXTERNAL_PACKAGES extended from just
  openadapt_ml to all six sibling packages.
- CI installs all six siblings so every seam is checked on every PR.

The capture-side import side effect (screenshot at module scope) gets
its own fix in openadapt-capture.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant