openclaw - 💡(How to fix) Fix [Bug]: Google Chat Group Session Key Not Created - Replies Route to Wrong Channel

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When a message is received from a Google Chat group space, the Google Chat plugin fails to create the correct group session key (agent:<agentId>:googlechat:group:<spaceId>). Instead, it creates the default main session key (agent:<agentId>:main). This causes replies to be sent to the wrong channel (WhatsApp) instead of back to Google Chat, because the session's lastRoute points to the most recently active channel (WhatsApp) rather than the message origin channel (Google Chat).

Root Cause

When a message is received from a Google Chat group space, the Google Chat plugin fails to create the correct group session key (agent:<agentId>:googlechat:group:<spaceId>). Instead, it creates the default main session key (agent:<agentId>:main). This causes replies to be sent to the wrong channel (WhatsApp) instead of back to Google Chat, because the session's lastRoute points to the most recently active channel (WhatsApp) rather than the message origin channel (Google Chat).

Fix Action

Fix / Workaround

Workarounds - do not work

Code Example

{
  "bindings": [
    {
      "match": {
        "channel": "whatsapp"
      },
      "agentId": "digital-d"
    },
    {
      "match": {
        "channel": "googlechat",
        "peer": {
          "kind": "group",
          "id": "spaces/AAQA7VDFED"
        }
      },
      "agentId": "bot"
    }
  ],
  "channels": {
    "googlechat": {
      "enabled": true,
      "serviceAccountFile": "/home/m/.config/gws/bot-dgx-7f39f25b949d.json",
      "audienceType": "app-url",
      "audience": "https://chat.what.com/googlechat",
      "webhookPath": "/googlechat",
      "dm": {
        "policy": "pairing"
      },
      "groupPolicy": "open",
      "appPrincipal": "117689656528733314485",
      "groups": {
        "spaces/AAQA7VDFED": {
          "enabled": true,
          "requireMention": false
        }
      },
      "groupAllowFrom": [
        "spaces/AAQA7VDFED",
        "users/101601046725645281676"
      ]
    }
  },
  "session": {
    "dmScope": "per-account-channel-peer"
  }
}
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

Yes

Summary

When a message is received from a Google Chat group space, the Google Chat plugin fails to create the correct group session key (agent:<agentId>:googlechat:group:<spaceId>). Instead, it creates the default main session key (agent:<agentId>:main). This causes replies to be sent to the wrong channel (WhatsApp) instead of back to Google Chat, because the session's lastRoute points to the most recently active channel (WhatsApp) rather than the message origin channel (Google Chat).

Steps to reproduce

  1. Configure OpenClaw with WhatsApp and Google Chat channels
  2. Add a binding to route Google Chat groups to a specific agent
  3. Send a message @bot hello in the Google Chat group space
  4. Check logs for session key: sessionKey=agent:botmain (should be agent:bot:googlechat:group:spaces/AAQA7VDFED)
  5. Observe reply is sent to WhatsApp instead of Google Chat

Expected behavior

According to Channel Routing docs:

  • Groups should use session key: agent:<agentId>:<channel>:group:<id>
  • For Google Chat: agent:bot:googlechat:group:spaces/AAQA7VDFED
  • Replies should be routed back to the channel where the message originated

Actual behavior

  • Session key created: agent:bot:main (incorrect)
  • Reply channel: WhatsApp (+15553785295) instead of Google Chat
  • Logs show: sessionKey=agent:bott:main for all Google Chat group messages

OpenClaw version

2026.5.7

Operating system

Linux 6.17.0-1014-nvidia (arm64) v24.13.1

Install method

Opencla update

Model

2026.5.7

Provider / routing chain

GoogleChat plugin

Additional provider/model setup details

  • OpenClaw Version: 2026.5.7
  • OS:** Linux 6.17.0-1014-nvidia (arm64)
  • Node:** v24.13.1
  • Hardware:** NVIDIA DGX Spark (Founder Edition)
  • Channels:** WhatsApp (selfChatMode), Google Chat (webhook)

Logs, screenshots, and evidence

{
  "bindings": [
    {
      "match": {
        "channel": "whatsapp"
      },
      "agentId": "digital-d"
    },
    {
      "match": {
        "channel": "googlechat",
        "peer": {
          "kind": "group",
          "id": "spaces/AAQA7VDFED"
        }
      },
      "agentId": "bot"
    }
  ],
  "channels": {
    "googlechat": {
      "enabled": true,
      "serviceAccountFile": "/home/m/.config/gws/bot-dgx-7f39f25b949d.json",
      "audienceType": "app-url",
      "audience": "https://chat.what.com/googlechat",
      "webhookPath": "/googlechat",
      "dm": {
        "policy": "pairing"
      },
      "groupPolicy": "open",
      "appPrincipal": "117689656528733314485",
      "groups": {
        "spaces/AAQA7VDFED": {
          "enabled": true,
          "requireMention": false
        }
      },
      "groupAllowFrom": [
        "spaces/AAQA7VDFED",
        "users/101601046725645281676"
      ]
    }
  },
  "session": {
    "dmScope": "per-account-channel-peer"
  }
}

Impact and severity

  • Users sending messages to Google Chat groups receive replies on WhatsApp instead
  • Privacy leak: sensitive content sent to wrong recipients
  • Context confusion: conversation context from one channel appears in another
  • Multiple users affected (see related issues #9198, #45514)

Additional information

The Google Chat plugin is not creating proper group session keys for group messages. The binding routes to the correct agent (verdant), but the session key is determined by the channel plugin, not the binding. The channel plugin collapses all Google Chat group messages to the main session instead of creating isolated group sessions.

Workarounds - do not work

  1. Disable other channels temporarily (from issue #45514): User must disable other channels to receive replies correctly
  2. Use session.dmScope: per-channel-peer (from issue #4530): Isolates sessions per channel+sender (already configured but not working for Google Chat groups)

Suggested Fix

  1. Fix the Google Chat plugin to create proper group session keys: agent:<agentId>:googlechat:group:<spaceId>
  2. Ensure the session key is created at inbound webhook ingress from the Google Chat event payload
  3. Route replies back to the channel specified in the session key, not the most recently active channel
  4. Add channel isolation to prevent cross-channel context switching during processing

References

  • Channel Routing docs
  • Google Chat docs
  • Issue #9198: Google Chat DM routing ignores bindings
  • Issue #45514: Multi-channel session routing - replies go to wrong channel
  • Issue #4530: Multi-channel response routing leaks to wrong channel
  • Issue #69422: Google Chat outbound: thread/reply routing metadata leaks

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

According to Channel Routing docs:

  • Groups should use session key: agent:<agentId>:<channel>:group:<id>
  • For Google Chat: agent:bot:googlechat:group:spaces/AAQA7VDFED
  • Replies should be routed back to the channel where the message originated

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Google Chat Group Session Key Not Created - Replies Route to Wrong Channel