Skip to content

Google Chat: Space @mentions silently dropped when botUser not configured #12323

@puneet1409

Description

@puneet1409

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

  1. Set up Google Chat bot with service account and webhook
  2. Configure googlechat channel in openclaw.json without botUser field
  3. Set groupPolicy: "open" (or any policy that allows group messages)
  4. Send a DM to the bot - works fine
  5. @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)
  • botUser from 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

  1. Zero error output — the message is dropped inside processMessageWithPipeline with no log
  2. logVerbose is gated — the "drop group message (mention required)" log only fires if shouldLogVerbose() returns true, which it doesn't by default
  3. DMs work perfectly — this creates false confidence that auth, webhook, and the pipeline are all working
  4. Auth passes — the webhook event arrives, auth verifies, event type is MESSAGE — everything looks correct until the silent mention gate drop
  5. No setup validation — OpenClaw doesn't warn at startup that botUser is not set for googlechat

Suggested Improvements

  1. Warn at startup if googlechat is enabled with groupPolicy != "disabled" and requireMention != false but botUser is 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
    
  2. 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)
    
  3. 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.

  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions