Fix Teams plugin: ship required @microsoft/agents-hosting deps in bundled installs#16606
Fix Teams plugin: ship required @microsoft/agents-hosting deps in bundled installs#16606daocoding wants to merge 1 commit intoopenclaw:mainfrom
Conversation
bfc1ccb to
f92900f
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Hi @daocoding — thanks for the submission. I’m the new Microsoft Teams maintainer for OpenClaw. Please give me a day or two to work through the open Teams backlog. Also, join the Twitter community for daily MS Teams feedback + updates: https://x.com/i/communities/2031170403607974228 |
1 similar comment
|
Hi @daocoding — thanks for the submission. I’m the new Microsoft Teams maintainer for OpenClaw. Please give me a day or two to work through the open Teams backlog. Also, join the Twitter community for daily MS Teams feedback + updates: https://x.com/i/communities/2031170403607974228 |
Bundled extensions ship inside the openclaw package (via the files array), but their node_modules are not included. In global/Homebrew installs, Node module resolution cannot find @microsoft/agents-hosting because it was only declared in the extension's package.json and explicitly allowlisted as an expected gap via rootDependencyMirrorAllowlist. This commit: - Adds @microsoft/agents-hosting ^1.3.1 to the root package.json dependencies so it is installed alongside openclaw in all install modes - Clears the now-stale rootDependencyMirrorAllowlist entry in the msteams extension manifest so the release-check gate will catch future drift - Updates pnpm-lock.yaml to include the new root dependency Fixes the runtime error: Cannot find module '@microsoft/agents-hosting' Supersedes #16606. Refs: #15622, #9357, #17089, #41431
|
Thanks for this PR, @daocoding — the root cause analysis was spot on. The I've opened a fresh maintainer PR at #43761 that builds on your diagnosis with a few adjustments for current main:
The new PR supersedes this one since the branch had drifted from main and needed the additional metadata cleanup. Your contribution identified the problem — thank you. |
Bundled extensions ship inside the openclaw package (via the files array), but their node_modules are not included. In global/Homebrew installs, Node module resolution cannot find @microsoft/agents-hosting because it was only declared in the extension's package.json and explicitly allowlisted as an expected gap via rootDependencyMirrorAllowlist. This commit: - Adds @microsoft/agents-hosting ^1.3.1 to the root package.json dependencies so it is installed alongside openclaw in all install modes - Clears the now-stale rootDependencyMirrorAllowlist entry in the msteams extension manifest so the release-check gate will catch future drift - Updates pnpm-lock.yaml to include the new root dependency Fixes the runtime error: Cannot find module '@microsoft/agents-hosting' Supersedes openclaw#16606. Refs: openclaw#15622, openclaw#9357, openclaw#17089, openclaw#41431
Problem\nOn macOS (Homebrew / global npm installs), the bundled Microsoft Teams channel () can fail at runtime with:\n\n> Cannot find module '@microsoft/agents-hosting'\n\nRoot cause: ships as files, but the root package did not install the runtime deps required by the bundled msteams extension, so Node module resolution fails in global installs.\n\n### Fix\nAdd the required packages to the root so they are installed alongside OpenClaw in all install modes.\n\n### Notes\nThis is intentionally minimal (no runtime behavior changes aside from ensuring deps are present). A follow-up could add a release-check gate to prevent manifests from shipping in bundled extensions and/or change how bundled extensions are packaged.\n\n### How to verify\n- Install OpenClaw globally (npm/Homebrew).\n- Enable/configure msteams.\n- Confirm OpenClaw status
Overview
┌─────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Item │ Value │
├─────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Dashboard │ http://127.0.0.1:18789/ │
│ OS │ macos 26.2 (arm64) · node 24.4.1 │
│ Tailscale │ off │
│ Channel │ stable (default) │
│ Update │ pnpm · npm latest 2026.2.13 │
│ Gateway │ local · ws://127.0.0.1:18789 (local loopback) · reachable 25ms · auth token · macbookpro.lan │
│ │ (192.168.86.24) app unknown macos 26.2 │
│ Gateway service │ LaunchAgent installed · loaded · running (pid 48479, state active) │
│ Node service │ LaunchAgent not installed │
│ Agents │ 2 · 1 bootstrapping · sessions 30 · default main active just now │
│ Memory │ 16 files · 16 chunks · sources memory · plugin memory-core · vector ready │
│ Probes │ enabled │
│ Events │ none │
│ Heartbeat │ 30m (main), disabled (dao) │
│ Last heartbeat │ sent · 7m ago ago · msteams · account default │
│ Sessions │ 30 active · default claude-opus-4-6-thinking (200k ctx) · 2 stores │
└─────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────┘
Security audit
Summary: 1 critical · 2 warn · 1 info
CRITICAL Telegram DMs are open
channels.telegram.dmPolicy="open" allows anyone to DM the bot.
Fix: Use pairing/allowlist; if you really need open DMs, ensure channels.telegram.allowFrom includes "*".
WARN Extension plugin tools may be reachable under permissive tool policy
Enabled extension plugins: msteams. Permissive tool policy contexts: - default - agents.list.main - agents.list.Dao
Fix: Use restrictive profiles (
minimal/coding) or explicit tool allowlists that exclude plugin tools for agents handling untrusted input.WARN Telegram DMs share the main session
Multiple DM senders currently share the main session, which can leak context across users.
Fix: Run: openclaw config set session.dmScope "per-channel-peer" (or "per-account-channel-peer" for multi-account channels) to isolate DM sessions per sender.
Full report: openclaw security audit
Deep probe: openclaw security audit --deep
Channels
┌─────────────────┬─────────┬────────┬────────────────────────────────────────────────────────────────────────────────┐
│ Channel │ Enabled │ State │ Detail │
├─────────────────┼─────────┼────────┼────────────────────────────────────────────────────────────────────────────────┤
│ Telegram │ ON │ OK │ token config (8412…TvvE · len 46) · accounts 1/1 │
│ Microsoft Teams │ ON │ OK │ configured │
└─────────────────┴─────────┴────────┴────────────────────────────────────────────────────────────────────────────────┘
Sessions
┌──────────────────────────────────────────────────┬────────┬──────────┬──────────────────────────┬───────────────────┐
│ Key │ Kind │ Age │ Model │ Tokens │
├──────────────────────────────────────────────────┼────────┼──────────┼──────────────────────────┼───────────────────┤
│ agent:main:main │ direct │ just now │ claude-opus-4-6-thinking │ unknown/200k (?%) │
│ agent:main:msteams:group:19:7ef… │ group │ just now │ gpt-5.3-codex │ 171k/272k (63%) │
│ agent:dao:main │ direct │ 1m ago │ claude-opus-4-6-thinking │ unknown/200k (?%) │
│ agent:dao:cron:f92ee46a-f151-4e… │ direct │ 2m ago │ gpt-5.3-codex │ 13k/272k (5%) │
│ agent:dao:cron:f92ee46a-f151-4e… │ direct │ 2m ago │ gpt-5.3-codex │ 13k/272k (5%) │
│ agent:dao:cron:f92ee46a-f151-4e… │ direct │ 3h ago │ gpt-5.3-codex │ 13k/272k (5%) │
│ agent:dao:cron:f92ee46a-f151-4e… │ direct │ 4h ago │ gpt-5.3-codex │ 14k/272k (5%) │
│ agent:dao:cron:f92ee46a-f151-4e… │ direct │ 4h ago │ gpt-5.3-codex │ 14k/272k (5%) │
│ agent:dao:cron:f92ee46a-f151-4e… │ direct │ 4h ago │ gpt-5.3-codex │ 14k/272k (5%) │
│ agent:dao:cron:f92ee46a-f151-4e… │ direct │ 5h ago │ gpt-5.3-codex │ 17k/272k (6%) │
└──────────────────────────────────────────────────┴────────┴──────────┴──────────────────────────┴───────────────────┘
Health
┌─────────────────┬───────────┬───────────────────────────────────────────────────────────────────────────────────────┐
│ Item │ Status │ Detail │
├─────────────────┼───────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ Gateway │ reachable │ 420ms │
│ Telegram │ OK │ ok (@assistaobot:default:219ms) │
│ Microsoft Teams │ OK │ ok (default:default:ok) │
└─────────────────┴───────────┴───────────────────────────────────────────────────────────────────────────────────────┘
FAQ: https://docs.openclaw.ai/faq
Troubleshooting: https://docs.openclaw.ai/troubleshooting
Next steps:
Need to share? openclaw status --all
Need to debug live? openclaw logs --follow
Need to test channels? openclaw status --deep shows Microsoft Teams: OK and no missing-module error.
Greptile Summary
Fixes a runtime
Cannot find module '@microsoft/agents-hosting'crash that occurs when the bundled msteams extension is used via global npm or Homebrew installs. The root cause is that bundled extensions ship as files inside the mainopenclawpackage (via thefiles: ["extensions/"]entry), but theirnode_modulesare not included — so Node's module resolution can't find@microsoft/agents-hosting*unless those packages are also declared in the rootpackage.json.@microsoft/agents-hosting,@microsoft/agents-hosting-express, and@microsoft/agents-hosting-extensions-teams(^1.2.3) to rootdependencies, matching the versions already declared inextensions/msteams/package.jsonpackage.json") as a pragmatic fix for the bundled install path — the PR description notes a follow-up to improve how bundled extensions are packagedpnpm-lock.yamlis not updated in this PR; apnpm installwill be needed to regenerate itConfidence Score: 4/5
pnpm-lock.yamlwill need to be regenerated after merge.Last reviewed commit: 3ecaae4
(2/5) Greptile learns from your feedback when you react with thumbs up/down!
Context used:
dashboard- CLAUDE.md (source)