fix(googlechat): support spaceType field for DM vs Space detection - #58993
vincentkoc merged 7 commits into
Conversation
Greptile SummaryThis PR fixes a DM detection regression in the Google Chat integration caused by the deprecation of the Changes:
The logic is sound: all three conditions must be "not a DM signal" for the message to be classified as a group message, so any single DM indicator short-circuits to Confidence Score: 5/5This PR is safe to merge — it is a targeted, well-reasoned bug fix with no regressions introduced. The fix correctly uses conjunction (&&) so that any single DM indicator (type === 'DM', spaceType === 'DIRECT_MESSAGE', or singleUserBotDm === true) sets isGroup = false. All edge cases (legacy-only payload, modern-only payload, mixed payload, empty payload) are handled correctly. The type additions are minimal and safe. No existing behaviour is broken for group/space messages. All remaining observations are P2. No files require special attention. Reviews (1): Last reviewed commit: "fix(googlechat): use spaceType and singl..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Updates the Google Chat channel’s DM vs Space (group) detection to support newer Google Chat API payloads where space.type is deprecated, preventing inbound messages from being misrouted/dropped due to incorrect classification.
Changes:
- Extend
GoogleChatSpacewithspaceTypeandsingleUserBotDmfields. - Update inbound message classification to fall back through
type,spaceType, andsingleUserBotDmwhen determining group vs DM.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| extensions/googlechat/src/types.ts | Adds newer Google Chat space fields required to interpret modern payloads. |
| extensions/googlechat/src/monitor.ts | Updates DM/group detection logic to use legacy + modern API fields for correct routing and policy evaluation. |
|
Codex review: needs maintainer review before merge. Reviewed June 22, 2026, 4:37 AM ET / 08:37 UTC. Summary PR surface: Source -41, Tests +289, Other +24. Total +272 across 26 files. Reproducibility: Do we have a high-confidence way to reproduce the issue? Yes at source/report level: current main and Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch so the merge result is only the Google Chat classifier, type, and test changes, then land the scoped compatibility fix while keeping broader Space/group ingress work on the canonical issue. Do we have a high-confidence way to reproduce the issue? Do we have a high-confidence way to reproduce the issue? Yes at source/report level: current main and Is this the best way to solve the issue? Is this the best way to solve the issue? Yes for the scoped bug: classifying the Google Chat AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d9a38130b1a8. Label changesLabel justifications:
Evidence reviewedPR surface: Source -41, Tests +289, Other +24. Total +272 across 26 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Reproduction confirmed on v2026.5.7 — additional diagnostic detail in support of PR #58993 Hit this exact issue this week. Posting the detail in case it's useful as the "real behavior proof" Environment
Symptoms
What Google's side sees For the Workspace Add-on project, Cloud Logging shows Google attempting delivery and getting 400s back: Log type: For the standard Chat API project (add-on flag unticked), Cloud Logging shows zero error entries for Space @mentions even with "Log errors to Cloud Logging" enabled before re-adding the bot. The Chat API metrics page shows successful outbound calls ( What OpenClaw's side sees Running Other configurations ruled out (saves the next person time) The following were tried during debugging and made no difference:
Final config that produces the bug:
Why this lines up with the fix This PR's claim is that with modern Google Chat API payloads (where Note: still reproduces on |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
Hey, but I added a comment with all details: #58993 (comment) |
|
Heads up: this PR needs to be updated against current |
|
This pull request has been automatically marked as stale due to inactivity. |
b7c13d5 to
dac578e
Compare
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
2fde296 to
c4b1183
Compare
The Google Chat API deprecated the `type` field on Space objects in
favor of `spaceType` ("DIRECT_MESSAGE" | "SPACE") and the boolean
`singleUserBotDm`. When the legacy `type` field is absent, the
existing check `spaceType !== "DM"" always evaluates to true, causing
all messages (including DMs) to be treated as group messages. Group
messages are then subject to group policy evaluation and may be
silently dropped if no group allowlist is configured.
The fix checks all three fields: legacy `type`, modern `spaceType`,
and `singleUserBotDm`, so both old and new API payload formats work.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c4b1183 to
c90c7b7
Compare
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes are blockedOpenClaw does not accept dependency graph changes through PRs unless a repository admin or security explicitly authorizes the current head SHA. Dependency updates are generated internally by maintainers so external PRs cannot change the resolved graph. Detected dependency graph changes:
To remove lockfile changes, restore them from the target branch: git fetch origin
git checkout 'origin/main' -- 'extensions/clickclack/npm-shrinkwrap.json' 'extensions/fireworks/npm-shrinkwrap.json' 'extensions/irc/npm-shrinkwrap.json' 'extensions/mattermost/npm-shrinkwrap.json' 'extensions/moonshot/npm-shrinkwrap.json' 'extensions/searxng/npm-shrinkwrap.json' 'extensions/signal/npm-shrinkwrap.json' 'extensions/sms/npm-shrinkwrap.json' 'extensions/tavily/npm-shrinkwrap.json' 'extensions/tencent/npm-shrinkwrap.json' 'extensions/venice/npm-shrinkwrap.json' 'extensions/vercel-ai-gateway/npm-shrinkwrap.json' 'extensions/zai/npm-shrinkwrap.json'
git commit -m 'chore: remove dependency lockfile change'
git pushIf this PR intentionally needs a dependency graph change, ask a repository admin or member of The action will approve the current head SHA ( |
|
Merged via squash.
Thanks @Starhappysh! |
What Problem This Solves
Modern Google Chat direct messages can omit the deprecated
typefield. Without a modern-field classifier, those DMs are treated as groups, entering group access policy and the group session route instead of the direct route.Evidence
corepack pnpm test:serial extensions/googlechat/src/monitor.test.tsspaceType: "DIRECT_MESSAGE",singleUserBotDm: true,SPACE, andGROUP_CHATroutes and group-policy behavior.Scope
This fixes modern DM classification only. It does not change how
SPACEorGROUP_CHATmessages pass group policy or create group sessions, so #58514 remains open.Verification
corepack pnpm test:serial extensions/googlechat/src/monitor.test.tson Blacksmith Testbox.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main