-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
msteams: typing indicator hits 429 rate limit during long agent runs #53184
Description
Bug
During long-running agent sessions (browser automation, complex tool chains), the MS Teams typing indicator fires in a tight loop without any throttle. This quickly hits Teams' API rate limit (HTTP 429 "API calls quota exceeded"), then falls back to proactive messaging which also loops, creating an escalating spiral.
Result: Endless "typing..." indicator in Teams, no actual message delivered, gateway stuck until restarted.
Evidence
Gateway logs show dozens of these per second:
msteams typing action=start failed: Error: Unknown error type: Request failed with status code 429"API calls quota exceeded"
turn context revoked, sending typing via proactive messaging
This happened twice in one day on the same group chat.
Root cause
sendTypingIndicator in extensions/msteams/src/reply-dispatcher.ts has no rate limiting. It fires every time the typing callback is invoked by the core SDK, which can be very frequent during long runs. There is also no backoff after a 429, and no mechanism to stop typing after the response is delivered.
Fix
We patched reply-dispatcher.ts with three changes:
- Throttle: typing indicator fires at most once every 3 seconds (
TYPING_MIN_INTERVAL_MS = 3000) - 429 backoff: after a 429 error, typing is suppressed for 30 seconds (
TYPING_BACKOFF_MS = 30000) - Stop flag:
typingStoppedis set totruewhenmarkDispatchIdle()is called, preventing typing from continuing after the response is sent
The fix is minimal and only touches the typing path. No other behavior is changed.
Tested
- Long-running agent task in Teams group chat no longer causes 429 spiral
- Typing indicator shows during processing and stops after response
- Messages deliver successfully
- No typing indicator lingering after response is sent
Environment
- OpenClaw 2026.3.22
- MS Teams plugin (local extension)
- Single-tenant Azure Bot, free tier