v4.0.1
Fixed
- Hosted-agent entrypoint no longer crashes on import (circular import between
dependenciesandconnectors).dependencies.pyeagerly importedconnectors.appconfigat module level.connectors/__init__.pyeagerly imports several connector submodules (cosmosdb,search,aifoundry, ...) that each importdependenciesback, at their own module level, to callget_config(). Any entrypoint whose first touch of this package tree isdependencies-- notablysrc/api/hosted_entrypoint.py, which is intentionally Cosmos-free and never importsconnectorsfirst -- hitImportError: cannot import name 'get_config' from partially initialized module 'dependencies' (most likely due to a circular import)and crashed before uvicorn could bind a port or serveGET /readiness. Deployed as a Microsoft Foundry hosted agent, this was observed as the platform returning HTTP 424session_not_readyon invoke ("container started but/readinessdidn't return HTTP 200 within the timeout").AppConfigClientconstruction is now deferred intoget_config()instead of imported eagerly at module level, breaking the cycle with no change toget_config()'s public behavior or theconnectorspackage's re-export surface.
Validation
pytest -q-> 720 passed (718 pre-existing + 2 new regression tests intests/test_hosted_entrypoint_import.pythat reproduce the crash on a fresh interpreter, mirroring the hosted container'suvicorn api.hosted_entrypoint:appstartup).- Reproduced the documented failure and confirmed the fix resolves it: import fails with the ImportError above before the change, succeeds in ~4s after.
Compatibility
No public API or behavior change from v4.0.0 beyond fixing the import crash. Classic (Container Apps) and /invocations behavior are unaffected.