-
-
Notifications
You must be signed in to change notification settings - Fork 52.9k
Description
Summary
Google Chat Space @mention messages are silently dropped when botUser is not configured in the googlechat channel config. No errors, no warnings, no verbose logs suggesting the issue. DMs work perfectly, making the failure mode extremely confusing to debug.
This cost ~6-8 hours of debugging time across multiple sessions.
Environment
- OpenClaw version: 2026.2.6-3
- Channel: Google Chat (HTTP webhook, service account auth)
- Audience type:
app-url
Steps to Reproduce
- Set up Google Chat bot with service account and webhook
- Configure googlechat channel in openclaw.json without
botUserfield - Set
groupPolicy: "open"(or any policy that allows group messages) - Send a DM to the bot - works fine
- @mention the bot in a Space - silently dropped, no response, no error
Root Cause
In extensions/googlechat/src/monitor.ts, the extractMentionInfo() function checks annotations against:
"users/app"(hardcoded)botUserfrom config (if set)
Google Chat webhook events send the bot's numeric user ID in annotations (e.g. users/112986094383820258709), NOT users/app. The users/app alias only works in API calls, not in webhook event payloads.
Without botUser configured, wasMentioned is always false for Space messages. Since requireMention defaults to true, the mention gate at line ~559 returns shouldSkip: true, and the message is silently dropped.
DMs bypass this entirely because isGroup=false skips the mention gating block.
Why This Is Hard to Debug
- Zero error output — the message is dropped inside
processMessageWithPipelinewith no log logVerboseis gated — the "drop group message (mention required)" log only fires ifshouldLogVerbose()returns true, which it doesn't by default- DMs work perfectly — this creates false confidence that auth, webhook, and the pipeline are all working
- Auth passes — the webhook event arrives, auth verifies, event type is MESSAGE — everything looks correct until the silent mention gate drop
- No setup validation — OpenClaw doesn't warn at startup that
botUseris not set for googlechat
Suggested Improvements
-
Warn at startup if googlechat is enabled with
groupPolicy != "disabled"andrequireMention != falsebutbotUseris not configured:[googlechat] WARNING: botUser not configured — Space @mentions will not be detected. Set botUser to your bot's user ID or set requireMention: false -
Log when mention gate drops a message even without verbose mode — at least at INFO level:
[googlechat] dropped group message: mention required but not detected (space=spaces/XXX, botUser=not-set, annotations=1 USER_MENTION found) -
Auto-detect botUser from the first webhook event's annotations — if an annotation has
userMention.user.type === "BOT", that's the bot's user ID. Could be cached and/or suggested to the user. -
Document botUser requirement prominently in Google Chat setup docs — it's not obvious that this field is effectively required for Space functionality.
Workaround
Add botUser to the googlechat channel config with the bot's numeric user ID:
"googlechat": {
"botUser": "users/<numeric-bot-id>",
...
}To find the bot user ID: temporarily set "requireMention": false, @mention the bot in a Space, and check message.annotations in the logs for userMention.user.name.