fix(api): avoid loading unrelated API resources on first use (#3898)
Importing the SDK or accessing one API resource currently loads unrelated resources, including Assistants. Load resource exports and streaming helpers when first accessed to reduce startup work. Existing import paths, class identity, static typing, wildcard imports, and discovery are preserved. Code that inspects module dictionaries directly may observe exports appearing later; import work and import errors move to first access. Regression tests cover import isolation, public exports, runtime annotations, pickling, reloads, sync/async requests and streams, and concurrent first access. Endpoint methods, models, dependencies, and webhook behavior are unchanged. Validation: 682 focused tests passed (14 skipped), along with Mypy, Pyright, and Ruff. Python 3.10/3.14, HTTPX2, build, lint, and baseline checks passed on the final revision. End-to-end testing also passed. Co-authored-by: marcuswood-oai <323319819+marcuswood-oai@users.noreply.github.com>
M
Marcus Wood committed
68e4317aa3df4b6e7a5ea3f75833bdd7d76e447d
Parent: dcbd6b8
Committed by GitHub <noreply@github.com>
on 9/18/2026, 6:26:21 PM