Skip to content

Replace HttpPlugin with HttpServer + HttpServerAdapter#310

Merged
heyitsaamir merged 10 commits into
mainfrom
aamirj/http-server-adapter
Mar 13, 2026
Merged

Replace HttpPlugin with HttpServer + HttpServerAdapter#310
heyitsaamir merged 10 commits into
mainfrom
aamirj/http-server-adapter

Conversation

@heyitsaamir

@heyitsaamir heyitsaamir commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace HttpPlugin with HttpServer + HttpServerAdapter pattern — follows the TS PR #433 approach
  • HttpServer is no longer a plugin — it's owned directly by App
  • Introduces HttpServerAdapter protocol with FastAPIAdapter as the default implementation
  • Plugins inject HttpServer via DI and access the framework via server.adapter
  • Framework-agnostic handler pattern: async (HttpRequest) -> HttpResponse
  • Rewrites remote_function_jwt_middleware to be framework-agnostic
  • Adds examples/http-adapters/ with Starlette adapter and non-managed FastAPI examples

Stacked on #249

Test plan

  • Update unit tests
  • Run poe test — all tests pass
  • Run AI sample end-to-end
  • Run MCP sample end-to-end
  • Run Echo Bot sample end-to-end
  • Run Dialog sample end-to-end
  • Run Tab sample end-to-end
  • Run BotBuilder sample end-to-end

🤖 Generated with Claude Code

Comment thread examples/http-adapters/src/fastapi_non_managed.py
Comment thread packages/apps/src/microsoft_teams/apps/app.py Outdated
Comment thread packages/apps/src/microsoft_teams/apps/http/fastapi_adapter.py
Comment thread packages/apps/src/microsoft_teams/apps/http/fastapi_adapter.py Outdated
Comment thread packages/apps/src/microsoft_teams/apps/app.py
Comment thread packages/apps/src/microsoft_teams/apps/http/http_server.py Outdated
Comment thread packages/apps/src/microsoft_teams/apps/http/adapter.py
Comment thread packages/apps/src/microsoft_teams/apps/app.py Outdated
Comment thread packages/apps/src/microsoft_teams/apps/http/fastapi_adapter.py Outdated
heyitsaamir added a commit that referenced this pull request Mar 12, 2026
- Remove duplicate DI registration ("server" key)
- Add docstring to HttpServerAdapter protocol
- Replace assert with ValueError in FastAPIAdapter
- Let _process_activity errors propagate to _handle_activity
- Upgrade Teams JS SDK from v1.11.0 to v2.31.1 in dialog example
- Add streaming examples to http-adapter examples

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Comment thread examples/dialogs/src/main.py Outdated
heyitsaamir added a commit that referenced this pull request Mar 12, 2026
- Remove duplicate DI registration ("server" key)
- Add docstring to HttpServerAdapter protocol
- Replace assert with ValueError in FastAPIAdapter
- Let _process_activity errors propagate to _handle_activity
- Upgrade Teams JS SDK from v1.11.0 to v2.31.1 in dialog example
- Add streaming examples to http-adapter examples

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@heyitsaamir
heyitsaamir force-pushed the aamirj/http-server-adapter branch from 697c7e2 to 21d0bf6 Compare March 12, 2026 19:40
@heyitsaamir
heyitsaamir force-pushed the aamirj/simplifyHttp branch from 8dc943a to 2c91aa4 Compare March 12, 2026 19:45
heyitsaamir added a commit that referenced this pull request Mar 12, 2026
- Remove duplicate DI registration ("server" key)
- Add docstring to HttpServerAdapter protocol
- Replace assert with ValueError in FastAPIAdapter
- Let _process_activity errors propagate to _handle_activity
- Upgrade Teams JS SDK from v1.11.0 to v2.31.1 in dialog example
- Add streaming examples to http-adapter examples

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@heyitsaamir
heyitsaamir force-pushed the aamirj/http-server-adapter branch from 6e331d7 to a5de748 Compare March 12, 2026 19:45
@heyitsaamir

heyitsaamir commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator Author

This change is part of the following stack:

Change managed by git-spice.

Base automatically changed from aamirj/simplifyHttp to main March 13, 2026 06:02
heyitsaamir and others added 10 commits March 12, 2026 23:02
Move to HttpServer instead of HttPlugin following the TS PR.
- Remove duplicate DI registration ("server" key)
- Add docstring to HttpServerAdapter protocol
- Replace assert with ValueError in FastAPIAdapter
- Let _process_activity errors propagate to _handle_activity
- Upgrade Teams JS SDK from v1.11.0 to v2.31.1 in dialog example
- Add streaming examples to http-adapter examples

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add lifespans list to FastAPIAdapter so plugins can chain their
lifespans into the FastAPI app. The MCP server plugin uses this
to ensure FastMCP's session manager task group is initialized.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Removes unnecessary indirection — every plugin only used
server.adapter. Now plugins inject the adapter directly via
Annotated[HttpServerAdapter, DependencyMetadata()]. Also adds
proper ASGIApp typing for lifespans and port mismatch warning.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
@heyitsaamir
heyitsaamir force-pushed the aamirj/http-server-adapter branch from 86038d4 to daec143 Compare March 13, 2026 06:02
@heyitsaamir
heyitsaamir merged commit 01ff7e2 into main Mar 13, 2026
12 checks passed
@heyitsaamir
heyitsaamir deleted the aamirj/http-server-adapter branch March 13, 2026 06:24
heyitsaamir added a commit that referenced this pull request Apr 7, 2026
HttpPlugin was replaced by HttpServer + HttpServerAdapter in PR #310 but
the file was accidentally left behind. Remove it along with its sole
dependency (create_jwt_validation_middleware) and associated tests.

Co-Authored-By: Claude <[email protected]>
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.

2 participants