Skip to content

fix(googlechat): retain fallback thread continuity - #117053

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-googlechat-fallback-thread-20260731
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-googlechat-fallback-thread-20260731

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Google Chat reply sends opt into REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD, but the legacy/default typing delivery path kept using the originally requested thread after Google returned a different canonical fallback thread. Multi-chunk replies could therefore update the placeholder in fallback thread A while later chunks retried the stale target and landed in additional threads B/C.

Why This Change Was Made

The delivery owner now separates logical placement from physical placement. The requested thread decides whether an existing typing placeholder belongs to the reply; the provider-returned thread becomes the target for every later chunk. Top-level sends remain top-level, and missing response metadata retains the requested thread. The already-correct durable receipt path is unchanged.

User Impact

When Google cannot reply to the requested thread and starts a fallback thread, the typing placeholder and all later chunks stay together in that one canonical thread instead of fragmenting the reply.

Evidence

  • Exact reviewed head: 2eb5b72278475ecf8155958048e87918c5997d2a.
  • Blacksmith Testbox: https://github.com/openclaw/openclaw/actions/runs/30666659063
    • 87/87 focused Google Chat tests passed across monitor, reply delivery/failure, channel adapter, and target contracts.
    • Complete extension changed gate passed: extension/test typecheck, lint, format, dead-code, plugin boundaries, database-first, import-cycle, and related guards.
  • Live official Google Chat v1 discovery contract:
    • REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD replies to the requested thread or starts a new thread if that fails.
    • The returned Message.thread is the containing thread.
    • Thread.name is the canonical spaces/{space}/threads/{thread} resource name.
  • Monitor-level regression proves the typing send returns fallback thread A, its first chunk updates the existing placeholder, and the next chunk targets A. Focused regressions cover missing metadata, mismatched placeholders, failures, and top-level sends.
  • Final whole-branch autoreview: clean, confidence 0.96.
  • git diff --check: passed.

Release-note context: Google Chat multi-chunk replies now continue in the canonical fallback thread returned by the provider.

@openclaw-barnacle openclaw-barnacle Bot added channel: googlechat Channel integration: googlechat size: M maintainer Maintainer-authored PR labels Jul 31, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 5:45 PM ET / 21:45 UTC.

ClawSweeper review

What this changes

This PR records the canonical Google Chat thread returned for a typing placeholder and uses it for later chunks of the same reply.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

Keep this PR open for maintainer review. The current delivery path demonstrably loses the provider-returned thread after creating the typing placeholder, and the proposed ownership boundary is well targeted; however, the exact PR-head blobs could not be fully read because the partial clone could not reach GitHub, and the submitted evidence is regression/mock proof rather than an observed Google Chat fallback delivery.

Priority: P2
Reviewed head: 2eb5b72278475ecf8155958048e87918c5997d2a

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The fix is narrowly aligned with the current owner boundary and has focused regression claims, but real provider behavior proof remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body describes focused Testbox regressions and static/provider-contract checks, but no redacted after-fix Google Chat run, transcript, runtime log, or comparable real behavior artifact was available. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body describes focused Testbox regressions and static/provider-contract checks, but no redacted after-fix Google Chat run, transcript, runtime log, or comparable real behavior artifact was available. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current-main defect: Current reply delivery reads the requested thread from payload.replyToId and every new text chunk sends to that requested thread; it has no state for the thread returned by Google after the typing-message send.
Provider wrapper exposes the needed authoritative fact: The channel API wrapper opts threaded sends into REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD and returns result.thread?.name as threadName, so the delivery owner can preserve the provider-selected physical thread without adding a new API surface.
Current-path provenance: Blame attributes the current requested-thread-only delivery logic to the shallow-history boundary at commit 51a78a4411bf247df6e2b40ff58043b9e78241bf, authored by Peter Steinberger; the nearby history also identifies that commit as the current file-history entry available in this checkout.
Findings None None.
Security None None.

How this fits together

The Google Chat plugin sends a typing placeholder before OpenClaw delivers the agent response. When Google replaces a requested thread with a fallback thread, the reply-delivery layer must carry that returned placement forward so placeholder updates and subsequent chunks stay in one conversation.

flowchart LR
  A[Inbound Google Chat message] --> B[Requested reply thread]
  B --> C[Typing placeholder send]
  C --> D[Google Chat returned thread]
  D --> E[Reply delivery]
  E --> F[Placeholder update and later chunks]
  F --> G[One canonical conversation thread]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body describes focused Testbox regressions and static/provider-contract checks, but no redacted after-fix Google Chat run, transcript, runtime log, or comparable real behavior artifact was available. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - This changes message placement after a provider fallback; without observed Google Chat proof, a mismatch between the documented response shape and the live service could still fragment or misroute later chunks.
  • Resolve merge risk (P1) - The exact PR-head blobs were unavailable from the partial clone during this review, so the complete branch implementation and all added assertions need a normal exact-head review before merge.
  • Complete next step (P2) - A real Google Chat fallback proof and a complete exact-head source read are required before merge; the protected maintainer label also requires explicit maintainer handling.
Agent review details

Security

None.

PR surface

