Skip to content

msteams: persist sent-message markers best-effort - #75585

Merged
amknight merged 4 commits into
mainfrom
ak/plugin-state-msteams-default-on
May 3, 2026
Merged

amknight merged 4 commits into
mainfrom
ak/plugin-state-msteams-default-on

Conversation

@amknight

@amknight amknight commented May 1, 2026

Copy link
Copy Markdown
Member

Summary

Split from #75053. This migrates only Microsoft Teams sent-message markers to best-effort SDK-backed persistence behind the existing in-memory cache.

Teams still checks memory first. Once the Teams runtime is available, sent outbound message ids mirror to api.runtime.state.openKeyedStore namespace msteams.sent-messages. After a Gateway restart, reply-to-bot classification can recover recent bot-sent markers and backfill memory so subsequent checks are sync again.

If the SQLite-backed store is unavailable or any persistent operation fails, Teams logs the failure, disables persistent access for the process, and keeps the previous process-local behavior.

Files / behavior

  • extensions/msteams/src/sent-message-cache.ts
    • adds best-effort persistent register/lookup
    • keeps memory as the hot/source-of-truth path
    • backfills memory on persistent lookup hits
  • extensions/msteams/src/monitor-handler/message-handler.ts
    • awaits the persistence-aware sent-message check in the existing async handler flow
  • extensions/msteams/src/runtime.ts
    • exposes optional runtime access for graceful no-op/fallback behavior
  • Microsoft Teams channel docs and changelog updated.

Validation

Local from ../openclaw-plugin-state-msteams-default-on:

  • pnpm test extensions/msteams/src/sent-message-cache.test.ts extensions/msteams/src/monitor-handler/message-handler.authz.test.ts — passed
  • pnpm exec oxfmt --check --threads=1 <touched ts files> — passed
  • git diff HEAD --check — passed
  • pnpm check:changed — passed

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: msteams Channel integration: msteams size: M maintainer Maintainer-authored PR labels May 1, 2026
@clawsweeper

clawsweeper Bot commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR moves Microsoft Teams sent-message markers to a memory-first, best-effort SDK keyed store with async reply-to-bot recovery, regression tests, and a changelog entry.

Reproducibility: Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR rather than a bug report; source inspection clearly shows current main is process-local only and the PR head adds restart recovery through the SDK keyed store.

Next step before merge
Maintainer should decide sequencing with #75053 and require exact-head CI to finish cleanly; there is no narrow ClawSweeper repair finding in the Teams diff.

Security
Cleared: The diff only changes Teams plugin cache/runtime code, focused tests, and changelog text while using the existing SDK keyed-store API; no concrete security or supply-chain regression was found.

Review details

Best possible solution:

Land the Teams-only persistence split after maintainer approval and exact-head CI are clean, preserving the memory-first fallback and TTL-preserving recovery behavior.

Do we have a high-confidence way to reproduce the issue?

Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR rather than a bug report; source inspection clearly shows current main is process-local only and the PR head adds restart recovery through the SDK keyed store.

Is this the best way to solve the issue?

Is this the best way to solve the issue? Yes for the scoped Teams implementation: it uses the existing SDK keyed-store seam behind the in-memory fast path and preserves marker TTL, while merge sequencing and CI remain maintainer concerns.

What I checked:

Likely related people:

  • steipete: Merged history shows recent ownership of the Teams handler path and the cross-channel reply_to_bot implicit mention behavior that this PR extends. (role: recent Microsoft Teams channel maintainer; confidence: high; commits: 05d149a49b21, ffe67e9cdc9e; files: extensions/msteams/src/monitor-handler/message-handler.ts, extensions/msteams/src/sent-message-cache.ts)
  • TaKO8Ki: Merged history shows prior work on the Teams sent-message cache storage surface that this persistence layer builds on. (role: sent-message cache history owner; confidence: medium; commits: 0bee3f337ae5; files: extensions/msteams/src/sent-message-cache.ts)
  • amknight: Current-main history shows prior merged ownership of the SQLite plugin state store and SDK runtime docs consumed by this PR, beyond only proposing this branch. (role: SDK state-store foundation author; confidence: high; commits: bbf985d50a64; files: src/plugin-state/plugin-state-store.ts, src/plugin-state/plugin-state-store.types.ts, docs/plugins/sdk-runtime.md)

