← Back to PRs

#3837: fix(googlechat): space events response and thread reply context

by rehanchrl open 2026-01-29 07:17 View on GitHub →
channel: googlechat
## 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