Skip to content

fix(msteams): include users when reading message reactions - #151128

Merged
obviyus merged 4 commits into
openclaw:mainfrom
Leon-SK668:leon/fix-msteams-reaction-users-20260917
Oct 13, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
Leon-SK668:leon/fix-msteams-reaction-users-20260917

Conversation

@Leon-SK668

@Leon-SK668 Leon-SK668 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: reading Teams message reactions returns correct counts but empty user lists for valid Microsoft Graph responses.

User Impact

The existing reactions action returns the reacting users' IDs and available display names. Reactions without a user ID still contribute to the count; application identities are not presented as people.

Why This Change Was Made

Microsoft Graph defines the reaction's user as an identity set, with the person nested under its user property. Read that existing contract rather than treating the outer identity set as a flat user.

Thanks to @Leon-SK668 for reporting and fixing this. The contributor commits are preserved. No overlap with Pash/Sarah changes.

Evidence

Built current-main baseline becaa38baaf9f2a650580a831ef8f04511f4c52b and candidate in a secretless Node 24 Docker container. Invoked the shipped Gateway POST /tools/invoke endpoint with tool: "message", action: "reactions", and a Teams conversation/message target. Only external OAuth and Graph HTTP transport was redirected to a local contract server; the message tool, authorization, plugin loading, Graph request construction, and decoder remained real. Both requests returned HTTP 200 and fetched /v1.0/chats/19%3Areaction-proof%40thread.v2/messages/message-1.

Input includes two nested human identities (one with a null display name), an application identity, a missing identity, and a second reaction type. Observed output excerpts:

// main: counts right, reacting users lost
{"reactionType":"like","count":4,"users":[]}
{"reactionType":"heart","count":1,"users":[]}

// candidate: same counts, human identities preserved
{"reactionType":"like","count":4,"users":[{"id":"u1","displayName":"Alice"},{"id":"u2"}]}
{"reactionType":"heart","count":1,"users":[{"id":"u3","displayName":"Carol"}]}

// empty-reactions control: unchanged on both
{"ok":true,"channel":"msteams","action":"reactions","reactions":[]}
  • Focused regression and action suites: 64/64 passed, 24.36s command wall time (22.41s Vitest). The three identity assertions fail on the main decoder with empty user arrays and correct counts.
  • Changed-file oxfmt and oxlint: passed.
  • Consolidated the new identity cases into the existing reader suite and removed the redundant 150-line HTTP/mock suite. Existing action authorization tests remain. Versus merge base: production +5/-4 (net +1), tests +19/-11 (net +8); the extra production local names the nested identity once.
  • Real-provider smoke on the same built candidate: isolated agent --local completed through openai/gpt-5-mini with a nonempty visible response, stopReason: "stop", and aborted: false. This checks provider startup, not live Microsoft tenant behavior.

This is a two-way door: a revert fully restores prior behavior. No persisted data, configuration, permissions, Graph targets, or reaction-write behavior changes. Blast radius is Teams reaction-read results only.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams size: S labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The Teams reactions action reads reacting users from Microsoft Graph’s nested identity set while preserving reaction counts.

Example: Alice, with ID u1, reacts with like to message-1.

  • Before: {"reactionType":"like","count":1,"users":[]}
  • After: {"reactionType":"like","count":1,"users":[{"id":"u1","displayName":"Alice"}]}

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused contract repair with shipped-entry-point before/after output, meaningful existing-suite regressions, and no open findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied built-Gateway POST /tools/invoke transcript exercises the real Teams message action and decoder in secretless Node 24 Docker with local OAuth and Graph HTTP substitution, showing users restored, counts preserved, and empty reactions unchanged; it does not claim live Microsoft tenant coverage.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Listing Teams reactions reports correct counts but cannot tell the agent which users reacted.
Reason: This restores the existing documented feature contract with a small plugin-local correction and no new product surface.

Merge readiness

✅ Ready for maintainer review

This PR repairs a confirmed Teams reaction-read bug still present on current main and the latest release; no actionable correctness or security findings remain.

Priority: P2
Reviewed head: 121b064670b0b69e01f68c09219ecb782e32ca4e

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Teams plugin receives authorized message-tool requests, retrieves the target message through Microsoft Graph, and returns grouped reaction counts and user identities to the agent.

flowchart TD
  A[Message tool request] --> B[Teams target authorization]
  B --> C[Graph message retrieval]
  C --> D[Nested identity decoder]
  D --> E[Reaction counts and users]
  E --> F[Agent action result]
Loading

Technical review

Best possible solution:

Land the focused repair in the existing Teams reaction decoder once the normal merge gates pass.

