Skip to content

feat(googlechat): add native approval cards - #89502

Merged
kevinslin merged 14 commits into
mainfrom
codex/googlechat-approval-cards
Jun 5, 2026
Merged

kevinslin merged 14 commits into
mainfrom
codex/googlechat-approval-cards

Conversation

@kevinslin

@kevinslin kevinslin commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds native Google Chat approval cards for exec and plugin approval requests that originate from Google Chat spaces or threads.
  • Uses opaque server-side action tokens for Google Chat cardsV2 button callbacks and updates delivered approval messages after resolution or expiry.
  • Preserves the shipped Google Chat typing-message default while keeping approval cards on the channel-local native path.
  • Suppresses duplicate manual /approve ... follow-up delivery inside extensions/googlechat/ when the native card path owns the approval prompt.
  • Documents Google Chat native approval behavior and the typingIndicator: "message" default.

Linked context

Which issue does this close?

Closes #

Which issues, PRs, or discussions are related?

Related Spec 24.8: Google Chat native approval cards.

Was this requested by a maintainer or owner?

Requested by maintainer in the Codex task thread.

Real behavior proof (required for external PRs)

  • Behavior addressed: Google Chat exec and plugin approvals render as native cards and resolve through Google Chat button clicks. The latest change verifies an exec approval card is not accompanied by a duplicate manual /approve instruction bubble.
  • Real environment tested: OpenClaw dev profile with a real Google Chat DM to the OpenClaw app, local gateway behind a temporary Cloudflare quick tunnel, and Arc/Computer Use against the signed-in Google Chat session.
  • Exact steps or command run after this patch: Rebuilt the gateway runtime, started the dev-profile gateway with the Google Chat webhook routed through the tunnel, sent a fresh exec request from Google Chat, verified only the native approval card appeared, clicked Allow Once in Google Chat, and checked the command output reply plus marker file.
  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output): Latest proof used nonce GCHAT_NODOUBLE_LIVE_20260604070730, approval id 949bc08c-9e57-47c0-b045-137603782292, and proof directory .mem/main/proofs/demo-89502-dev-gchat-exec-approval-no-double-send-channel-race/. raw/google-chat-gchat-nodouble-request-card-only-clean.png shows the fresh user message followed by a single native Exec Approval Required card with Allow Once/Deny and no manual /approve follow-up bubble. raw/google-chat-gchat-nodouble-resolved-clean.png shows the card edited to Exec Approval: Allowed once and the final successful command reply. raw/gchat-nodouble-live-filtered-log.txt contains googlechat approval resolved id=949bc08c-9e57-47c0-b045-137603782292 decision=allow-once. raw/marker-file-check.txt records /tmp/openclaw-gchat-no-double-GCHAT_NODOUBLE_LIVE_20260604070730 as created.
  • Observed result after fix: The approval prompt posted as a native Google Chat card only. No duplicate manual approval-instruction bubble was sent. Clicking Allow Once resolved the approval through the gateway and OpenClaw replied with the successful exec output in the same Google Chat DM.
  • What was not tested: A persistent production Google Chat app URL; live proof used a temporary Cloudflare tunnel for the local dev callback.
  • Proof limitations or environment constraints: Video was not captured for the final resumed manual UI run; still screenshots, gateway/proxy logs, a marker-file artifact, and Showboat verification were captured.
  • Before evidence (optional but encouraged): Before the final channel-local suppression path, Google Chat could show both the native approval card and a separate manual /approve instruction bubble.

Tests and validation

Which commands did you run?

  • node scripts/build-all.mjs gatewayWatch
  • node scripts/run-vitest.mjs extensions/googlechat/src/monitor-webhook.test.ts extensions/googlechat/src/monitor.test.ts extensions/googlechat/src/monitor.reply-delivery.test.ts extensions/googlechat/src/monitor-durable.test.ts extensions/googlechat/src/approval-card-actions.test.ts extensions/googlechat/src/approval-handler.runtime.test.ts extensions/googlechat/src/approval-native.test.ts extensions/googlechat/src/approval-card-click.test.ts extensions/googlechat/src/channel-config.test.ts extensions/googlechat/src/targets.test.ts
  • git diff --check
  • pnpm docs:list
  • uvx showboat --workdir .mem/main/proofs/demo-89502-dev-gchat-exec-approval-no-double-send-channel-race verify .mem/main/proofs/demo-89502-dev-gchat-exec-approval-no-double-send-channel-race/raw/showboat-summary.md
  • Live dev-profile Google Chat proof described above.

What regression coverage was added or updated?

  • Added Google Chat native approval capability, runtime delivery, card token, and card-click resolver tests.
  • Added in-flight native card send suppression coverage so manual follow-up text is suppressed while native card delivery is pending.
  • Added cleanup coverage so manual follow-ups are restored if native card send fails.
  • Updated webhook ACK coverage for card-click events and default typing-indicator behavior coverage.

