Skip to content

[Bug]: MS Teams replies fail with 'Cannot perform set on a proxy that has been revoked #27189

@kellyGrillo

Description

@kellyGrillo

Summary

Bug: MS Teams replies fail with "Cannot perform 'set' on a proxy that has been revoked"

Description

The MS Teams extension consistently fails to deliver replies to users with the error:

[msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked

Moneypenny (the AI assistant) receives inbound Teams messages and processes them correctly, but the reply never reaches the user. From the user's perspective, the bot appears to read messages but never responds. When asked about it, the AI believes it already replied successfully.

Environment

  • OpenClaw version: 2026.2.15 (3fe22ea)
  • MS Teams extension version: 2026.2.24 (@openclaw/msteams)
  • Node.js: v22.22.0
  • OS: Ubuntu 24.04 LTS
  • Hardware: Dell Edge Gateway 5200

Steps to Reproduce

  1. Configure the channels.msteams section in openclaw.json with valid Bot Framework credentials (appId, appPassword, tenantId, webhook)
  2. Send a DM to the bot via Microsoft Teams
  3. Observe that the bot receives and processes the message (visible in logs)
  4. The reply fails silently — the user never receives a response

Expected Behavior

The bot should deliver its AI-generated reply back to the Teams conversation.

Actual Behavior

The reply fails with:

[msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
[msteams] final reply failed: Cannot perform 'get' on a proxy that has been revoked

The AI processes the message and generates a response, but the delivery mechanism fails because the Bot Framework turn context has been revoked by the time the reply is dispatched.

Root Cause Analysis

After tracing through the extension source code, the issue appears to be in the interaction between the inbound debouncer and the Bot Framework turn context lifecycle.

The flow:

  1. monitor-handler.ts registers an onMessage handler that calls handleTeamsMessage()
  2. handleTeamsMessage() in message-handler.ts enqueues the message into an inbound debouncer via inboundDebouncer.enqueue()
  3. The Bot Framework onMessage handler returns (completing the turn)
  4. The Bot Framework SDK revokes the turn context proxy after the turn completes
  5. The debouncer's onFlush callback fires and calls handleTeamsMessageNow()
  6. handleTeamsMessageNow() creates a reply dispatcher that passes the now-revoked context object to sendMSTeamsMessages() in messenger.ts
  7. The send attempt fails because the proxy has been revoked

Key code path:

onMessage handler
  → handleTeamsMessage()
    → inboundDebouncer.enqueue({ context, ... })
      → [turn completes, context proxy revoked]
      → onFlush fires
        → handleTeamsMessageNow({ context: REVOKED_PROXY, ... })
          → createMSTeamsReplyDispatcher({ context: REVOKED_PROXY, ... })
            → sendMSTeamsMessages({ context: REVOKED_PROXY, ... })
              → 💥 Cannot perform 'set' on a proxy that has been revoked

The core issue:

The reply dispatcher in reply-dispatcher.ts (line ~70) passes the live context object to sendMSTeamsMessages(). However, by the time the AI generates a response and the dispatcher attempts to send it, the Bot Framework SDK has already revoked the turn context.

The extension does store conversation references via conversationStore.upsert() in message-handler.ts (line ~270), and send-context.ts has a full resolveMSTeamsSendContext() function for proactive messaging. However, the reply path uses the turn context instead of the stored conversation reference for proactive messaging.

Attempted Workarounds (None Worked)

Attempt Result
Set debounceMs: 0 on channels.msteams Unrecognized key: "debounceMs" — not in the channel config schema
Set responseModel to a faster model on channels.msteams Unrecognized keys: "responseModel", "responseTimeoutMs" — not in schema
Remove duplicate plugin entry from plugins.entries Eliminated duplicate warning but proxy error persists

Suggested Fix

The reply dispatcher should use proactive messaging via the stored conversation reference (which already works — send-context.ts + conversation-store-fs.ts) instead of relying on the turn context, which is invalidated after the turn completes. This is the standard Bot Framework pattern for scenarios where the response is not immediate.

Alternatively, the debouncer's onFlush should keep the turn alive by awaiting the full AI response cycle within the turn handler before returning, ensuring the context remains valid throughout the reply.

Logs

2026-02-26T04:00:51.817Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:03:23.593Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:03:23.596Z [msteams] final reply failed: Cannot perform 'get' on a proxy that has been revoked
2026-02-26T04:03:50.347Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:04:26.741Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:06:55.846Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:07:42.802Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:07:42.804Z [msteams] final reply failed: Cannot perform 'get' on a proxy that has been revoked
2026-02-26T04:09:17.740Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked

These errors repeat on every inbound message. No successful replies were observed.

Additional Context

  • The WhatsApp and Voice Call plugins on the same OpenClaw instance work correctly
  • WhatsApp has debounceMs: 0 set in its channel config, which may be why it doesn't hit this issue
  • The MS Teams channel config schema does not accept debounceMs as a valid property
  • The extension was released on 2026-02-24 (one day before this issue was discovered)

Steps to reproduce

Send msbot question, bot replys but if that question required a followup the bot does not reply but thinks it did

Expected behavior

I should get a reply to followups

Actual behavior

bot thinks it replied

OpenClaw version

2026.2.15 (3fe22ea)

Operating system

Ubuntu 24.04 LTS

Install method

npm

Logs, screenshots, and evidence

2026-02-26T04:00:51.817Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:03:23.593Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:03:23.596Z [msteams] final reply failed: Cannot perform 'get' on a proxy that has been revoked
2026-02-26T04:03:50.347Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:04:26.741Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:06:55.846Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:07:42.802Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked
2026-02-26T04:07:42.804Z [msteams] final reply failed: Cannot perform 'get' on a proxy that has been revoked
2026-02-26T04:09:17.740Z [msteams] final reply failed: Cannot perform 'set' on a proxy that has been revoked

Impact and severity

affected teams usage

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions