Repository navigation
improve(msteams): avoid repeated activity preparation on retries - #128329
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready evidence for exact head
No live Teams provider mutation was performed: this changes only internal preparation reuse, not provider API behavior, and is covered at the owner/provider-call boundary. ClawSweeper currently has only an in-progress publisher placeholder and has not published a |
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 2:37 PM ET / 18:37 UTC. ClawSweeper reviewWhat this changesThe PR reuses a successfully prepared Microsoft Teams activity during replay-safe provider retries, avoiding repeated media processing and SharePoint uploads. Merge readinessKeep open for maintainer handling: the focused cache is source-sound, but this protected, maintainer-labeled draft still needs Teams provider-boundary confirmation before merge. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Microsoft Teams plugin prepares outbound activities, including media uploads or consent cards, then sends them through the live turn context or proactive sender. A rate-limit retry returns to the same per-message send closure before delivery completes. flowchart LR
A[Rendered Teams message] --> B[Prepare activity]
B --> C[Media or SharePoint work]
C --> D[Teams provider send]
D --> E{HTTP 429?}
E -->|Yes| D
E -->|No| F[Delivered activity]
Decision needed
Why: The remaining uncertainty is at the authenticated Teams transport boundary and cannot be resolved from the mocked regression alone. Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +9. Total +9 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the per-message cache, then capture a redacted Teams provider-boundary 429 recovery trace proving one prepared payload is accepted on retry before marking the draft ready. Do we have a high-confidence way to reproduce the issue? Yes—source defines a deterministic upload-429, provider-429, then success scenario in the changed regression test, though it was not rerun in this dependency-free checkout. Is this the best way to solve the issue? Yes—the cache belongs in the per-message retry owner, so successful preparation is reused without widening retry policy or changing ambiguous-failure handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 19cbceeba39e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper review disposition for exact head
The review reports no actionable code or security findings and identifies the per-message retry owner as the best fix. Exact-head CI and native prepare remain green. |
|
Merged via squash.
|
What Problem This Solves
Microsoft Teams replay-safe provider retries repeated already-successful activity preparation. For media messages, a transient provider 429 could reread and re-encode the attachment or repeat SharePoint upload and drive-item projection before retrying the same send.
Why This Change Was Made
Successful preparation is retained only for the current message and reused across provider retries. Preparation failures still leave the activity unset, so replay-safe preparation errors retry exactly as before; retry policy, payload projection, and pending-upload bookkeeping are unchanged.
User Impact
Teams sends recover from transient provider failures without repeating completed media or SharePoint work. Ordinary sends and failure behavior are unchanged.
Evidence
node scripts/check-changed.mjs -- extensions/msteams/src/messenger.ts extensions/msteams/src/messenger.test.tspassed all selected format, boundary, dead-export, typecheck, lint, guard, and import-cycle checks.git diff --checkpassed.gpt-5.6-solwith high reasoning reported no P0/P1 findings (correctness confidence 0.96).