Remaining risk / open question:

  • The PR has the protected maintainer label, so it should not be cleaned up or merged without explicit maintainer handling.
  • Exact-head CI was not fully green at inspection time; the visible failures were in gateway model tests outside the Teams diff, with some checks still queued or in progress.
  • The PR is split from the broader open draft channels: make plugin state persistence best effort by default #75053, so maintainers still need to decide sequencing for default-on plugin state persistence.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 74f243a0d0b9.

@amknight
amknight marked this pull request as ready for review May 1, 2026 12:21
@amknight
amknight force-pushed the ak/plugin-state-msteams-default-on branch from b5a640d to 13d10a2 Compare May 1, 2026 12:22
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label May 1, 2026
@amknight
amknight force-pushed the ak/plugin-state-msteams-default-on branch from d54d015 to 31adcb8 Compare May 3, 2026 07:20
@amknight
amknight merged commit 6ae09d0 into main May 3, 2026
94 of 97 checks passed
@amknight
amknight deleted the ak/plugin-state-msteams-default-on branch May 3, 2026 07:25
vincentkoc added a commit that referenced this pull request May 3, 2026
…eleased

Both #75585 (msteams sent-message marker persistence) and #75586 (matrix
approval reaction target persistence) landed on main 2026-05-03 but
appended their changelog entries under `## 2026.4.30`, which was
finalized on 2026-05-01. Move them under `## Unreleased ### Fixes` so
the released section stays frozen and the new fixes are credited in the
right release window. Thanks @amknight.
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
* msteams: persist sent-message markers best-effort

* docs: clarify Teams restart persistence changelog

* msteams: remove redundant sent-message TTL comment

* msteams: preserve sent-message marker TTL on recovery
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
…eleased

Both openclaw#75585 (msteams sent-message marker persistence) and openclaw#75586 (matrix
approval reaction target persistence) landed on main 2026-05-03 but
appended their changelog entries under `## 2026.4.30`, which was
finalized on 2026-05-01. Move them under `## Unreleased ### Fixes` so
the released section stays frozen and the new fixes are credited in the
right release window. Thanks @amknight.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* msteams: persist sent-message markers best-effort

* docs: clarify Teams restart persistence changelog

* msteams: remove redundant sent-message TTL comment

* msteams: preserve sent-message marker TTL on recovery
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…eleased

Both openclaw#75585 (msteams sent-message marker persistence) and openclaw#75586 (matrix
approval reaction target persistence) landed on main 2026-05-03 but
appended their changelog entries under `## 2026.4.30`, which was
finalized on 2026-05-01. Move them under `## Unreleased ### Fixes` so
the released section stays frozen and the new fixes are credited in the
right release window. Thanks @amknight.
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* msteams: persist sent-message markers best-effort

* docs: clarify Teams restart persistence changelog

* msteams: remove redundant sent-message TTL comment

* msteams: preserve sent-message marker TTL on recovery
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…eleased

Both openclaw#75585 (msteams sent-message marker persistence) and openclaw#75586 (matrix
approval reaction target persistence) landed on main 2026-05-03 but
appended their changelog entries under `## 2026.4.30`, which was
finalized on 2026-05-01. Move them under `## Unreleased ### Fixes` so
the released section stays frozen and the new fixes are credited in the
right release window. Thanks @amknight.
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* msteams: persist sent-message markers best-effort

* docs: clarify Teams restart persistence changelog

* msteams: remove redundant sent-message TTL comment

* msteams: preserve sent-message marker TTL on recovery
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…eleased

Both openclaw#75585 (msteams sent-message marker persistence) and openclaw#75586 (matrix
approval reaction target persistence) landed on main 2026-05-03 but
appended their changelog entries under `## 2026.4.30`, which was
finalized on 2026-05-01. Move them under `## Unreleased ### Fixes` so
the released section stays frozen and the new fixes are credited in the
right release window. Thanks @amknight.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant