Skip to content

fix(googlechat): route human DMs with the app added as groups - #28

Closed
jai wants to merge 1 commit into
patch/shared-googlechat-format-2026-11-09from
fix/googlechat-multi-human-dm-routing
Closed

jai wants to merge 1 commit into
patch/shared-googlechat-format-2026-11-09from
fix/googlechat-multi-human-dm-routing

Conversation

@jai

@jai jai commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Problem

Google Chat reports a DM between two humans that has the Chat app added as spaceType: DIRECT_MESSAGE, the same as the owner's 1:1 app DM. The monitor classified both as direct, so with the default dmScope: "main" every such DM joined agent:finn:main. The agent saw only the sender's name and did not know who else was in the room.

Live Chat API reads on jai-work's spaces (app auth):

  • 1:1 Cosmo DM: spaceType: DIRECT_MESSAGE, type: DM, singleUserBotDm: true, one human member.
  • spaces/-dPlRiAAAAE and 11 other human DMs: spaceType: DIRECT_MESSAGE, type: ROOM, no singleUserBotDm, two human members.

Change

  • A DIRECT_MESSAGE space is direct only when it is the 1:1 app DM (singleUserBotDm: true, or deprecated type: DM). type: ROOM routes as a group.
  • If a payload has neither marker, count human members with a cached spaces.members.list call. If the lookup fails, keep the space direct.
  • Payloads without type metadata keep their group default.
  • Unnamed DMs and group chats get a member label, for example DM: Jai Govindani, Badiru Sulaimon Kolapo.
  • findDirectMessage results stay direct for outbound session routing.

On jai-work, groups["*"] (requireMention: true, users: Jai) now applies to these DMs. Jai's @mentions get through. Messages from the other human, or with no mention, are dropped.

The owner's 1:1 DM still uses dmScope: "main".

Validation

  • extensions/googlechat: 36 files, 292 tests pass, including new classification, member-lookup, cache, label and access-policy cases.
  • tsgo and pnpm build: passed on the 2026.9.7 port; rerunning on this base.

Layer 11 of the shared stack (FORK_PATCHES.md). Not deployed.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T12:06:12.757678Z
We couldn’t complete this review. Comment @codex review to try again.
156b4fb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Google Chat reports a DM between two humans that has the Chat app added as
spaceType DIRECT_MESSAGE, the same as the 1:1 app DM. The monitor treated
both as direct, so with the default dmScope "main" every such DM shared the
owner's main session, and the agent saw only the sender's name.

Treat a DIRECT_MESSAGE space as direct only when it is the 1:1 app DM
(singleUserBotDm, or deprecated type DM). type ROOM means a human DM, which
now routes as a group and so applies the groups policy and mention gate.
When a payload carries neither marker, count the space's human members with
a cached members.list call, and keep it direct if the lookup fails. Legacy
payloads without type metadata keep their group default.

Unnamed DMs and group chats are labeled with their members, for example
"DM: Alice, Bob", so the agent knows who is in the conversation.
@jai
jai force-pushed the fix/googlechat-multi-human-dm-routing branch from 156b4fb to 5940265 Compare November 10, 2026 12:52
@jai
jai changed the base branch from fix/googlechat-dm-activity to patch/shared-googlechat-format-2026-11-09 November 10, 2026 12:52
@jai

jai commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #31, which ported this change onto the shared stack (maintain/googlechat-patch-stack-2026-10-17, now e1c1b82 on every agent).

@jai jai closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant