#22442: test(ci): unbreak baseline tui metadata + msteams local-file assertions
channel: msteams
size: XS
## Summary
- fix inbound metadata stripping to remove **only leading injected blocks** (preserve metadata-like text in message body)
- stabilize MSTeams local-file mention test by asserting mention preservation across local-file delivery paths while still validating OneDrive-link behavior when that path is selected
## Why
`main` is currently red on baseline tests that are not specific to feature PRs:
- `src/tui/tui-formatters.test.ts` (`does not strip metadata-like blocks that are not a leading prefix`)
- `extensions/msteams/src/messenger.test.ts` (`preserves parsed mentions when appending OneDrive fallback file links`)
This PR is a narrow CI-unbreak focused only on those failing assertions.
## Validation
- `pnpm vitest run src/tui/tui-formatters.test.ts extensions/msteams/src/messenger.test.ts`
- `pnpm oxfmt --check src/auto-reply/reply/strip-inbound-meta.ts extensions/msteams/src/messenger.test.ts`
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixes two failing baseline tests by refining metadata stripping logic and stabilizing MSTeams file delivery assertions. The `strip-inbound-meta.ts` change correctly implements leading-prefix-only stripping to avoid removing metadata-like text from message bodies. The `messenger.test.ts` change makes the test resilient to different file delivery paths (OneDrive link vs attachment) while preserving core mention-parsing verification.
<h3>Confidence Score: 5/5</h3>
- Safe to merge with minimal risk - targeted CI fixes with sound logic
- Both changes are narrow, well-reasoned CI unbreak fixes. The metadata stripping rewrite correctly implements leading-prefix-only logic with proper bounds checking and malformed-block safety. The test change appropriately relaxes file-delivery mechanism assertions while maintaining mention-preservation verification. No security concerns, edge cases are handled, and the changes align with stated PR intent.
- No files require special attention
<sub>Last reviewed commit: 584625b</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21123: Docs/CI/MSTeams: close low-hanging parity gaps and add guardrails
by webdevtodayjason · 2026-02-19
77.3%
#20301: Security: scrub untrusted metadata from user-facing replies
by ashishc2503 · 2026-02-18
75.4%
#23139: test: fix flaky auth tests when OPENCLAW_GATEWAY_TOKEN is present
by Imccccc · 2026-02-22
75.1%
#22808: test(ui): split baseline browser-test fixes from webchat feature
by opnsec · 2026-02-21
75.1%
#22990: test: fix readonly typing regressions in CI check baseline
by bmendonca3 · 2026-02-21
75.0%
#22178: test(web): allow fixture roots in media local file tests
by Kansodata · 2026-02-20
74.8%
#10902: fix(msteams): fix inline pasted image downloads
by jlian · 2026-02-07
74.6%
#18655: fix(mattermost): preserve markdown formatting and native tables
by echo931 · 2026-02-16
74.4%
#23271: fix(chat): strip untrusted metadata blocks from Control UI messages
by lbo728 · 2026-02-22
74.4%
#22383: Chore: apply oxfmt baseline for CI check
by bmendonca3 · 2026-02-21
74.0%