Skip to content

fix(googlechat): fold Codex-harness progress and route human DMs as groups - #31

Merged
jai merged 6 commits into
maintain/googlechat-patch-stack-2026-10-17from
fix/shared-human-dm-groups
Nov 11, 2026
Merged

jai merged 6 commits into
maintain/googlechat-patch-stack-2026-10-17from
fix/shared-human-dm-groups

Conversation

@jai

@jai jai commented Nov 11, 2026

Copy link
Copy Markdown
Owner

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 saw sourceReplyFinal=undefined and a session key shaped differently from the monitor's (…:googlechat:product-engineering:direct:users/… vs agent:product-engineering:main):

  • The message tool now stamps a host-set openclawSourceReplyProgress param on progress sends, deleting any model-supplied copy first.
  • The registry matches by account, space and delivered thread, preferring the same session.
  • A progress send that still misses the activity message logs one line.

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; tsgo core and extensions clean.

jai and others added 5 commits November 11, 2026 14:46
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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T08:47:34.269362Z 6dedc81 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +56 to +58
// 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +81 to +82
// Mirrors core's SOURCE_REPLY_PROGRESS_PARAM marker for progress sends.
const progressSend = sourceReplyFinal === false || params.openclawSourceReplyProgress === true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@jai

jai commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

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.

@jai
jai merged commit e1c1b82 into maintain/googlechat-patch-stack-2026-10-17 Nov 11, 2026
14 of 17 checks passed
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