Skip to content

v4.0.1

Choose a tag to compare

@placerda placerda released this 09 Aug 11:53
· 5 commits to main since this release
7e22840

Fixed

  • Hosted-agent entrypoint no longer crashes on import (circular import between dependencies and connectors). dependencies.py eagerly imported connectors.appconfig at module level. connectors/__init__.py eagerly imports several connector submodules (cosmosdb, search, aifoundry, ...) that each import dependencies back, at their own module level, to call get_config(). Any entrypoint whose first touch of this package tree is dependencies -- notably src/api/hosted_entrypoint.py, which is intentionally Cosmos-free and never imports connectors first -- hit ImportError: 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 serve GET /readiness. Deployed as a Microsoft Foundry hosted agent, this was observed as the platform returning HTTP 424 session_not_ready on invoke ("container started but /readiness didn't return HTTP 200 within the timeout"). AppConfigClient construction is now deferred into get_config() instead of imported eagerly at module level, breaking the cycle with no change to get_config()'s public behavior or the connectors package's re-export surface.

Validation

  • pytest -q -> 720 passed (718 pre-existing + 2 new regression tests in tests/test_hosted_entrypoint_import.py that reproduce the crash on a fresh interpreter, mirroring the hosted container's uvicorn api.hosted_entrypoint:app startup).
  • 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.