Skip to content

fix(msteams): send channel files to the team SharePoint site - #189339

Merged
roboclaw-bot merged 2 commits into
mainfrom
loop/contributor-pr-136274
Oct 31, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
loop/contributor-pr-136274

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #136274, thanks @a-tokyo.
Related: #136271

What Problem This Solves

Fixes: Microsoft Teams channel file sends fail without a manually configured SharePoint site, and a central configured site can leave team members unable to open the file card.

User Impact

Standard channels can send files to their own team's SharePoint site without setting sharePointSiteId. Explicit sites keep precedence. Group chats and private/shared channels still require an explicit site; no config migration or new option is introduced.

Discovery uses the existing Sites.ReadWrite.All application grant and the existing ChannelSettings.Read.Group RSC grant in the documented Teams manifest. No new permission scopes are requested. Microsoft documents these grants for site lookup and channel lookup.

Why This Change Was Made

Both file-send paths now resolve the team's actual site through the existing guarded SharePoint Graph request owner. Cold references resolve the AAD group through the existing identity owner and regional SDK client. The site cache holds at most 500 account/tenant/bot/team entries; channel type is checked before using a cached parent-team site.

This is a small reimplementation of the useful fix, omitting the proposed folder option and extra Graph scope. The old require-site-only helper and its obsolete unit test are removed. Production grows by 113 lines for discovery, bounded caching, and the regional metadata operation; no equivalent dead production code was found to remove safely. Regression tests grow by 196 lines, with a matching test-line allocation for the two delivery entry points, cache isolation, cancellation, and audience/explicit-site contracts.

Evidence

  • Main baseline: 447e14d02460342af4fe2c98dbd5475b15b938d2. The new regression failed in both public send entry points at the original sharePointSiteId is required error before production edits.
  • Green: six focused sibling files, 82 tests (11.37s Vitest; 13.09s wrapper). Final changed test files: 33 tests (37.27s including cold worker preparation; 39.42s wrapper). The six new cases consume 40ms total test time. Discovery, upload requests, and final file-card assembly run together against synthetic external I/O; team/account interleaving verifies cache separation.
  • Focused typecheck and typed lint passed; formatting, three-file MDX sanity, and git diff --check passed. The initial CI run passed all behavioral, type, lint, docs, and security jobs; its baseline job found a new test mock that did not preserve exports. That test-only defect is corrected, and the exact failed mock-export check now passes locally. The corrected six-case regression passes (7.84s Vitest / 9.63s wrapper). Final-head CI run 41199827659 passed on ad71ec8e5ca71ff7bd1ffbfd001fb7d1f4795b00, including the previously failing baseline checks.
  • Shared autoreview completed at P0–P3 with scoped-clean, no actionable findings, against the full local candidate based on 447e14d02460342af4fe2c98dbd5475b15b938d2 (committed unchanged as a1b7b58ccff0e60f0f7e44818abb1b85e14b6ac4). This was a static review, with unchanged SDK, handoff, timeout, and identity sources supplied as context. A separate P0-P3 autoreview of the export-preserving test correction and exact three-line budget increase also completed scoped-clean; production is byte-identical in correction ad71ec8.
  • No authenticated live Teams run or stable-version upgrade was performed. The contributor's code was read with gh pr view/gh pr diff and was never checked out or executed. Production Gateway/state was untouched.

Human contributor credit on the commit: Co-authored-by: Ahmed Tokyo <[email protected]>.

Resolve the actual team site through the existing guarded Graph request owner, with bounded scoped caching and standard-channel validation. Preserve explicit sites and group-chat configuration.

Co-authored-by: Ahmed Tokyo <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 31, 2026 11:57
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: msteams Channel integration: msteams size: M labels Oct 31, 2026
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 31, 2026 12:03
Keep the synthetic channel-send context while retaining real module exports, as required by the mock factory ratchet.

Co-authored-by: Ahmed Tokyo <[email protected]>
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@roboclaw-bot
roboclaw-bot disabled auto-merge October 31, 2026 12:08
@roboclaw-bot
roboclaw-bot merged commit 298b86c into main Oct 31, 2026
109 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-136274 branch October 31, 2026 12:21
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…w#189339)

* fix(msteams): send channel files to the team SharePoint site

Resolve the actual team site through the existing guarded Graph request owner, with bounded scoped caching and standard-channel validation. Preserve explicit sites and group-chat configuration.

Co-authored-by: Ahmed Tokyo <[email protected]>

* test(msteams): preserve send context mock exports

Keep the synthetic channel-send context while retaining real module exports, as required by the mock factory ratchet.

Co-authored-by: Ahmed Tokyo <[email protected]>

---------

Co-authored-by: Ahmed Tokyo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant