Repository navigation
fix(msteams): restore missing channel thread context - #128901
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 7:36 PM ET / 23:36 UTC. ClawSweeper reviewWhat this changesThis PR removes unsupported query parameters from Microsoft Teams channel-parent and thread-reply Graph requests, restoring thread context supplied to the agent. Merge readinessKeep this maintainer-labeled PR open for normal maintainer handling. The owner-level correction is coherent and no patch defect was found, but exact-head CI is still running and the Microsoft Graph contract could not be independently rechecked from this network-isolated review environment. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherIncoming Microsoft Teams channel replies fetch their parent message and prior replies through the plugin’s Graph client before building the context delivered to the agent. Those Graph results also supply the parent author used for the reply-context event. flowchart LR
A[Teams channel reply] --> B[Incoming message handler]
B --> C[Thread context lookup]
C --> D[Microsoft Graph requests]
D --> E[Parent and earlier replies]
E --> F[Agent context and parent event]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -3, Tests +34. Total +31 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the owner-local request correction, then complete exact-head CI and record a maintainer-owned Graph documentation or tenant check before landing. Do we have a high-confidence way to reproduce the issue? No independent high-confidence live reproduction was available: current main clearly sends the disputed queries and drops failed parent fetches, but Graph documentation and a tenant were unreachable from this environment. Is this the best way to solve the issue? Yes at the code level: repairing the Graph request owner preserves the existing encoding, deadline, sender-visibility, and bounded-reply behavior instead of compensating downstream. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b71a09fd8a3e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users replying in a Microsoft Teams channel thread would receive answers without the original message or earlier replies when Microsoft Graph rejects unsupported query parameters. The bot also silently lost the parent author's name and its "Replying to @…" context event, leaving short replies such as "yes" without the conversation they answer.
Why This Change Was Made
Microsoft Graph's get chatMessage API supports no OData query parameters, and its list channel message replies API supports only
$top, capped at 50. Request the parent without query parameters and request replies with the existing bounded$toponly. The existing chat-message sibling already follows the same contract. Authentication, SSRF protection, URL encoding, sender visibility, shared deadlines, and pagination behavior remain unchanged; production code decreases by three lines.User Impact
Microsoft Teams channel replies once again include both the original question and prior thread messages, preserve the parent author's identity, and enqueue the existing parent-context event. Existing channel permissions, sender allowlists, request timeouts, and reply limits are unaffected.
Evidence
undefinedafter HTTP 400, and the reply request rejected withProviderHttpError400.$top=50.Alice: the original questionplusBob: the prior decision, authorAlice, andReplying to @Alice: the original question.