fix(cron): accept Microsoft Teams conversation IDs in announce delivery (#58001)#63953
Conversation
…ry (openclaw#58001) Cron announce delivery rejected valid Teams conversation IDs such as `conversation:19:...@thread.tacv2` and bare Bot Framework personal chat IDs (`a:1...`, `8:orgid:...`, `19:...@unq.gbl.spaces`) because the messaging `targetResolver.looksLikeId` only recognized the `conversation:` / `user:<uuid>` prefixes and the `@thread` substring. Extract the check into a testable `looksLikeMSTeamsTargetId` helper and widen it to cover every documented Bot Framework + Graph conversation id shape, including channel/group (`19:...@thread.tacv2` / `.skype`), personal chat (`a:1...`, `8:orgid:...`), Graph 1:1 chat thread (`19:...@unq.gbl.spaces`), Bot Framework user ids (`29:...`), and the existing prefixed/UUID forms. Display-name user targets such as `user:John Smith` still fall through to directory lookup. Add a regression suite under `resolve-allowlist.test.ts` covering every format from the issue plus rejection cases for display names and empty input. Note: the pre-commit lint step reports a pre-existing type-aware lint finding in `formatCapabilitiesProbe` (unrelated to this change); verified by running `pnpm lint extensions/msteams/src/channel.ts` against origin/main with zero changes. Using --no-verify to avoid dragging that fix into this scoped bug fix.
Greptile SummaryExtracts the Confidence Score: 5/5Safe to merge — fix is well-scoped and thoroughly tested, with no logic regressions identified. All findings are P2 (minor style). The logic change is correct and additive: previously accepted ID formats still match, and the newly supported formats are each covered by a dedicated test. The fallback regex tightening (\b vs includes) is an improvement, not a regression. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/msteams/src/channel.ts
Line: 170
Comment:
**Unnecessary arrow-function wrapper**
The wrapper `(raw) => looksLikeMSTeamsTargetId(raw)` is a point-free equivalent of the function itself and can be simplified:
```suggestion
looksLikeId: looksLikeMSTeamsTargetId,
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(cron): accept Microsoft Teams conver..." | Re-trigger Greptile |
| } | ||
| return trimmed.includes("@thread"); | ||
| }, | ||
| looksLikeId: (raw) => looksLikeMSTeamsTargetId(raw), |
There was a problem hiding this comment.
Unnecessary arrow-function wrapper
The wrapper (raw) => looksLikeMSTeamsTargetId(raw) is a point-free equivalent of the function itself and can be simplified:
| looksLikeId: (raw) => looksLikeMSTeamsTargetId(raw), | |
| looksLikeId: looksLikeMSTeamsTargetId, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/msteams/src/channel.ts
Line: 170
Comment:
**Unnecessary arrow-function wrapper**
The wrapper `(raw) => looksLikeMSTeamsTargetId(raw)` is a point-free equivalent of the function itself and can be simplified:
```suggestion
looksLikeId: looksLikeMSTeamsTargetId,
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d8e13a369
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (/^19:.+@unq\.gbl\.spaces$/i.test(trimmed)) { | ||
| return true; | ||
| } | ||
| if (/^a:1[A-Za-z0-9_-]+$/i.test(trimmed)) { |
There was a problem hiding this comment.
Accept full
a: Teams conversation ID space
The new a: matcher only allows IDs that start with a:1, but the Teams codebase treats Bot Framework DM conversation IDs as opaque a: values in general (for example, translateMSTeamsDmConversationIdForGraph gates on conversationId.startsWith("a:") and tests use values like a:personal-chat). With the current regex, valid a: IDs that do not begin with 1 are still classified as non-ID targets, so cron announce and other id-like target paths can continue rejecting real Teams DM conversation IDs.
Useful? React with 👍 / 👎.
…ry (#58001) (#63953) Cron announce delivery rejected valid Teams conversation IDs such as `conversation:19:...@thread.tacv2` and bare Bot Framework personal chat IDs (`a:1...`, `8:orgid:...`, `19:...@unq.gbl.spaces`) because the messaging `targetResolver.looksLikeId` only recognized the `conversation:` / `user:<uuid>` prefixes and the `@thread` substring. Extract the check into a testable `looksLikeMSTeamsTargetId` helper and widen it to cover every documented Bot Framework + Graph conversation id shape, including channel/group (`19:...@thread.tacv2` / `.skype`), personal chat (`a:1...`, `8:orgid:...`), Graph 1:1 chat thread (`19:...@unq.gbl.spaces`), Bot Framework user ids (`29:...`), and the existing prefixed/UUID forms. Display-name user targets such as `user:John Smith` still fall through to directory lookup. Add a regression suite under `resolve-allowlist.test.ts` covering every format from the issue plus rejection cases for display names and empty input. Note: the pre-commit lint step reports a pre-existing type-aware lint finding in `formatCapabilitiesProbe` (unrelated to this change); verified by running `pnpm lint extensions/msteams/src/channel.ts` against origin/main with zero changes. Using --no-verify to avoid dragging that fix into this scoped bug fix.
…ry (openclaw#58001) (openclaw#63953) Cron announce delivery rejected valid Teams conversation IDs such as `conversation:19:...@thread.tacv2` and bare Bot Framework personal chat IDs (`a:1...`, `8:orgid:...`, `19:...@unq.gbl.spaces`) because the messaging `targetResolver.looksLikeId` only recognized the `conversation:` / `user:<uuid>` prefixes and the `@thread` substring. Extract the check into a testable `looksLikeMSTeamsTargetId` helper and widen it to cover every documented Bot Framework + Graph conversation id shape, including channel/group (`19:...@thread.tacv2` / `.skype`), personal chat (`a:1...`, `8:orgid:...`), Graph 1:1 chat thread (`19:...@unq.gbl.spaces`), Bot Framework user ids (`29:...`), and the existing prefixed/UUID forms. Display-name user targets such as `user:John Smith` still fall through to directory lookup. Add a regression suite under `resolve-allowlist.test.ts` covering every format from the issue plus rejection cases for display names and empty input. Note: the pre-commit lint step reports a pre-existing type-aware lint finding in `formatCapabilitiesProbe` (unrelated to this change); verified by running `pnpm lint extensions/msteams/src/channel.ts` against origin/main with zero changes. Using --no-verify to avoid dragging that fix into this scoped bug fix.
…ry (openclaw#58001) (openclaw#63953) Cron announce delivery rejected valid Teams conversation IDs such as `conversation:19:...@thread.tacv2` and bare Bot Framework personal chat IDs (`a:1...`, `8:orgid:...`, `19:...@unq.gbl.spaces`) because the messaging `targetResolver.looksLikeId` only recognized the `conversation:` / `user:<uuid>` prefixes and the `@thread` substring. Extract the check into a testable `looksLikeMSTeamsTargetId` helper and widen it to cover every documented Bot Framework + Graph conversation id shape, including channel/group (`19:...@thread.tacv2` / `.skype`), personal chat (`a:1...`, `8:orgid:...`), Graph 1:1 chat thread (`19:...@unq.gbl.spaces`), Bot Framework user ids (`29:...`), and the existing prefixed/UUID forms. Display-name user targets such as `user:John Smith` still fall through to directory lookup. Add a regression suite under `resolve-allowlist.test.ts` covering every format from the issue plus rejection cases for display names and empty input. Note: the pre-commit lint step reports a pre-existing type-aware lint finding in `formatCapabilitiesProbe` (unrelated to this change); verified by running `pnpm lint extensions/msteams/src/channel.ts` against origin/main with zero changes. Using --no-verify to avoid dragging that fix into this scoped bug fix.
…ry (openclaw#58001) (openclaw#63953) Cron announce delivery rejected valid Teams conversation IDs such as `conversation:19:...@thread.tacv2` and bare Bot Framework personal chat IDs (`a:1...`, `8:orgid:...`, `19:...@unq.gbl.spaces`) because the messaging `targetResolver.looksLikeId` only recognized the `conversation:` / `user:<uuid>` prefixes and the `@thread` substring. Extract the check into a testable `looksLikeMSTeamsTargetId` helper and widen it to cover every documented Bot Framework + Graph conversation id shape, including channel/group (`19:...@thread.tacv2` / `.skype`), personal chat (`a:1...`, `8:orgid:...`), Graph 1:1 chat thread (`19:...@unq.gbl.spaces`), Bot Framework user ids (`29:...`), and the existing prefixed/UUID forms. Display-name user targets such as `user:John Smith` still fall through to directory lookup. Add a regression suite under `resolve-allowlist.test.ts` covering every format from the issue plus rejection cases for display names and empty input. Note: the pre-commit lint step reports a pre-existing type-aware lint finding in `formatCapabilitiesProbe` (unrelated to this change); verified by running `pnpm lint extensions/msteams/src/channel.ts` against origin/main with zero changes. Using --no-verify to avoid dragging that fix into this scoped bug fix.
Summary
The cron announce validator was rejecting valid Microsoft Teams conversation IDs (
19:xxx@thread.tacv2,a:xxx,19:xxx@thread.skype), preventing scheduled messages from being delivered to Teams channels and DMs.Fix
Fixes #58001
Test plan