Skip to content

fix(msteams): prevent duplicate replies after streaming failures - #115669

Merged
steipete merged 1 commit into
mainfrom
codex/s07-teams-91723-acknowledged-stream-prefix
Jul 29, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/s07-teams-91723-acknowledged-stream-prefix

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Fixes #91723

What Problem This Solves

Fixes an issue where Microsoft Teams users receiving a streamed reply longer than 4,000 characters would see the already delivered text a second time when Teams rejected a later streaming chunk.

Why This Change Was Made

Use the Microsoft Teams SDK's real provider-acknowledged chunk event as the only evidence that a cumulative text prefix was delivered. On a non-cancellation failure, deliver only the remaining text after that exact acknowledged prefix. Without a provider acknowledgement, preserve the existing full-reply fallback. Cancellation, later tool-round payloads, media, and the existing delivery-trace goldens retain their existing behavior.

The change stays inside the Microsoft Teams plugin and adds no public SDK types, configuration, or changed fallback goldens.

User Impact

Long streamed Teams replies are delivered completely without duplicating text that Teams already acknowledged. Users who press Stop do not receive an unwanted fallback message, and unacknowledged failures still recover the complete reply.

Evidence

  • Blacksmith Testbox tbx_01kyp6smx6dv0a5q1csv97p7m3: exact final remote timing reports exitCode=0 for all 95 focused tests and the complete changed gate.
  • Real installed @microsoft/teams.apps HttpStream against a real loopback HTTP provider: a 4,000-character acknowledged chunk followed by a rejected 4,200-character chunk produces exactly the 200-character fallback; a first-write HTTP 403 produces no false acknowledgement; a real HTTP cancellation produces no fallback.
  • All four existing Teams delivery-trace goldens, including full redelivery when acknowledgement evidence is unavailable, pass unchanged.
  • Both extension and extension-test tsgo lanes, type-aware lint, formatting, plugin-boundary, public SDK, import-cycle, dependency, and all other changed-file guards pass.
  • Exact-source Codex autoreview, gpt-5.6-sol, xhigh: no actionable findings; confidence 0.93.
  • Microsoft contract: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/streaming-ux

@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams size: M maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete
steipete force-pushed the codex/s07-teams-91723-acknowledged-stream-prefix branch from 46d97cd to 8876cc3 Compare July 29, 2026 06:59
@steipete
steipete merged commit 945ac65 into main Jul 29, 2026
89 checks passed
@steipete
steipete deleted the codex/s07-teams-91723-acknowledged-stream-prefix branch July 29, 2026 07:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

msteams: streaming double-posts replies over 4000 chars after SDK rebase (#76262 regressed #59297)

1 participant