fix(msteams): patch Teams HttpPlugin /api* route pattern in dist#54880
fix(msteams): patch Teams HttpPlugin /api* route pattern in dist#54880ruanrrn wants to merge 3 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a high-severity Teams channel startup regression by adding a postbuild patch script that rewrites the invalid Confidence Score: 4/5Safe to merge; the fix is minimal and correctly targeted. Both flagged items are P2 style issues that do not affect correctness on the primary Linux build environment. scripts/patch-msteams-httpplugin-route.mjs
|
| Filename | Overview |
|---|---|
| scripts/patch-msteams-httpplugin-route.mjs | New patch script; logic is correct and idempotent, two minor style issues identified. |
| scripts/runtime-postbuild.mjs | Minimal, well-placed wiring of the new patch into the existing postbuild pipeline. |
Prompt To Fix All With AI
This is a comment left during a code review.
Path: scripts/patch-msteams-httpplugin-route.mjs
Line: 33
Comment:
**Inconsistent entry-point detection — prefer `pathToFileURL`**
Every other standalone script in this project uses `pathToFileURL(process.argv[1] ?? "").href`. On Windows, `new URL("C:\\path\\to\\file.mjs", "file:")` misparses the drive letter as a protocol, while `pathToFileURL` handles Windows paths correctly.
```suggestion
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: scripts/patch-msteams-httpplugin-route.mjs
Line: 30
Comment:
**Silent no-op when needle is absent after a full scan**
When `dist/` exists but no file contains the needle, the function returns `{ changedFiles: [], skipped: null }` with no warning. If the transpiler variable name for `express_1` changes, Teams regresses silently. Consider emitting a `stderr` warning when `changedFiles.length === 0` and `skipped` is null.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(msteams): patch Teams HttpPlugin /ap..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09f4445060
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
09f4445 to
cb2de0a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb2de0a270
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Superseded by #55440, which has been merged. |
Summary
Missing parameter name at index 5: /api*.HttpPluginExpress mount from"/api*"to"/api"in the emitteddist/bundle.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
HttpPluginregistersthis.express.use("/api*", express.json()), which is rejected by newerpath-to-regexpbehavior (commonly encountered via Express v5) withMissing parameter name at index 5: /api*.git blame, prior PR, issue, or refactor if known): Reported in [Bug]: Teams Broken After 2026.3.24 udpates #54703; appears related to the Teams SDK migration (see issue comments).Regression Test Plan (if applicable)
scripts/runtime-postbuild.mjs, no emitteddist/*.jsshould containthis.express.use("/api*", express_1.default.json());.User-visible / Behavior Changes
/api*Express route pattern.Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
dist/).node scripts/runtime-postbuild.mjs."/api*"route pattern for the Teams SDKHttpPlugin.Expected
Missing parameter name at index 5: /api*.Actual
"/api*"."/api*"->"/api".Evidence
Issue report + workaround confirmation: #54703
Human Verification (required)
scripts/patch-msteams-httpplugin-route.mjsrewrites the emitted code as intended.dist/is missing.pnpm build/ Teams E2E runtime startup in this environment.Review Conversations
Compatibility / Migration
Failure Recovery (if this breaks)
09f4445060.scripts/runtime-postbuild.mjs,scripts/patch-msteams-httpplugin-route.mjs.distfiles (should be limited to exact needle match).Risks and Mitigations