fix(msteams): detect provider-prefixed target ids#104364
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 7:13 AM ET / 11:13 UTC. Summary PR surface: Source 0, Tests +15. Total +15 across 2 files. Reproducibility: yes. at source level: current main computes and supplies a normalized target, while the Microsoft Teams callback classifies only the raw provider-prefixed value. A live Microsoft Teams delivery reproduction was not performed. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Use Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main computes and supplies a normalized target, while the Microsoft Teams callback classifies only the raw provider-prefixed value. A live Microsoft Teams delivery reproduction was not performed. Is this the best way to solve the issue? No. Consuming the resolver's existing normalized callback argument is narrower, follows the plugin contract, and avoids introducing a second provider-prefix normalization path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f8aa995856ec. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0, Tests +15. Total +15 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (6 earlier review cycles)
|
eacadb8 to
5531eaf
Compare
5531eaf to
712f1ed
Compare
|
Update after the reviewer proof request:
Validation after the latest rebase: Live-proof limitation: I checked this workstation for a runnable Microsoft Teams setup before updating the evidence. There are no |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(msteams): detect provider-prefixed target ids This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
712f1ed to
a8a77e4
Compare
|
Closing this PR for now because the requested live Microsoft Teams behavior proof is not available from this environment, and I do not want to over-claim evidence. Thanks again for the review and guidance. |
Fixes #104381
What Problem This Solves
Fixes an issue where provider-prefixed Microsoft Teams explicit targets could be classified differently from the same target after MSTeams normalization.
looksLikeMSTeamsTargetId()already recognizeduser:<aad-guid>andconversation:<id>as explicit Microsoft Teams targets, and the surrounding MSTeams target helpers already strip localteams:/msteams:prefixes before parsing targets. However, this detector only trimmed the raw input, soteams:user:<aad-guid>,msteams:user:<aad-guid>, and provider-prefixed conversation targets were not classified like their normalized forms.Why This Change Was Made
This keeps the MSTeams explicit-target detector aligned with the rest of the MSTeams target parsing surface by stripping the local provider prefix before applying the existing ID checks.
The change is intentionally narrow: provider-prefixed AAD user IDs and conversation IDs are classified like their unprefixed forms, while display-name targets such as
teams:user:Alice Examplestill returnfalseso directory lookup behavior is preserved.User Impact
Users and operators can use provider-prefixed MSTeams explicit targets consistently in paths that rely on the shared target-ID detector. For example,
teams:user:<aad-guid>now follows the same explicit-ID classification asuser:<aad-guid>, andteams:conversation:19:[email protected]follows the same classification asconversation:19:[email protected].Evidence
teams:user:<aad-guid>,msteams:user:<aad-guid>,teams:conversation:19:[email protected], andmsteams:conversation:19:[email protected]are recognized as explicit IDs bylooksLikeMSTeamsTargetId().teams:user:John Smithandmsteams:user:John Smithstill do not pass the id-like detector, preserving the existing directory/display-name path.extensions/msteams/src/channel.tswires the real MSTeams plugin withtargetPrefixes: ["msteams", "teams"],normalizeTarget: normalizeMSTeamsMessagingTarget, andtargetResolver.looksLikeId: (raw) => looksLikeMSTeamsTargetId(raw), so this helper is the provider-owned classifier used by the user-facing send target path.node scripts/run-vitest.mjs run extensions/msteams/src/resolve-allowlist.test.tspasses with 43 tests after rebasing onto currentmain.git diff --check -- extensions/msteams/src/resolve-allowlist.ts extensions/msteams/src/resolve-allowlist.test.tspasses.Live-proof note: I checked this workstation for a runnable MSTeams live setup before updating the PR evidence. There are no
MSTEAMS/MS_TEAMS/TEAMS/OPENCLAWenvironment keys and no MSTeams channel credentials or targets under the local.openclawconfig scan, so I cannot honestly attach a redacted real Microsoft Teams send log from this machine. I am not treating the source-backed call chain above as live-send proof.Adjacent
extensions/msteams/src/channel.directory.test.tsandextensions/msteams/src/channel.test.tswere also considered, but this checkout is missing generated/workspace gateway-protocol package metadata/subpath exports, so those suites fail before running tests and are not treated as evidence for this PR.