What failed before this fix, if known?

Google Chat could deliver the native approval card and still allow a model/message-tool manual /approve follow-up to appear as a second visible bubble.

If no test was added, why not?

Tests were added for the changed runtime and webhook behavior.

Risk checklist

Did user-visible behavior change? (Yes/No)

Yes.

Did config, environment, or migration behavior change? (Yes/No)

No migration. The shipped Google Chat typingIndicator: "message" default is preserved.

Did security, auth, secrets, network, or tool execution behavior change? (Yes/No)

Yes.

What is the highest-risk area?

Approval authorization and callback token handling for native Google Chat card actions.

How is that risk mitigated?

Callbacks carry opaque action tokens only, token bindings check account, space, message, expiry, allowed decision, and in-flight state, and actor authorization reuses the existing Google Chat approver allowlist adapter based on stable users/<id> principals.

Current review state

What is the next action?

Merge after current-head CI for 5923f2af46.

What is still waiting on author, maintainer, CI, or external proof?

Current-head CI is green for 5923f2af46; live dev-profile proof is complete.

Which bot or reviewer comments were addressed?

Addressed duplicate approval delivery by keeping the final suppression path inside extensions/googlechat/, preserving default typing-message behavior, and proving the current Google Chat surface sends only the native approval card.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: googlechat Channel integration: googlechat size: XL maintainer Maintainer-authored PR labels Jun 2, 2026
@clawsweeper

clawsweeper Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed June 5, 2026, 12:49 AM ET / 04:49 UTC.

Summary
Adds Google Chat native approval cards, opaque card-click tokens, callback handling, duplicate manual-prompt suppression, typing-indicator default docs, and approval-card tests.

PR surface: Source +1265, Tests +1539, Docs +10. Total +2814 across 25 files.

Reproducibility: not applicable. as a user bug report, but the compatibility finding is source-reproducible: current main defaults Google Chat typing to message, while this PR defaults it to none.

Review metrics: 2 noteworthy metrics.

  • Google Chat Typing Default: 1 changed default. The runtime and docs change typingIndicator from message to none, which affects existing configs that rely on defaults.
  • Approval Callback Surface: 1 new card-click resolver. A new Google Chat callback path can resolve exec and plugin approvals, so maintainer review should focus on authorization and token binding.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Preserve the shipped Google Chat typing default or document explicit maintainer acceptance of the default change.
  • Get owner signoff on the Google Chat card-click approval authorization model.

Mantis proof suggestion
A short real Google Chat visual proof would directly show the card-only approval flow and duplicate-prompt suppression. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify a Google Chat exec approval posts one native card, clicking Allow Once resolves it, and no manual /approve bubble appears.

Risk before merge

  • [P1] Existing Google Chat users without an explicit typingIndicator setting lose the shipped visible typing-message placeholder on upgrade unless maintainers intentionally accept the compatibility change.
  • [P1] Google Chat card clicks become a new path for resolving exec and plugin approvals; source review found binding and authorization checks, but the security-boundary design still needs maintainer acceptance.

Maintainer options:

  1. Preserve Shipped Typing Behavior (recommended)
    Keep the existing typingIndicator: "message" default for upgrades and narrowly route approval-card traffic onto the durable path.
  2. Accept The Default Change Explicitly
    Maintainers can intentionally choose the new none default, but the PR should make that compatibility decision visible before merge.
  3. Record Approval Callback Signoff
    An owner should explicitly accept the opaque-token Google Chat callback model for resolving exec and plugin approvals.

Next step before merge

  • [P2] Maintainers need to decide the typing-default compatibility tradeoff and approve the new approval callback boundary; this is not a narrow autonomous repair unless they choose the default-preserving path.

Security
Cleared: No concrete approval bypass was found in source review; the new callback path remains security-sensitive and needs maintainer signoff.

Review findings

  • [P1] Preserve the shipped Google Chat typing default — extensions/googlechat/src/monitor.ts:349-354
Review details

Best possible solution:

Land the Google Chat native card implementation after preserving the shipped typing default or recording explicit maintainer acceptance of that compatibility change, plus owner signoff on the callback authorization model.

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

Not applicable as a user bug report, but the compatibility finding is source-reproducible: current main defaults Google Chat typing to message, while this PR defaults it to none.

Is this the best way to solve the issue?

No: native cards are a good direction, but changing the global typing default is not the narrowest compatibility-safe way to keep approval prompts durable.

Full review comments:

  • [P1] Preserve the shipped Google Chat typing default — extensions/googlechat/src/monitor.ts:349-354
    This changes accounts without typingIndicator from message mode to no indicator. Current main defaults Google Chat to the visible typing-message placeholder, so upgrading silently removes that behavior for existing users; keep the default as message and only bypass typing-message delivery for approval-card flows, or make the compatibility break an explicit maintainer decision before merge.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against e0018382eb00.

Label changes

Label justifications:

  • P2: This is a bounded Google Chat channel feature with compatibility and security-boundary review needs, not an emergency or urgent regression.
  • merge-risk: 🚨 compatibility: The PR changes the shipped Google Chat typing-indicator default for users without an explicit setting.
  • merge-risk: 🚨 security-boundary: The PR adds an authenticated Google Chat card-click path that can resolve exec and plugin approvals.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (logs): The PR body includes after-fix live Google Chat proof with a dev gateway, screenshots/log names, a filtered runtime log resolving the approval, a marker-file check, and Showboat verification.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix live Google Chat proof with a dev gateway, screenshots/log names, a filtered runtime log resolving the approval, a marker-file check, and Showboat verification.
Evidence reviewed

PR surface:

Source +1265, Tests +1539, Docs +10. Total +2814 across 25 files.

View PR surface stats
Area Files Added Removed Net
Source 14 1293 28 +1265
Tests 8 1541 2 +1539
Docs 3 13 3 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 25 2847 33 +2814

What I checked:

  • Repository policy read and applied: Root and scoped AGENTS.md files were read fully; the review applied plugin-boundary, docs, channel, compatibility/default, and security-boundary guidance. (AGENTS.md:1, e0018382eb00)
  • Current main typing default: Current main defaults Google Chat typingIndicator to message and falls back from unsupported reaction mode to message mode. (extensions/googlechat/src/monitor.ts:344, e0018382eb00)
  • PR changes shipped default: PR head changes accounts without an explicit Google Chat typingIndicator from message mode to no indicator, matching docs changes that make none the default. (extensions/googlechat/src/monitor.ts:349, 56ade5283e0d)
  • Native approval capability path: PR head wires Google Chat native approvals through plugin-owned capability gates and lazy native runtime loading for exec and plugin approvals. (extensions/googlechat/src/approval-native.ts:194, 56ade5283e0d)
  • Callback authorization path: Card-click handling checks token binding, account, space, optional message name, allowed decision, and Google Chat approver authorization before resolving over the gateway. (extensions/googlechat/src/approval-card-click.ts:30, 56ade5283e0d)
  • Google Chat API contract spot-check: Official Google Chat docs show cardsV2 is valid for message create/patch, updateMask supports cardsV2, and card actions pass function parameters in interaction events.

Likely related people:

  • steipete: Recent history includes Google Chat API fetch handling, webhook ingress/auth hardening, and many adjacent Google Chat runtime/docs refactors. (role: recent Google Chat webhook and plugin-boundary contributor; confidence: high; commits: 6ecc18463753, 1c9deeda97ce, d3e8b17aa643; files: extensions/googlechat/src/api.ts, extensions/googlechat/src/monitor-webhook.ts, extensions/googlechat/src/monitor.ts)
  • gumadeiras: Recent approval lifecycle and channel approval capability seam refactors are central to the PR's native approval runtime path. (role: native approval seam contributor; confidence: high; commits: d78512b09d1d, c87c8e66bf7d, 28fc5d9b5e; files: src/infra/approval-handler-runtime.ts, src/plugin-sdk/approval-native-helpers.ts, src/plugin-sdk/approval-delivery-helpers.ts)
  • vincentkoc: History shows Slack native approval work used as a sibling model and Google Chat/webhook boundary work near this PR's callback path. (role: native approval and Google Chat security-adjacent contributor; confidence: medium; commits: 5ec362fe0b09, 2b67a3f76e, 5e78c8bc95; files: extensions/slack/src/approval-native.ts, extensions/slack/src/approval-handler.runtime.ts, extensions/googlechat/src)
  • Takhoffman: Recent current-main history includes Google Chat account reply behavior in the same channel runtime area. (role: recent Google Chat runtime contributor; confidence: medium; commits: 8e9607c06428; files: extensions/googlechat/src/monitor.ts, extensions/googlechat/src/channel.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

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: e8ea82a992

ℹ️ 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".

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Jun 3, 2026
@kevinslin
kevinslin force-pushed the codex/googlechat-approval-cards branch from b98829a to 68d7c39 Compare June 3, 2026 04:19
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation and removed docs Improvements or additions to documentation agents Agent runtime and tooling labels Jun 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 5, 2026
@kevinslin
kevinslin force-pushed the codex/googlechat-approval-cards branch from 24b4826 to 56ade52 Compare June 5, 2026 04:42
sessions or targets even when Slack exec approvals are disabled
- Google Chat native approval cards handle exec and plugin approvals that originate from Google
Chat spaces or threads when stable `users/<id>` approvers resolve from `dm.allowFrom` or
`defaultTo`; they do not use reaction events for decisions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do not document that chat do not have reaction events

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 feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant