#3837: fix(googlechat): space events response and thread reply context
channel: googlechat
Cluster:
WhatsApp and Google Chat Fixes
## Summary
Two critical fixes for Google Chat reliability and context awareness.
## Fix 1: Space Events Response
**Problem:** Google Chat shows "Can't handle the app's response" error when bot is added to spaces or non-MESSAGE events occur.
**Root Cause:** Google Chat requires a proper JSON response body for space events (ADDED_TO_SPACE, etc.), not just empty '{}'.
**Solution:** Return acknowledgment message for non-MESSAGE events in groups before async processing.
## Fix 2: Thread Reply Context
**Problem:** Agent cannot distinguish thread replies from root messages or see quoted message context.
**Root Cause:** Missing threadReply and quotedMessageMetadata fields in message handling.
**Solution:** Added fields to types and passed to agent context.
## Files Changed
- extensions/googlechat/src/types.ts - Add threadReply and quotedMessageMetadata fields
- extensions/googlechat/src/monitor.ts - Space events response fix + context passing
## Related
Fixes documented in docs/googlechat-spaces-fix.md and docs/googlechat-thread-context.md
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR improves Google Chat reliability and context by (1) returning a JSON response for non-`MESSAGE` space events to avoid Google Chat “Can’t handle the app’s response” errors, and (2) enriching inbound context for thread replies/quoted messages via new message fields and additional API lookups.
The changes are primarily in the Google Chat extension runtime (`extensions/googlechat/src/monitor.ts` + `api.ts` + new `space-cache.ts`) and the shared config types/schemas (`src/config/types.googlechat.ts`, `src/config/zod-schema.providers-core.ts`).
<h3>Confidence Score: 3/5</h3>
- Moderately safe to merge, but there is a notable behavior change in how non-message space events trigger outbound replies.
- The main risk is the new unconditional acknowledgment message for non-`MESSAGE` group events, which can bypass existing space allowlist/disable policies and cause unexpected outbound posts. The rest of the changes are additive (new optional fields, best-effort context fetches) and should be low risk.
- extensions/googlechat/src/monitor.ts
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#3727: fix(googlechat): space type detection for modern API
by gustavozirbes · 2026-01-29
85.3%
#7940: fix(googlechat): add messageReplyOption for proper thread replies
by sapko7a · 2026-02-03
79.6%
#13829: fix(googlechat): detect bot @mentions via user.type when botUser no...
by mcaxtr · 2026-02-11
77.7%
#19043: googlechat: fix runtime.error signature in startup error handling
by markesphere · 2026-02-17
76.4%
#15643: fix(googlechat): DM's works, but groups don't - return add-on actio...
by kamil-rudnicki · 2026-02-13
76.4%
#20047: fix(googlechat): typing indicator shows 'OpenClaw' instead of agent...
by xinhuagu · 2026-02-18
76.1%
#14309: fix(ui): resolve chat event session key mismatch
by justonlyforyou · 2026-02-11
75.4%
#4878: fix: string/type handling and API fixes (#4537, #4380, #4373, #4547...
by lailoo · 2026-01-30
74.5%
#3721: fix(ui): webchat not displaying chat responses
by maxmaxrouge-rgb · 2026-01-29
74.5%
#14940: fix(googlechat): convert Markdown formatting to Google Chat markup
by brandonwise · 2026-02-12
74.2%