Source +46, Tests +232. Total +278 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 56 10 +46
Tests 3 239 7 +232
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 295 17 +278

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Prove fallback continuity before merge (recommended)
    Add a redacted Google Chat runtime trace, terminal output, or live transcript showing a fallback placeholder and a later chunk using the same returned thread.
  2. Accept provider-contract risk
    A maintainer may merge based on the focused regressions and Google API contract if live-channel proof is impractical for this change.
  3. Pause for exact-head review
    Pause the PR until an environment with the complete head source and Google Chat proof can verify the full implementation.

Technical review

Best possible solution:

Keep the logical requested thread only for deciding whether the typing placeholder is reusable, and carry the provider-returned thread as the canonical physical target for every later send; validate that behavior with a redacted real Google Chat fallback run before merge.

Do we have a high-confidence way to reproduce the issue?

Yes—source-reproducible with medium confidence: current main requests fallback-thread behavior, captures the returned thread in the API wrapper, then discards it while later chunks continue targeting the requested thread. A live fallback response was not available in this read-only environment.

Is this the best way to solve the issue?

Yes, provisionally: keeping requested placement and provider-delivered placement separate at the channel delivery owner is cleaner than downstream retries or channel-specific resend heuristics. The exact branch and live provider behavior still need verification before calling it the best proven fix.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 383363e36233.

Labels

Label changes:

  • add P2: The reported failure can visibly fragment multi-chunk replies in the Google Chat channel, but the available evidence indicates a bounded channel-specific impact.
  • add merge-risk: 🚨 message-delivery: The patch changes which Google Chat thread receives later reply chunks after the provider selects a fallback thread.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body describes focused Testbox regressions and static/provider-contract checks, but no redacted after-fix Google Chat run, transcript, runtime log, or comparable real behavior artifact was available. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: The reported failure can visibly fragment multi-chunk replies in the Google Chat channel, but the available evidence indicates a bounded channel-specific impact.
  • merge-risk: 🚨 message-delivery: The patch changes which Google Chat thread receives later reply chunks after the provider selects a fallback thread.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body describes focused Testbox regressions and static/provider-contract checks, but no redacted after-fix Google Chat run, transcript, runtime log, or comparable real behavior artifact was available. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main defect: Current reply delivery reads the requested thread from payload.replyToId and every new text chunk sends to that requested thread; it has no state for the thread returned by Google after the typing-message send. (extensions/googlechat/src/monitor-reply-delivery.ts:32, 383363e36233)
  • Provider wrapper exposes the needed authoritative fact: The channel API wrapper opts threaded sends into REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD and returns result.thread?.name as threadName, so the delivery owner can preserve the provider-selected physical thread without adding a new API surface. (extensions/googlechat/src/api.ts:181, 383363e36233)
  • Current-path provenance: Blame attributes the current requested-thread-only delivery logic to the shallow-history boundary at commit 51a78a4411bf247df6e2b40ff58043b9e78241bf, authored by Peter Steinberger; the nearby history also identifies that commit as the current file-history entry available in this checkout. (extensions/googlechat/src/monitor-reply-delivery.ts:77, 51a78a4411bf)
  • PR scope and evidence claim: The PR commit metadata confirms five Google Chat monitor/delivery files are changed. Its body reports focused Testbox regressions and changed-gate checks, but does not provide a redacted live Google Chat fallback transcript, runtime log, or equivalent after-fix artifact. (extensions/googlechat/src/monitor-reply-delivery.ts:1, 2eb5b7227847)
  • Review limitation: The checkout is a partial clone and could not retrieve the PR-head source blobs because GitHub DNS was unavailable; the assessment therefore relies on the supplied PR patch excerpts, local current-main source, and commit metadata rather than claiming a complete exact-head source read. (2eb5b7227847)

Likely related people:

  • steipete: Peter Steinberger authored the available current-path provenance commit and the PR head; the file-history shortlog also shows the strongest contribution concentration on the affected monitor and delivery path. (role: current delivery-path author; confidence: high; commits: 51a78a4411bf, 2eb5b7227847; files: extensions/googlechat/src/monitor-reply-delivery.ts, extensions/googlechat/src/monitor.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted after-fix Google Chat evidence showing the provider-selected fallback thread and a later chunk remaining in that same thread.
  • Refresh the review in an environment that can read the exact current PR head.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 3dce01f into main Jul 31, 2026
97 of 105 checks passed
@steipete
steipete deleted the codex/autoqa-googlechat-fallback-thread-20260731 branch July 31, 2026 21:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 31, 2026
…odels-20260729

* origin/main:
  fix(tui): canonical terminal outcomes, cancellation, and error privacy (#117044)
  fix(cron): avoid phantom message tool guidance (#116908)
  fix(test): avoid macOS release gate deadlocks (#116972)
  fix(openai): canonical Chat cache-hit and billing accounting (#117043)
  fix(memory-wiki): salvage human Notes before pruning imported source pages (#102294)
  fix(memory): suggest reindex, not --fix, for a missing qmd index (#116958)
  chore(msteams): add private Gateway QA adapter
  fix(ui): make session controls and failures accessible (#117019)
  docs: fix tilde paths in CLI output examples (#114595)
  fix(plugins): canonical discovery diagnostics and deterministic lifecycles (#117025)
  fix(ui): honor Gateway readiness abort and subscription ownership (#117048)
  fix(updater): harden launchd replacement timing (#117030)
  fix(gateway): preserve static asset HEAD representation metadata (#117049)
  fix(gateway): abort embeddings when clients disconnect (#116146)
  fix(googlechat): retain fallback thread continuity (#117053)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: googlechat Channel integration: googlechat maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant