Idr msteams adaptive card tables#89944
Conversation
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
|
Codex review: found issues before merge. Reviewed June 30, 2026, 5:00 AM ET / 09:00 UTC. Summary PR surface: Source +221, Tests +226, Docs +3. Total +450 across 16 files. Reproducibility: yes. for the PR blockers: live CI logs reproduce the type failure, and source inspection shows the stale generated metadata, shared-mode safety gap, and rich-text split risk. Review metrics: 2 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land a Teams-owned, opt-in Adaptive Card table mode after maintainers settle the shared-versus-Teams config boundary, regenerate metadata, preserve rich text around split sends, and clear typecheck. Do we have a high-confidence way to reproduce the issue? Yes for the PR blockers: live CI logs reproduce the type failure, and source inspection shows the stale generated metadata, shared-mode safety gap, and rich-text split risk. Is this the best way to solve the issue? No, not yet: Adaptive Card table rendering is a plausible Teams feature, but making Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3d4b7cade9cd. Label changesLabel justifications:
Evidence reviewedPR surface: Source +221, Tests +226, Docs +3. Total +450 across 16 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
fe646fb to
1272045
Compare
…es as Adaptive Cards Add a new "adaptive" markdown table mode that renders tables as native Adaptive Card Table elements (schema 1.5+) instead of plain text code blocks. This provides proper visual table rendering in Teams desktop and mobile clients. - Add "adaptive" to MarkdownTableMode type union and zod schema - Create adaptive-card-table.ts with buildAdaptiveCardTable() and splitTextAndTables() helpers - Wire adaptive mode through messenger renderReplyPayloadsToMessages and proactive send.ts path - Set msteams defaultMarkdownTableMode to "adaptive" - Extend MSTeamsRenderedMessage with adaptiveCard field - Add unit tests for card builder, text splitting, and integration Co-authored-by: Cursor <[email protected]>
…own-core MarkdownTableMode The markdown-core package has its own independent MarkdownTableMode type definition that also needs the 'adaptive' variant to avoid TS2367 in packages/markdown-core/src/tables.ts. Co-authored-by: Cursor <[email protected]>
bb6be4f to
5b5aa11
Compare
…e review findings Keep adaptive Teams table rendering opt-in, preserve adaptive-card-only sends, and record all split-send platform IDs. Add focused regression coverage and document the new table mode. Co-authored-by: Cursor <[email protected]>
|
This pull request has been automatically marked as stale due to inactivity. |
Summary
What problem does this PR solve?
Microsoft Teams renders markdown tables as plain-text code blocks (
```-wrapped ASCII tables), which are hard to read on mobile, lose column alignment in narrow viewports, and cannot be scrolled horizontally. Teams natively supports Adaptive Card Table/TableRow/TableCell elements (schema 1.5+) that render as proper visual tables with headers, grid lines, and responsive cell wrapping.Why does this matter now?
Enterprise deployments using OpenClaw via Teams frequently produce tabular data (comparison tables, status reports, structured outputs). Users report that code-block tables are the single biggest readability issue on Teams mobile and narrow desktop panes.
What is the intended outcome?
channels.msteams.markdown.tables: "code")What is intentionally out of scope?
What does success look like?
Agent replies containing markdown tables appear as formatted, scrollable, grid-aligned tables in Teams desktop, web, and mobile clients.
What should reviewers focus on?
splitTextAndTablesplaceholder offset logic — off-by-one errors would corrupt message orderingbuildActivityearly return foradaptiveCardmessages — ensure it doesn't skip AI-generated entity marking"adaptive"mode inconvertMarkdownTables(pass-through) has unintended effects on other code paths that call itLinked context
Which issue does this close?
Closes # (first-time contribution — no existing issue yet; will file one if maintainers prefer)
Which issues, PRs, or discussions are related?
"block"table mode infrastructure (added but runtime-degraded to"code") was designed for this use caseWas this requested by a maintainer or owner?
No — this is an external contributor PR addressing a pain point encountered in production Teams deployments.
Real behavior proof (required for external PRs)
Example Screen shot :

Before :
Markdown
After:

Adaptive Card
Tests and validation
Which commands did you run?
What regression coverage was added or updated?
adaptive-card-table.test.ts— unit tests forbuildAdaptiveCardTable(card structure, empty cells) andsplitTextAndTables(no tables, single table, table at start/end, multiple tables)messenger.test.ts— integration tests forrenderReplyPayloadsToMessageswithtableMode: "adaptive"(tables render as cards, no-table passthrough) andbuildActivityadaptive card attachment handlingWhat failed before this fix, if known?
No failure — this is additive behavior. The previous
"code"mode still works as fallback.If no test was added, why not?
Tests were added.
Risk checklist
Did user-visible behavior change? Yes — msteams table rendering changes from code blocks to Adaptive Cards (default). Users can revert via config.
Did config, environment, or migration behavior change? Yes — new
"adaptive"value inMarkdownTableModeenum; new default for msteams channel. Existingchannels.msteams.markdown.tables: "code"configs continue working.Did security, auth, secrets, network, or tool execution behavior change? No.
What is the highest-risk area?
The
renderAdaptiveTablePayloadfunction parsing tables from raw markdown at send time — if the markdown-it parser or IR layer has edge cases with malformed tables, it could produce empty/broken cards.How is that risk mitigated?
markdownToIRWithMetareturns zero tablessplitTextAndTablesfunction handles all edge cases (empty text, table at boundaries)channels.msteams.markdown.tables: "code"Current review state
What is the next action?
Ready for maintainer review. Author can provide live proof screenshots with sanitized test data on request.
What is still waiting on author, maintainer, CI, or external proof?
Waiting on maintainer review. CI will run on push.
Which bot or reviewer comments were addressed?
N/A — first submission.