Skip to content

Add host-owned ASGI route registration#484

Open
dcaayushd wants to merge 1 commit into
microsoft:mainfrom
dcaayushd:fix/447-activity-entity-validation
Open

Add host-owned ASGI route registration#484
dcaayushd wants to merge 1 commit into
microsoft:mainfrom
dcaayushd:fix/447-activity-entity-validation

Conversation

@dcaayushd

Copy link
Copy Markdown
Contributor

Summary

Fixes #447.

Adds a public lifecycle split for host-owned ASGI integrations:

  • Adds App.register_routes() to synchronously register the Teams messaging endpoint without starting a server or running async plugin init.
  • Adds App.start_plugins() so hosts can run plugin on_init hooks later from their ASGI startup lifecycle.
  • Returns a public HttpRoute route table from registration.
  • Ships StarletteAdapter as part of microsoft_teams.apps.http instead of leaving it example-only.
  • Updates host-owned FastAPI/Starlette examples and docs to use the new lifecycle.

Validation

./.venv/bin/python -m pytest packages/apps/tests packages/botbuilder/tests
./.venv/bin/python -m ruff check packages/apps/src/microsoft_teams/apps packages/apps/tests/test_app.py packages/apps/tests/test_http_server.py examples/a2a/src/main.py examples/http-adapters/src/fastapi_non_managed.py examples/http-adapters/src/starlette_echo.py examples/mcp-server/src/main.py
./.venv/bin/pyright packages/apps/src/microsoft_teams/apps packages/botbuilder/src/microsoft_teams/botbuilder/adapter.py examples/a2a/src/main.py examples/http-adapters/src/fastapi_non_managed.py examples/http-adapters/src/starlette_echo.py examples/mcp-server/src/main.py

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.

Support hosting the Teams endpoint inside a caller-owned ASGI app (sync route registration, host owns lifecycle)

1 participant