openclaw - ✅(Solved) Fix Google Chat add-on payload parsing rejects valid space events and wildcard group allowlist still blocks senders [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

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…
GitHub stats
openclaw/openclaw#65007Fetched 2026-04-12 13:26:05
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1referenced ×1

Google Chat spaces were unreliable or broken in several ways on OpenClaw 2026.4.10:

  1. Chat add-on style payloads in Google Chat were parsed too narrowly, which caused valid events to be rejected as invalid payload.
  2. groups: { "*": { requireMention: true } } did not actually behave as documented unless a separate group sender allowlist was also present.
  3. Replies in spaces could fail with Google Chat API 400: The request contains an invalid thread resource name.

Root Cause

Root Causes

Fix Action

Fixed

PR fix notes

PR #65058: fix(googlechat): accept add-on space lifecycle payload variants

Description (problem / solution / changelog)

The Google Chat add-on payload parser only handled chat.messagePayload, rejecting valid addedToSpacePayload and removedFromSpacePayload events as "invalid payload".

Expand parseGoogleChatInboundPayload to recognise all three payload variants and map to correct event types (MESSAGE, ADDED_TO_SPACE, REMOVED_FROM_SPACE).

Partially addresses #65007

Changed files

  • extensions/googlechat/src/monitor-webhook.ts (modified, +31/-13)

Code Example

Google Chat API 400:
The request contains an invalid thread resource name

---

rawObj.commonEventObject?.hostApp === "CHAT" && rawObj.chat?.messagePayload

---

const senderGroupPolicy =
  groupConfigResolved.allowlistConfigured && normalizedGroupUsers.length === 0
    ? groupPolicy
    : resolveSenderScopedGroupPolicy({ groupPolicy, groupAllowFrom: normalizedGroupUsers });

---

thread: payload.replyToId

---

spaces/<space>/threads/<thread>
RAW_BUFFERClick to expand / collapse

Summary

Google Chat spaces were unreliable or broken in several ways on OpenClaw 2026.4.10:

  1. Chat add-on style payloads in Google Chat were parsed too narrowly, which caused valid events to be rejected as invalid payload.
  2. groups: { "*": { requireMention: true } } did not actually behave as documented unless a separate group sender allowlist was also present.
  3. Replies in spaces could fail with Google Chat API 400: The request contains an invalid thread resource name.

Environment

  • OpenClaw 2026.4.10
  • Global install under /opt/homebrew/lib/node_modules/openclaw
  • Google Chat channel with audienceType: "app-url"
  • Google Chat space routing to a restricted team agent

Symptoms

  • Google Cloud logs showed invalid payload / Can't handle the app's response for some space events.
  • Google Chat space mentions reached the gateway but were blocked until botUser was set and sender policy was relaxed.
  • After delivery into the agent worked, some replies still failed with:
Google Chat API 400:
The request contains an invalid thread resource name

Root Causes

1. Add-on payload parsing too narrow

In parseGoogleChatInboundPayload, the code only handled:

rawObj.commonEventObject?.hostApp === "CHAT" && rawObj.chat?.messagePayload

That misses other valid Chat payloads such as:

  • chat.addedToSpacePayload
  • chat.removedFromSpacePayload

2. Group sender policy contradicted docs

The runtime used:

const senderGroupPolicy =
  groupConfigResolved.allowlistConfigured && normalizedGroupUsers.length === 0
    ? groupPolicy
    : resolveSenderScopedGroupPolicy({ groupPolicy, groupAllowFrom: normalizedGroupUsers });

With groupPolicy: "allowlist" and groups["*"] configured, but no explicit groupAllowFrom, that effectively kept sender policy at allowlist and blocked group messages.

This contradicts the documented pattern that groups: { "*": { requireMention: true } } should allow all groups while only replying on mention.

3. Outbound reply used the wrong thread identifier

Google Chat inbound context stores:

  • currentMessageId as the message id
  • ReplyToId as the thread resource

When an agent used [[reply_to_current]], the reply pipeline could prefer the current message id. The Google Chat sender then passed that value as:

thread: payload.replyToId

which is invalid when the value is a message resource instead of:

spaces/<space>/threads/<thread>

Working Local Fix

The local fix that worked was:

  1. Accept add-on payload variants in parseGoogleChatInboundPayload
  2. Resolve sender group policy directly from resolveSenderScopedGroupPolicy
  3. Normalize outbound Google Chat thread ids and prefer a valid spaces/.../threads/... resource

Suggested Upstream Fix

  • Expand Google Chat add-on payload parsing in parseGoogleChatInboundPayload
  • Remove the sender-policy special case that preserves allowlist when groups are configured but groupAllowFrom is empty
  • In Google Chat outbound replies, validate replyToId and fall back to the inbound thread resource when replyToId is a message id

Extra Note

Mention detection in Google Chat spaces also required setting botUser explicitly to the real bot user resource, for example users/<id>. The docs already hint at this, but the operational requirement is easy to miss during setup.

extent analysis

TL;DR

To fix the Google Chat spaces issues in OpenClaw 2026.4.10, update the parseGoogleChatInboundPayload function to handle additional payload variants, resolve sender group policy directly, and normalize outbound Google Chat thread IDs.

Guidance

  • Update the parseGoogleChatInboundPayload function to accept add-on payload variants such as chat.addedToSpacePayload and chat.removedFromSpacePayload.
  • Resolve sender group policy directly from resolveSenderScopedGroupPolicy to ensure consistent behavior with the documented pattern.
  • Normalize outbound Google Chat thread IDs to prefer a valid spaces/.../threads/... resource, and validate replyToId to fall back to the inbound thread resource when necessary.
  • Set botUser explicitly to the real bot user resource, for example users/<id>, to ensure proper mention detection in Google Chat spaces.

Example

// Updated parseGoogleChatInboundPayload function
if (rawObj.commonEventObject?.hostApp === "CHAT" && 
    (rawObj.chat?.messagePayload || rawObj.chat?.addedToSpacePayload || rawObj.chat?.removedFromSpacePayload)) {
  // Handle valid Chat payloads
}

// Updated sender group policy resolution
const senderGroupPolicy = resolveSenderScopedGroupPolicy({ groupPolicy, groupAllowFrom: normalizedGroupUsers });

// Normalized outbound Google Chat thread ID
if (payload.replyToId.startsWith('spaces/')) {
  thread: payload.replyToId;
} else {
  // Fall back to inbound thread resource
  thread: `spaces/${spaceId}/threads/${threadId}`;
}

Notes

The suggested fixes assume that the issues are specific to the 2026.4.10 version of OpenClaw and may not apply to other versions. Additionally, the fixes may require further testing and validation to ensure compatibility with other features and configurations.

Recommendation

Apply the suggested fixes to the parseGoogleChatInboundPayload function, sender group policy resolution, and outbound Google Chat thread ID normalization to resolve the issues with Google Chat spaces in OpenClaw 2026.4.10. This approach addresses the root causes of the issues and provides a more robust and consistent behavior for Google Chat integrations.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING