Skip to content

feat(googlechat): edit previously sent text messages - #149241

Closed
zhangguiping-xydt wants to merge 6 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/googlechat-edit-message
Closed

zhangguiping-xydt wants to merge 6 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/googlechat-edit-message

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #149091

What Problem This Solves

Google Chat users cannot correct an app's sent text through OpenClaw's message tool or CLI, although the plugin already updates its typing placeholders.

User Impact

Users can explicitly replace text using the full message resource name and its same case-sensitive target space. The selected app's permissions still apply; provider errors do not send a replacement message. This is an optional plugin feature requiring maintainer acceptance. Live Google tenant permissions and ownership remain unverified.

Why This Change Was Made

Reuse the existing text-only PATCH helper and shared action authorization. Existing request guards survive target lookup, OAuth acquisition and each final HTTP attempt; the existing mutation callback runs at dispatch. Typing and approval updates retain their optional hooks. No new configuration, SDK capability, dependency, OAuth scope, schema or retention policy is added.

The conflict integration preserves main's remote-attachment links and local-file rejection. Discovery remains read-only and selected-account aware.

Evidence

Current head: 5a89d175209f581c67d81b3ce5722965cfda7048, integrated with pinned main 0fbc13eaacb9e8976d071e2f09bcd0b5a1a95966. Complete 12-path full-index diff SHA256: 7be53c8cfcf58ec8cdb83e92b8f8e6c4a5191f6216f883d82d7423451489fcfd.

  • Six canonical focused suites: 53 distinct passing tests, including direct actions, discovery, target identity, awaited authority/dispatch guards and public asynchronous tool integration. A later lint-only local variable rename was checked byte-for-byte; its unchanged behavioral results are reused.
  • Targeted format, typed lint, extension production/test types, affected root test types, line-cap, test-lines and mock-export checks passed. The dedicated allocation is 592 net LF; the shared scalar is unchanged.
  • The current clean-head CLI runtime bundle build passed in 293.58 seconds. It uses the supported declaration-skip setting and is not a full package/release/declaration build.
  • An isolated actual built Gateway ran signed Google Chat webhooks, JWT verification, durable ingress, the actual agent/provider adapter, registered message tool, OAuth signing and guarded HTTP. Google certificate/OAuth/Chat endpoints and Responses SSE are synthetic external protocol fixtures; no internal owner is mocked.

Sanitized current-head runtime result:

9/9 webhook inputs: HTTP 200, delivery-accepted=durable
allowed edit: exactly 1 PATCH, mixed-case resource preserved, updateMask=text
cross-account / cross-space / resource-case / disabled sibling: 0 mutations
disabled sibling: existing host account-selection owner rejects; 0 sibling OAuth
provider 403 / 404: error returned, exactly 1 PATCH each, 0 replacement POST
remote attachment: visible link and caption in POST; local file: rejection, 0 writes
all cases: actual tool result returned to provider; public session became idle
host stdin lifeline EOF: exit=0, native clean shutdown=247ms, forced kill=false
remaining task-owned processes/groups=0; external HTTP owners joined
post-shutdown SQLite: all 9 ingress rows completed

The PATCH contains only text and its update mask. Synthetic readback preserves fixture cards/attachments; this is not proof of Google's actual preservation behavior. The existing transport suite separately covers awaited OAuth/DM/callback/redirect revocation.

Independent final complete 12-path implementation/owner/consumer review passed with no unresolved implementation findings, bound to the exact base/head/diff above. The reviewer independently checked the raw runtime and static evidence; the review does not establish live-tenant proof, feature acceptance or hosted maintainer readiness. Current-head CI remains separate; see this PR's Checks tab.

Earlier failures remain failures: initial formatting and local no-shadow were repaired; a precommit line-cap invocation compared incoming main through the old merge-base, then passed against the final committed parent. Runtime attempt 1 stopped on a proof-script Python module shadow and observed managed-proxy SIGTERM exit 143. Attempt 2 had the wrong expected disabled-account error; attempt 3 completed business cases but rejected unrelated ClawHub traffic. The successful fresh-state run uses documented host stdin lifeline EOF and an explicit optional ClawHub TLS fixture returning real HTTP 503. Unknown destinations and Google failures remain fatal; no production code or authority check was weakened for proof.

Limits: no live Google tenant/IAM/app-ownership, Google-side non-text preservation, real inference, stable-release upgrade, default Tool Search catalog, public Stop runtime or SIGTERM exit-zero claim. Tool Search is explicitly disabled; unrelated startup update/model catalog discovery is disabled through supported config. The optional ClawHub catalog is offline in this proof. Historical prior-head tests/runtime remain historical. Feature acceptance remains a maintainer decision; this reference does not close the issue.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: googlechat Channel integration: googlechat size: M labels Sep 15, 2026
@zhangguiping-xydt
zhangguiping-xydt marked this pull request as ready for review September 15, 2026 15:51
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR exposes text editing of app-authored Google Chat messages through the existing message tool and CLI.

Example: Replace “Deploy starts at 14:00” in spaces/AAQA1bC2dEf/messages/proof-1 with “Deploy starts at 15:00”.

  • Before: Explicit editing is unsupported, so the agent must send a correction.
  • After: The edit action sends a text-only PATCH for the existing message.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is coherent and the previous authority defect is resolved; provider proof remains incomplete and product acceptance is outstanding.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Google Chat users must send another message to correct an earlier app-authored reply.
Reason: The implementation fits the existing plugin boundary, but accepting this optional capability remains an owner choice.

Merge readiness

⛔ Blocked before merge - 2 items remain

This PR adds a coherent plugin capability absent from current main; no introduced correctness or security defect was found, and feature acceptance remains a maintainer decision.

Priority: P3
Reviewed head: 5a89d175209f581c67d81b3ce5722965cfda7048
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should the bundled Google Chat plugin expose explicit editing of app-authored text messages through the shared message action?
  • Recommendation: Accept the narrow plugin enhancement: Continue toward text-only editing using the existing action and transport owners.
  • Why: This adds an optional supported capability, and neither this PR nor its linked request records maintainer acceptance.

Before merge

  • Add real behavior proof - Exact-head built-Gateway output exercises signed webhooks, the actual agent adapter, registered tool, OAuth signing, and guarded HTTP against synthetic external protocols, including allowed edits and forbidden account/space cases; production-path transport coverage also exercises revocation. This resolves the earlier host-authority concern, but synthetic Google responses do not establish authenticated tenant editing or Google-side preservation. Supply redacted terminal output, logs, or a recording of an actual Google Chat edit and readback; remove IPs, API keys, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Tests

  • Low-value test test/googlechat-message-edit.integration.test.ts: Remove the preservation/readback group at line 290 and its fixture-only state: the server fixture itself preserves non-text content, while the preceding test already verifies the identical text-only PATCH.
  • Missing end-to-end proof: An authenticated Google Chat edit through the shipped tool or CLI, followed by readback showing unchanged message identity and non-text content, remains missing.
Agent review details

How this fits together

Core authorizes message actions; the Google Chat plugin resolves the account and conversation, then sends the update through its existing OAuth and guarded HTTP transport.

flowchart LR
  A[Message tool or CLI] --> B[Core action authorization]
  B --> C[Google Chat action adapter]
  C --> D[Account and target resolution]
  D --> E[Guarded update helper]
  E --> F[Google Chat API]
  F --> G[Action result]
Loading

Technical review

Best possible solution:

If accepted, expose editing through the existing plugin action adapter and guarded PATCH helper while preserving account, conversation, and final-request authorization.

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

Current-main source confirms explicit editing is unavailable; this is a feature request rather than a failure of an existing supported contract.

Is this the best way to solve the issue?

The production change is appropriately narrow: it reuses shared action authorization, plugin account and target resolution, and the existing update helper without adding configuration or competing state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 22e493ef22b4.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the complete introduced diff and original production blobs; the checkout remained clean. (5a89d175209f)
  • Current main remains send-only: Current-main discovery advertises only send, and its runtime action handler rejects unsupported actions; automatic typing updates do not expose explicit editing. (extensions/googlechat/src/message-tool-api.ts:19, 22e493ef22b4)
  • Previous authority finding resolved: The edit action forwards the existing handoff and dispatch hooks through target resolution and PATCH; the HTTP owner rechecks authority immediately before each request attempt. (extensions/googlechat/src/actions.ts:97, 5a89d175209f)
  • Allowed and forbidden authority paths: Registered-tool integration covers account and conversation rejection and revocation during OAuth and DM lookup; transport coverage additionally exercises revocation during dispatch and redirects. (test/googlechat-message-edit.integration.test.ts:307, 5a89d175209f)
  • Supplied behavior evidence: The PR body supplies exact-head built-Gateway output for allowed edits, forbidden account/space cases, and provider failures without replacement sends; it expressly identifies Google and inference responses as synthetic. (5a89d175209f)
  • Related request and product direction: [Feature]: Edit previously sent Google Chat text messages #149091 requests the same optional capability and records no maintainer acceptance; its administrative inactivity closure does not establish implementation or rejection of this PR.

PR surface

Source +43, Tests +593, Docs +5, Other +1. Total +642 across 12 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 56 13 +43
Tests 5 597 4 +593
Docs 2 6 1 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 2 2 1 +1
Total 12 661 19 +642

Review metrics

Metric Value Why it matters
Production versus behavioral tests Production +56/-13 lines; behavioral tests +596/-4 lines Most test growth protects distinct host and transport authority boundaries; the fixture-preservation group duplicates the text-only PATCH contract.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #149091
Summary: The administratively closed feature request defines the explicit-edit capability implemented by this open PR.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an optional convenience with a working follow-up-message alternative and no reported production incident.
  • 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.

Rank-up moves

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

  • Remove the duplicate fixture-preservation test while retaining the independent PATCH assertions.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-15T15:58:17.979Z sha 9f62c3b3803cdb402733a1a0255b9029e6e3bf1a :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-15T16:28:15.924Z sha 87a2d629875115b718bd53099b1e10ba50624a5a :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-15T16:58:52.959Z sha 87a2d629875115b718bd53099b1e10ba50624a5a :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T14:54:22.138Z sha eefb1f4 :: needs real behavior proof before merge. :: [P1] Carry the caller's request guard through edit preparation and PATCH
  • reviewed 2026-11-03T21:20:21.167Z sha 5a89d17 :: needs real behavior proof before merge. :: none

Reviewed November 3, 2026, 4:29 PM ET / 21:29 UTC (Revision 6).

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Sep 24, 2026
@zhangguiping-xydt
zhangguiping-xydt force-pushed the feat/googlechat-edit-message branch from 87a2d62 to eefb1f4 Compare October 13, 2026 14:45
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 13, 2026
@zhangguiping-xydt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 3, 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 docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L 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