-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: Teams thread context omits newer replies when a channel thread has more than 50 replies #98870
Copy link
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automationExclude from stale automation
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automationExclude from stale automation
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Teams channel thread context only fetches the first 50 oldest replies, so newer replies are omitted when a thread has more than 50 replies.
Steps to reproduce
Expected behavior
The thread context should include the newest relevant replies from the thread. The Teams Graph replies endpoint exposes additional reply pages through
@odata.nextLink, so OpenClaw should follow pagination instead of stopping at the oldest first page.Actual behavior
fetchThreadRepliesrequests/messages/{messageId}/replies?$top=50...once and returns onlyres.value. The source comment notes that Graph returns replies oldest-first and that the newest replies are silently omitted for threads with more than 50 replies.OpenClaw version
Current main at 4010b81, source-level repro.
Operating system
Not OS-specific.
Install method
Source checkout / pnpm dev.
Model
Not provider-specific; source-level Teams channel runtime path.
Provider / routing chain
Not provider-specific; source-level Teams channel runtime path.
Additional provider/model setup details
NOT_ENOUGH_INFO
Logs, screenshots, and evidence
Source evidence:
extensions/msteams/src/graph-thread.tsclamps replies to$top=50and returns onlyres.value.@odata.nextLinkcan retrieve more replies.extensions/msteams/src/monitor-handler/message-handler.tsusesfetchThreadReplies(...)for agent thread context.@odata.nextLinkfor paginated Graph collections.Duplicate search:
gh search issues --repo openclaw/openclaw --state open --match title,body -- "Teams graph thread replies nextLink"returned no open results.gh search prs --repo openclaw/openclaw --state open --match title,body -- "Teams graph thread replies nextLink"returned no open results.Focused regression test idea:
@odata.nextLink, return newer replies on the next page, and assertfetchThreadRepliesfollows pagination and returns the newest limited set.Impact and severity
Affected: Microsoft Teams channel users with long reply threads.
Severity: Medium; agent context can miss the most recent conversation state.
Frequency: Always when the relevant context falls after the first 50 oldest replies.
Consequence: The agent may answer using stale thread context.
Additional information
NOT_ENOUGH_INFO