Repository navigation
fix(googlechat): fold Codex-harness progress and route human DMs as groups - #31
Conversation
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.
Codex-harness message-tool sends reach the Google Chat action without the trusted turn context, so sourceReplyFinal was undefined and the session key had a different shape from the monitor's. The message tool now stamps a host-set openclawSourceReplyProgress marker on final:false sends (deleting any model-supplied copy), and the registry matches by delivered thread, preferring the same session.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6dedc8102c
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Session keys can differ in shape for one turn, so the thread decides and | ||
| // a same-session activity wins when two turns share the thread. | ||
| match = activity; |
There was a problem hiding this comment.
Refuse ambiguous progress-activity matches
When two turns are active in the same Google Chat thread and the message-tool session key matches neither activity—the Codex-harness mismatch this fallback is intended to handle—the loop silently selects the most recently registered activity. A progress send from the first turn can therefore overwrite the second turn's typing/status message. Only fall back by thread when exactly one matching activity exists, or carry a stable turn identity that distinguishes concurrent turns.
AGENTS.md reference: AGENTS.md:L7-L9
Useful? React with 👍 / 👎.
| // Mirrors core's SOURCE_REPLY_PROGRESS_PARAM marker for progress sends. | ||
| const progressSend = sourceReplyFinal === false || params.openclawSourceReplyProgress === true; |
There was a problem hiding this comment.
Expose the progress marker through the Plugin SDK
The extension now consumes a core-owned protocol value by duplicating the raw openclawSourceReplyProgress string, while the authoritative constant lives under src/channels/**. Because no typed SDK contract connects them, a core-side rename or payload change will still compile and silently stop Google Chat progress folding; publish this marker through a typed Plugin SDK channel seam and consume that shared definition here.
AGENTS.md reference: extensions/AGENTS.md:L44-L50
Useful? React with 👍 / 👎.
|
Codex review (CLI): fixed the concurrent-turn finding in 1c3b621 (thread fallback only when one activity owns the thread). Kept the member-lookup-failure → direct default on purpose: live payloads always carry singleUserBotDm for the 1:1 app DM, and defaulting to group would put the owner's own DM behind the group mention gate. |
e1c1b82
into
maintain/googlechat-patch-stack-2026-10-17
Brings Cosmo's DM fix onto the shared stack, so every agent can run one build, and fixes layer 12 for Codex-harness agents.
Layer 12 fix. A live test on Iris (shared gateway) showed
message(send, final=false)progress still posting separately. The Google Chat action sawsourceReplyFinal=undefinedand a session key shaped differently from the monitor's (…:googlechat:product-engineering:direct:users/…vsagent:product-engineering:main):openclawSourceReplyProgressparam on progress sends, deleting any model-supplied copy first.Verified live: after this change, an Iris DM turn left only its answer; the progress update was edited into the activity message and removed with it.
Layer 13. Port of #28: a DM between humans with the Chat app added routes as a group, not the owner's 1:1 app DM, and unnamed DMs and group chats are labelled with their members.
Checks: Google Chat 304/304 and message-tool core tests pass;
tsgocore and extensions clean.