fix(msteams): replace deprecated HttpPlugin with httpServerAdapter#60939
Conversation
Greptile SummaryThis PR migrates the MS Teams channel plugin's HTTP server stub from a Key changes:
Confidence Score: 4/5Safe to merge; the core logic change is correct and well-motivated, with two small follow-up items that can be fixed in a subsequent commit. The IHttpServerAdapter implementation satisfies the interface contract (only registerRoute is required; start, stop, serveStatic are optional), tests pass, and the deprecated warning path is correctly removed. The private-dist-path import is a style/fragility concern rather than a runtime bug since it is type-only. The stale JSDoc comment is cosmetic. extensions/msteams/src/sdk.ts — private dist path on line 1 and stale JSDoc on line 348.
|
| @@ -1,3 +1,4 @@ | |||
| import type { IHttpServerAdapter } from "@microsoft/teams.apps/dist/http/index.js"; | |||
There was a problem hiding this comment.
Private dist path reintroduced for type import
The import reaches into @microsoft/teams.apps/dist/http/index.js — a private distribution path identical in fragility to the dist/types/plugin/decorators/*.js paths the PR is removing. The old code even called this out explicitly: "FRAGILE: these are internal SDK paths (not public API). If @microsoft/teams.apps changes its dist layout, these imports will break."
IHttpServerAdapter is re-exported from the package's public root, so the public subpath should be used instead:
| import type { IHttpServerAdapter } from "@microsoft/teams.apps/dist/http/index.js"; | |
| import type { IHttpServerAdapter } from "@microsoft/teams.apps"; |
This keeps the type-safety benefit while importing through the documented public surface and avoids a breaking point on any future SDK dist-layout change.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/msteams/src/sdk.ts
Line: 1
Comment:
**Private dist path reintroduced for type import**
The import reaches into `@microsoft/teams.apps/dist/http/index.js` — a private distribution path identical in fragility to the `dist/types/plugin/decorators/*.js` paths the PR is removing. The old code even called this out explicitly: *"FRAGILE: these are internal SDK paths (not public API). If `@microsoft/teams.apps` changes its dist layout, these imports will break."*
`IHttpServerAdapter` is re-exported from the package's public root, so the public subpath should be used instead:
```suggestion
import type { IHttpServerAdapter } from "@microsoft/teams.apps";
```
This keeps the type-safety benefit while importing through the documented public surface and avoids a breaking point on any future SDK dist-layout change.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Addressed in 190faa0.
Investigated using the public root import (@microsoft/teams.apps) as suggested — unfortunately tsgo (the stricter type-checker used in the pre-commit hook) can't resolve IHttpServerAdapter through the barrel re-export chain (export * from './http'). The import compiles fine with standard tsc/vitest but fails tsgo with TS2305: Module has no exported member.
Kept the dist subpath but added a comment explaining why it's necessary, so future editors don't silently "fix" it back to the public root and break the build.
Also fixed the stale JSDoc at line 348 that still referenced "the App's HttpPlugin" — updated to "the App's HTTP server".
|
Upstream SDK improvement filed: microsoft/teams.ts#505 This requests the ability to opt out of HTTP server creation entirely in the Until that ships, this PR's no-op |
|
Findings No blocking issues found. I reviewed the PR diff, checked the surrounding I also ran the focused Teams SDK test file on the PR branch: Residual risk is low, but there is one non-blocking note: the type-only import from |
Migrate from the deprecated `plugins: [noOpHttpPlugin]` pattern to the SDK's public `httpServerAdapter` option. This eliminates the "[DEPRECATED] HttpPlugin in plugins array" warning that fires every ~60 seconds in the gateway error log. The old NoOpHttpPlugin was a ~40-line class that used fragile reflect-metadata hacks against internal SDK decorator paths. The replacement is a simple 3-line IHttpServerAdapter stub with an empty registerRoute() — the only method the interface requires. Fixes: openclaw#60732 See also: openclaw#55161 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update stale JSDoc that still referenced HttpPlugin (line 348) - Add comment explaining why IHttpServerAdapter uses dist subpath (tsgo cannot resolve the re-export chain from the public barrel) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
190faa0 to
7fe7f3c
Compare
|
Merged via squash.
Thanks @coolramukaka-sys. |
…penclaw#60939) Merged via squash. Prepared head SHA: 7fe7f3c Co-authored-by: coolramukaka-sys <271658891+coolramukaka-sys@users.noreply.github.com> Co-authored-by: BradGroux <3053586+BradGroux@users.noreply.github.com> Reviewed-by: @BradGroux
…penclaw#60939) Merged via squash. Prepared head SHA: 7fe7f3c Co-authored-by: coolramukaka-sys <271658891+coolramukaka-sys@users.noreply.github.com> Co-authored-by: BradGroux <3053586+BradGroux@users.noreply.github.com> Reviewed-by: @BradGroux
…penclaw#60939) Merged via squash. Prepared head SHA: 7fe7f3c Co-authored-by: coolramukaka-sys <271658891+coolramukaka-sys@users.noreply.github.com> Co-authored-by: BradGroux <3053586+BradGroux@users.noreply.github.com> Reviewed-by: @BradGroux
Summary
plugins: [noOpHttpPlugin]pattern to the SDK's publichttpServerAdapteroption increateMSTeamsApp()[DEPRECATED] HttpPlugin in plugins arraywarning that fires every ~60s in the gateway error logreflect-metadatahacks against internal SDK decorator pathsWhat changed
extensions/msteams/src/sdk.tscreateNoOpHttpPlugin()function (~40 lines of reflect-metadata decorator hacks) with a 3-linecreateNoOpHttpServerAdapter()that implementsIHttpServerAdaptercreateMSTeamsApp()now passeshttpServerAdapterinstead ofplugins: [noOpHttp]IHttpServerAdapter(dist subpath required — tsgo can't resolve the public barrel re-export chain)extensions/msteams/src/sdk.test.tsBefore / After
Before (main, unpatched) — HttpPlugin warning fires every ~60s (full log):
After (this PR) — zero warnings over 2+ minute observation (full log):
Teams UI — bot receives messages, streams responses, shows AI label and feedback buttons:
Testing
riley-inbestments.westus2.cloudapp.azure.com) — before/after log comparisonSmoke test results (test plan)
curlreturns 401 (rejects unauthenticated)All evidence: SidU/ocmaintenance/teams/testing/screenshots/2026-04-04/
Known issues (pre-existing, not caused by this PR)
readtool schema withoutadditionalProperties: false, rejected by OpenAI and GitHub Copilot providers #60821: OpenAI strict mode rejects tool schemas missingadditionalProperties: falseandrequiredarrays. This affects all tools (read,exec,cron) on main — not introduced by this change.Fixes: #60732
See also: #55161
🤖 Generated with Claude Code