Skip to content

[Bug]: msteams plugin crashes on startup — module singleton mismatch / ships uncompiled TypeScript #53953

@jbonetti

Description

@jbonetti

Bug type

Crash (process/app exits or hangs)

Summary

The msteams channel plugin crash-loops on startup with "MSTeams runtime not initialized" due to the extension shipping uncompiled TypeScript and a module singleton mismatch between the extension and gateway.

Steps to reproduce

Configure channels.msteams in openclaw.json with valid Azure Bot credentials
Start the gateway — observe crash loop on port 3978

Expected behavior

msteams provider starts and listens on port 3978

Actual behavior

Gateway crash-loops with: [msteams] channel exited: MSTeams runtime not initialized
After manually compiling the extension to JS, register(api) IS called and completes successfully — but the gateway's channel provider calls getMSTeamsRuntime() from a separate createPluginRuntimeStore instance (in dist/plugin-sdk/msteams.js) that is never initialized by the extension. Port 3978 never opens.

OpenClaw version

2026.3.11 (NemoClaw managed)

Operating system

Linux arm64 (NVIDIA AI TOP ATOM, kernel 6.17.0-1014-nvidia

Install method

NemoClaw managed (NVIDIA)

Model

anthropic/claude-sonnet-4-6

Provider / routing chain

openclaw -> anthropic (direct)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

[msteams-ext] module loaded
[msteams-ext] register() called, api.runtime: object
[msteams-ext] register() complete
[msteams] starting provider (port 3978)
[msteams] [default] channel exited: MSTeams runtime not initialized
[msteams] [default] auto-restart attempt 2/10 in 10s

Impact and severity

Affected: Any user configuring the msteams channel
Severity: Critical (msteams channel completely non-functional)
Frequency: 100% reproducible
Consequence: Teams bot cannot receive or send messages — channel is unusable on this version

Additional information

Root cause traced via gateway logs and source inspection:

  1. extensions/msteams/index.ts ships as raw TypeScript — Node.js v22 refuses to load it from node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING)
  2. After manually compiling with tsc, register(api) is called correctly, but the runtime singleton set via setMSTeamsRuntime() in the extension's runtime.ts is a different instance from the one checked in plugin-sdk/msteams.js
    Fix: either ship the extension pre-compiled, or expose setMSTeamsRuntime via the plugin-sdk so both the extension and gateway share the same store instance.
    No known workaround without modifying gateway internals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions