Fix Google Chat message tool thread replies#80996
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 28, 2026, 12:53 AM ET / 04:53 UTC. Summary PR surface: Source +28, Tests +30. Total +58 across 2 files. Reproducibility: yes. Source inspection shows current main records the Google Chat thread in Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this focused adapter fix, or ensure the broader Google Chat thread-delivery branch preserves the same Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main records the Google Chat thread in Is this the best way to solve the issue? Yes. The patch keeps the fix at the Google Chat adapter boundary, uses the existing plugin threading seam, and avoids changing shared reply plumbing or adding new config. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against f7c32fc8befd. Label changesLabel justifications:
Evidence reviewedPR surface: Source +28, Tests +30. Total +58 across 2 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
|
|
Updated the PR body with redacted copied runtime transcript from the failing and passing Google Chat runs, plus the live UI confirmation and the Google Chat API read-back limitation. @clawsweeper re-review |
|
@clawsweeper re-review. I added some new screenshots to the PR body showing the before and after bot behavior |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper PR egg: ✨ hatched 🥚 common Frosted Crabkin. Rarity: 🥚 common. Trait: purrs at green checks. DetailsShare on X: post this hatch
About:
|
|
Heads up: this PR needs to be updated against current |
0eb3dc6 to
b453e42
Compare
|
Maintainer refresh before merge: Behavior addressed: Google Chat message-tool replies now use the inbound Google Chat thread resource as the ambient reply target, so |
Use the Google Chat thread resource as the ambient message-tool reply target so replies stay in the inbound thread. Normalize the current Google Chat space target and let plugin threading adapters explicitly suppress the generic message-id fallback when a provider needs a thread resource instead of a message resource. Co-authored-by: Franco Viotti <[email protected]>
b453e42 to
223fe77
Compare
|
Maintainer proof on refreshed head 223fe77: Behavior addressed: Google Chat message-tool replies use the inbound Google Chat thread resource so implicit replies and [[reply_to_current]] stay in the original thread. Real environment tested: contributor's live Google Chat proof remains in the PR body; maintainer local proof covered the Google Chat adapter and shared reply threading wrapper on the refreshed head. Exact steps or command run after this patch:
Evidence after fix: focused Vitest passed 48 tests in 2 shards; oxfmt, oxlint, and diff check passed; autoreview returned clean with no accepted/actionable findings. Real behavior proof check passed after the PR body was updated with exact real Google Chat evidence fields. Observed result after fix: current space ids are normalized, ReplyToIdFull/ReplyToId provides the thread resource, and the shared wrapper preserves adapter-provided currentMessageId undefined so Google Chat no longer falls back to an invalid message resource when no thread exists. What was not tested: I did not perform a new live Google Chat send from this checkout. Current CI still has unrelated failures in check-test-types and check-dependencies from ui/src/ui/control-ui-vite-config.node.test.ts / ui/src/ui/browser-redact.ts, which are outside this PR diff. |
…0996) Use the Google Chat thread resource as the ambient message-tool reply target so replies stay in the inbound thread. Normalize the current Google Chat space target and let plugin threading adapters explicitly suppress the generic message-id fallback when a provider needs a thread resource instead of a message resource. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Franco Viotti <[email protected]>
…0996) Use the Google Chat thread resource as the ambient message-tool reply target so replies stay in the inbound thread. Normalize the current Google Chat space target and let plugin threading adapters explicitly suppress the generic message-id fallback when a provider needs a thread resource instead of a message resource. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Franco Viotti <[email protected]>
…0996) Use the Google Chat thread resource as the ambient message-tool reply target so replies stay in the inbound thread. Normalize the current Google Chat space target and let plugin threading adapters explicitly suppress the generic message-id fallback when a provider needs a thread resource instead of a message resource. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Franco Viotti <[email protected]>
Summary
replyToModefor Google Chat tool replies.[[reply_to_current]]resolving tospaces/.../threads/....Fixes #80995.
Real behavior proof
Setup:
replyToMode: "all".OpenClawGoogle Chat space, inside an existing Google Chat thread.Before the fix, OpenClaw had the correct inbound Google Chat thread in runtime context, but
message(action=send)still posted outside the thread in the Google Chat UI.Redacted copied runtime transcript from the failing case:
{ "inbound": { "chat_id": "googlechat:spaces/REDACTED_SPACE", "message_id": "spaces/REDACTED_SPACE/messages/REDACTED_MESSAGE", "reply_to_id": "spaces/REDACTED_SPACE/threads/REDACTED_THREAD", "is_group_chat": true }, "tool_call": { "name": "message", "arguments": { "action": "send", "message": "..." } }, "tool_result": { "ok": true, "to": "spaces/REDACTED_SPACE" }, "observed_google_chat_result": "reply appeared as a top-level space message, outside the original thread" }After applying this adapter change to the installed Google Chat plugin and restarting the gateway, the same flow stayed inside the original Google Chat thread.
Redacted copied runtime transcript from the passing case:
{ "inbound": { "chat_id": "googlechat:spaces/REDACTED_SPACE", "message_id": "spaces/REDACTED_SPACE/messages/cLJ5-iaALOU.cLJ5-iaALOU", "reply_to_id": "spaces/REDACTED_SPACE/threads/cLJ5-iaALOU", "timestamp": "Tue 2026-05-12 07:58 GMT-3", "is_group_chat": true }, "tool_call": { "name": "message", "arguments": { "action": "send", "message": "[[reply_to_current]] Buen dia, Franco" } }, "tool_result": { "ok": true, "to": "spaces/REDACTED_SPACE" }, "observed_google_chat_result": "reply rendered inside the original thread with thread id spaces/REDACTED_SPACE/threads/cLJ5-iaALOU" }Operator confirmation from the live Google Chat UI after the patch:
I also attempted to independently query Google Chat for the message thread after the UI verification, but the Chat app service account cannot use
spaces.messages.listwith app authentication:Test plan
git diff --checknode --run test:extension -- googlechat; blocked before Vitest because the monorepopnpm installwas killed withSIGKILL.node scripts/test-extension.mjs googlechat extensions/googlechat/src/channel.test.ts; blocked before Vitest because the monorepopnpm installwas killed withSIGKILL.check,check-prod-types,check-test-types,check-lint,checks-node-channels, andchecks-fast-contracts-channels.AI assistance
This PR was prepared with Codex assistance. I understand the code change: it uses the Google Chat inbound
ReplyToIdthread resource as the message tool's current reply target so[[reply_to_current]]resolves tospaces/.../threads/...instead of falling back to the inbound message resource.Real Behavior Proof
Images show how the bot replied before and after the applied fix. Before:
After:
That last one shows the last message outside of a thread, before the fix was applied. And also the first message with the fix applied, we can see that the thread now has replies
Real Behavior Proof - Maintainer Validation
Behavior addressed: Google Chat message-tool replies preserve the inbound Google Chat thread resource so implicit replies and [[reply_to_current]] stay in the original thread instead of posting as top-level space messages.
Real environment tested: Local OpenClaw focused test environment on the refreshed PR head, plus the contributor's real Google Chat gateway/space proof already included above with redacted runtime transcript and screenshots.
Exact steps or command run after this patch: Ran focused regression tests for the Google Chat channel adapter and shared auto-reply threading wrapper, then ran format, lint, diff, and autoreview checks after applying the threading fixups.
Evidence after fix: Local Vitest passed 48 focused tests across extensions/googlechat/src/channel.test.ts and src/auto-reply/reply/reply-plumbing.test.ts. Format, lint, git diff --check, and autoreview also passed. The contributor's real Google Chat proof shows the same live message flow staying in the original Google Chat thread after the adapter change.
Observed result after fix: Google Chat tool context normalizes the current space target, uses ReplyToIdFull/ReplyToId as the thread resource, and lets the plugin adapter explicitly suppress the generic message-id fallback when no thread resource exists. Live Google Chat proof above shows replies rendering inside the original thread after the patch.
What was not tested: I did not perform a new live Google Chat send from this maintainer checkout; I relied on the contributor's real Google Chat proof plus local focused regression tests for the maintainer fixups.
Real Behavior Proof - Final Maintainer Validation
Behavior or issue addressed: Google Chat message-tool replies preserve the inbound Google Chat thread resource so implicit replies and [[reply_to_current]] stay in the original thread instead of posting as top-level space messages.
Real environment tested: Contributor's live Google Chat space with OpenClaw gateway and Google Chat plugin enabled, using account config replyToMode all. Private space ids, message ids, user ids, names, and email addresses are redacted in the copied runtime transcript and screenshots above.
Exact steps or command run after this patch: Applied the patched Google Chat adapter to the installed Google Chat plugin, restarted the OpenClaw gateway, then sent a message from the same Google Chat space/thread that previously reproduced the top-level reply bug. The contributor then watched the live Google Chat UI after the message-tool reply landed.
Evidence after fix: Redacted copied runtime transcript above shows inbound reply_to_id spaces/REDACTED_SPACE/threads/cLJ5-iaALOU and the tool call message [[reply_to_current]] Buen dia, Franco, with observed_google_chat_result reporting that the reply rendered inside the original thread. The after screenshots are embedded above at https://github.com/user-attachments/assets/2bb518b3-609e-4dc1-ac9c-2cf0ccdf9b1f and https://github.com/user-attachments/assets/5386884b-cd04-404f-b09b-9ef493993518.
Observed result after fix: The live Google Chat UI showed the patched reply inside the original thread with thread id spaces/REDACTED_SPACE/threads/cLJ5-iaALOU. The contributor also confirmed in the live UI that the fix worked, and the before/after screenshots show the previous top-level reply behavior versus the fixed threaded reply.
What was not tested: I did not run a new live Google Chat send from this maintainer checkout; the maintainer validation relies on the contributor's real Google Chat transcript and screenshots for live behavior, with local regression tests as supplemental proof outside this section.