Skip to content

fix(cron): accept Microsoft Teams conversation IDs in announce delivery (#58001)#63953

Merged
BradGroux merged 1 commit intoopenclaw:mainfrom
sudie-codes:fix/msteams-cron-conversation-validation-58001
Apr 10, 2026
Merged

fix(cron): accept Microsoft Teams conversation IDs in announce delivery (#58001)#63953
BradGroux merged 1 commit intoopenclaw:mainfrom
sudie-codes:fix/msteams-cron-conversation-validation-58001

Conversation

@sudie-codes
Copy link
Copy Markdown
Contributor

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

  • Updated the conversation ID validator to accept Teams ID formats
  • Added regression tests for each format

Fixes #58001

Test plan

  • Unit tests for each Teams ID format
  • Regression: other channel IDs still validate correctly
  • Manual: schedule a cron announce to a Teams channel

…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.
@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams size: S labels Apr 9, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 9, 2026

Greptile Summary

Extracts the looksLikeMSTeamsTargetId helper from the inline looksLikeId lambda in channel.ts and extends it to recognise the Bot Framework / Graph conversation-ID formats (a:1…, 8:orgid:…, 29:…, 19:…@unq.gbl.spaces) that the original validator silently rejected. The fallback is also tightened from String.prototype.includes("@thread") to /@thread\b/i, which is strictly more precise. Tests cover all new and existing formats.

Confidence Score: 5/5

Safe 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 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.

Reviews (1): Last reviewed commit: "fix(cron): accept Microsoft Teams conver..." | Re-trigger Greptile

}
return trimmed.includes("@thread");
},
looksLikeId: (raw) => looksLikeMSTeamsTargetId(raw),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unnecessary arrow-function wrapper

The wrapper (raw) => looksLikeMSTeamsTargetId(raw) is a point-free equivalent of the function itself and can be simplified:

Suggested change
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!

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@BradGroux BradGroux merged commit 11f924b into openclaw:main Apr 10, 2026
30 of 35 checks passed
steipete pushed a commit that referenced this pull request Apr 10, 2026
…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.
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…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.
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cron announce delivery rejects valid Microsoft Teams conversation IDs

2 participants