fix(msteams): tighten html attachment fallback#58632
fix(msteams): tighten html attachment fallback#58632neeravmakwana wants to merge 2 commits intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8daa6af80e
ℹ️ 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".
Greptile SummaryThis PR tightens the Graph media fallback in the MS Teams integration by requiring explicit Key changes:
Minor gap: The Confidence Score: 5/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/msteams/src/monitor-handler/inbound-media.test.ts
Line: 94-105
Comment:
**Fallback path for `htmlSummary` not covered**
Both new tests always supply an explicit `htmlSummary`, so the branch inside `resolveMSTeamsInboundMedia` where `htmlSummary` is `undefined` and the function falls back to calling `summarizeMSTeamsHtmlAttachments(attachments)` is never exercised here. A third test that omits `htmlSummary` (relying on the internal fallback) would confirm the fallback correctly computes `attachmentTags` from attachment content and routes accordingly — e.g., passing a mention-only HTML attachment without providing `htmlSummary` should still skip the Graph fallback.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(msteams): tighten html attachment fa..." | Re-trigger Greptile |
|
Addressed the current bot feedback in a follow-up update. Changes made:
Verification:
The addressed review threads are resolved now. |
|
🤖 We're reviewing this PR with Aisle We're running a security check on the changes in this PR now. This usually takes a few minutes. ⌛ Progress:
Last updated on: 2026-04-01T07:02:07Z |
Summary
text/htmlattachments still triggered Graph media fallback, and the Graph media path still attempted${messageUrl}/attachmentsinstead of using the message body'sattachmentsarray.<attachment>tags in HTML attachments, reusechatMessage.attachmentsfrom the fetched message body, and add regression tests for both behaviors.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
resolveMSTeamsInboundMedia()treated any all-text/htmlattachment set as a Graph-media fallback candidate, even though Teams mention markup also arrives astext/htmland does not imply a downloadable file.chatMessage.attachmentsfrom the message resource.git blame, prior PR, issue, or refactor if known): issue [Bug]: msteams channel file attachments not downloaded — Graph fallback triggers on non-file HTML attachments #58617 documents the observed behavior; I did not trace a single introducing PR with confidence.text/htmltransport shape, so the broader fallback condition matched both.Regression Test Plan (if applicable)
extensions/msteams/src/monitor-handler/inbound-media.test.ts,extensions/msteams/src/attachments.test.ts${messageUrl}/attachments./attachmentsfetch.User-visible / Behavior Changes
Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
msteamsSteps
Expected
attachmentsarray.Actual
${messageUrl}/attachments.Evidence
Attach at least one:
Human Verification (required)
pnpm test:extension msteamssuccessfully; verified the new unit coverage for mention-only HTML and the updated Graph attachment path; ranpnpm buildsuccessfully.<attachment>tags still falls back, SharePoint reference attachments still merge with hosted content without calling${messageUrl}/attachments.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations
<attachment>tags would no longer trigger Graph fallback.pnpm checkis currently blocked by unrelated existingtsgofailures inextensions/diffs/src/language-hints.test.ts.pnpm test:extension msteamslane and a greenpnpm buildrun for the touched surface.AI Assistance
pnpm test:extension msteams,pnpm build;pnpm checkblocked by unrelated existingtsgofailures inextensions/diffs/src/language-hints.test.ts)Made with Cursor