-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
Description
Bug Description
Google Chat DM messages from paired users always route to agent:main:main regardless of binding configuration. Channel-level, peer-level, and even default-agent-swap bindings are all ignored.
Environment
- OpenClaw version: 2026.2.2-3
- OS: macOS (Darwin 25.2.0 arm64)
- Node: v22.22.0
Configuration
agents: {
list: [
{ id: "main", name: "main", workspace: "~/projects/clawd" },
{ id: "work", name: "telenor-tom", workspace: "~/projects/telenor-tom" },
],
},
bindings: [
{ agentId: "work", match: { channel: "googlechat" } },
],
channels: {
googlechat: {
enabled: true,
groupPolicy: "allowlist",
groups: { "spaces/AAQAxyffo14": { allow: true, requireMention: true } },
serviceAccountFile: "/path/to/service-account.json",
audienceType: "app-url",
audience: "https://gateway.example.com/googlechat",
},
},Steps to Reproduce
- Configure a second agent (
work) with its own workspace andauth-profiles.json - Add a binding:
{ agentId: "work", match: { channel: "googlechat" } } - Pair a Google Chat user (DM)
- Send a DM from Google Chat
Expected Behavior
Message should route to agent:work:googlechat:dm:<spaceId> (per the docs: "DMs use session key agent:<agentId>:googlechat:dm:<spaceId>").
Actual Behavior
Message always routes to agent:main:main with ~5-6 minute delay (suggesting the system tries the binding, times out, then falls back).
What I've Tried
All of the following were tested with gateway restarts between each:
- Channel-level binding:
{ channel: "googlechat" }→ still routes to main - Peer-level bindings (level 1):
{ channel: "googlechat", peer: { kind: "dm", id: "spaces/<id>" } }{ channel: "googlechat", peer: { kind: "group", id: "spaces/<id>" } }
→ still routes to main
- Default agent swap: Set
workasdefault: trueand first in list → still routes toagent:main:main - Reset main session delivery context from googlechat to telegram → gateway overwrites it back
- Verified work agent works independently:
openclaw agent --agent work -m "test" --local✅ responds - Verified work agent can deliver via googlechat:
openclaw agent --agent work -m "test" --channel googlechat --deliver✅ creates session
Diagnostic Details
openclaw agents list --bindingscorrectly shows:work: googlechat peer=dm:spaces/<id>- Work agent
sessionsCount: 0inopenclaw status --json— never receives an inbound message - Pairing data at
~/.openclaw/credentials/googlechat-allowFrom.jsonhas the user - Log shows
lane=session:agent:main:mainwithmessageChannel=googlechatfor every Google Chat DM - No Google Chat-specific session (
googlechat:dm:*) is ever created in any agent's session store - Telegram binding for another agent (
petterwith separateaccountId) works correctly
Hypothesis
Google Chat DM handling for paired users may bypass the binding evaluation layer entirely, collapsing directly to the default agent's main session. This appears specific to Google Chat — Telegram bindings with accountId work as expected.