Do we have a high-confidence way to reproduce the issue?

Current-main source demonstrably drops users from Microsoft’s documented nested response, and the supplied Gateway baseline output confirms that failure; this review executed no target code.

Is this the best way to solve the issue?

Correcting the existing decoder is the narrowest repair and preserves anonymous counts, optional display names, and the existing action result shape.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0c51cc6dc277.

Provenance checked

  • Teams reaction identity extraction keeps the original intent (6329edf: The creation diff added reaction listing; subsequent merged message-action work explicitly intended to show who reacted.)
  • Reaction reader regression fixtures keeps the original intent (f5bf733: Consolidated reader coverage preserves counts for identities lacking IDs; the PR keeps that invariant while correcting the external response shape.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Verified introduced change: The pinned introduction diff changes the existing GraphReaction type, nested identity extraction, and reader fixtures; request construction, authorization, configuration, and reaction writes remain unchanged. (extensions/msteams/src/graph-messages.ts:296, 121b064670b0)
  • Current main still needs the repair: Current main increments every reaction count but reads reaction.user.id and reaction.user.displayName, which cannot extract the documented nested person identity. (extensions/msteams/src/graph-messages.ts:296, 0c51cc6dc277)
  • Latest release retains the flat decoder: The inspected source at v2026.10.2 also reads identities from the outer reaction.user object. (extensions/msteams/src/graph-messages.ts:226, b8952d477f0c)
  • Authoritative Graph identity contract: This decoder directly consumes Microsoft Graph’s response contract: chatMessageReaction defines user as an identity set, and chatMessageReactionIdentitySet places the reacting person under its own user property.
  • Recorded shipped-entry-point proof: The full live PR body, matching captured sourceRevision 8f7fc1c59e5cfbbe85d8341b52827218a7a4118811cdb0ba872e9ff5423d31b1, records built baseline and candidate Gateway POST /tools/invoke requests. A local HTTP contract server substitutes OAuth and Graph transport; observed output preserves counts, returns nested human IDs and names, omits null names, and preserves the empty-reactions control. (extensions/msteams/src/channel.ts:505, 121b064670b0)
  • Existing contract and feature history: The inspected creation diff at 6329edf introduced the flat identity decoder; subsequent reaction work and test consolidation preserved the intended ability to list who reacted and count reactions lacking IDs. The merged message-actions PR explicitly describes listing who reacted. (extensions/msteams/src/graph-messages.ts:296, 6329edfb8d12)

PR surface

Source +1, Tests +8. Total +9 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 5 4 +1
Tests 1 19 11 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 24 15 +9

Review metrics

Metric Value Why it matters
Production versus regression growth Production +5/-4; tests +19/-11 The small decoder correction and extension of existing fixtures are proportionate to the contract repair.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: Teams reaction reads omit user details, with a limited blast radius and no message-delivery, configuration, or authorization change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-17T20:46:55.580Z sha 1358989 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T15:23:20.045Z sha 1358989 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T13:23:16.212Z sha ff94b0e :: needs maintainer review before merge. :: none
  • reviewed 2026-10-06T06:49:57.632Z sha ff94b0e :: needs maintainer review before merge. :: none

Reviewed October 13, 2026, 2:53 AM ET / 06:53 UTC (Revision 5).

@obviyus

obviyus commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 13, 2026
@obviyus
obviyus merged commit 4526ce2 into openclaw:main Oct 13, 2026
116 of 120 checks passed
@obviyus

obviyus commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Landed in 4526ce2. Thanks @Leon-SK668! Verified through a built Gateway against a Graph contract server: Teams reaction reads now list who reacted. We folded the cases into the existing reader tests.

steipete added a commit that referenced this pull request Oct 13, 2026
Match the nested user identity set consumed after #151128. Keep the integration expectations for returned users, counts, requests, and live authority unchanged. The original fixture reproduces both read failures on main; the corrected fixture passes both surfaces.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…151128)

fix(msteams): read reaction users from Graph's nested identity set

Teams reaction reads returned the right counts but empty user lists, because the decoder read reaction.user as a flat user. Graph actually nests it as user.user (an identity set). The decoder now reads the nested user identity. Application and missing identities stay excluded, and counts are unchanged.

Proof: built Gateway, /tools/invoke message action `reactions` against a local Graph contract server returning the real Graph shape: main returned correct counts with empty users; the candidate returns the user IDs and names with identical counts. Empty reactions are unchanged.

Thanks @Leon-SK668.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
Match the nested user identity set consumed after openclaw#151128. Keep the integration expectations for returned users, counts, requests, and live authority unchanged. The original fixture reproduces both read failures on main; the corrected fixture passes both surfaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants