Skip to content

fix: consume stale google chat approval clicks - #98433

Closed
haruaiclone-droid wants to merge 1 commit into
openclaw:mainfrom
haruaiclone-droid:codex/fix-googlechat-stale-approval-click
Closed

haruaiclone-droid wants to merge 1 commit into
openclaw:mainfrom
haruaiclone-droid:codex/fix-googlechat-stale-approval-click

Conversation

@haruaiclone-droid

Copy link
Copy Markdown
Contributor

Summary

  • consume Google Chat approval card tokens when gateway resolution reports APPROVAL_NOT_FOUND
  • keep generic gateway failures retryable as before
  • add regression coverage that stale card clicks are handled once and subsequent clicks do not retry resolution

Closes #98432.

Validation

  • node scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-messaging.config.ts googlechat/src/approval-card-click.test.ts -t "consumes stale approval card tokens when gateway reports approval not found" --reporter=verbose --testTimeout=30000
  • node scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-messaging.config.ts googlechat/src/approval-card-click.test.ts -t "keeps the token retryable when gateway resolution fails" --reporter=verbose --testTimeout=30000
  • node scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-messaging.config.ts googlechat/src/approval-card-click.test.ts --reporter=verbose --testTimeout=30000
  • git diff --check

@openclaw-barnacle openclaw-barnacle Bot added channel: googlechat Channel integration: googlechat size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 1, 2026
@clawsweeper

clawsweeper Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 1:43 AM ET / 05:43 UTC.

Summary
The branch imports the shared approval-not-found classifier into Google Chat approval card clicks, consumes the card binding when gateway resolution reports not found, and adds regression coverage while preserving retry for generic gateway failures.

PR surface: Source +6, Tests +48. Total +54 across 2 files.

Reproducibility: yes. source inspection gives a high-confidence reproduction path: current main releases the claimed token for every resolver error, and release only clears the in-flight marker, leaving the same stale binding retryable. I did not run a live Google Chat repro in this read-only review.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #98432
Summary: This PR is the candidate fix for the linked Google Chat stale approval-card retry issue; broader stale approval lifecycle issues remain separate.

Members:

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

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • [P1] Add redacted real behavior proof for the after-fix stale Google Chat approval-card path, including the first terminal click and the ignored second click.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR currently has mocked Vitest validation only; please add redacted terminal/log output, a linked artifact, screenshot, or recording showing the stale Google Chat click is consumed and a second click does not retry, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] External PR proof is still mock-only: the body lists focused Vitest commands, but there is no redacted live/log/terminal proof that a stale Google Chat card click is consumed once and a second click does not retry gateway resolution.

Maintainer options:

  1. Decide the mitigation before merge
    Land this narrow Google Chat handler fix after the contributor adds redacted real behavior proof and current-head review/checks pass; keep broader restart-persistence decisions in Approvals lost on gateway restart — stale callback buttons show confusing error #64664.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Human/contributor follow-up is needed because automation cannot supply the external contributor's real behavior proof; the code review itself found no narrow repair to queue.

Security
Cleared: The diff reuses an existing SDK error helper and changes in-memory card-token completion only; I found no new dependency, secret, workflow, permission, or supply-chain concern.

Review details

Best possible solution:

Land this narrow Google Chat handler fix after the contributor adds redacted real behavior proof and current-head review/checks pass; keep broader restart-persistence decisions in #64664.

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

Yes, source inspection gives a high-confidence reproduction path: current main releases the claimed token for every resolver error, and release only clears the in-flight marker, leaving the same stale binding retryable. I did not run a live Google Chat repro in this read-only review.

Is this the best way to solve the issue?

Yes. Handling terminal approval-not-found at the Google Chat card-token owner boundary is the narrowest maintainable fix, while leaving generic gateway failures retryable and avoiding a broader resolver behavior change for other submitters.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The PR addresses a real but bounded Google Chat approval-card retry bug without evidence of a core outage or security emergency.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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 currently has mocked Vitest validation only; please add redacted terminal/log output, a linked artifact, screenshot, or recording showing the stale Google Chat click is consumed and a second click does not retry, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +6, Tests +48. Total +54 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 0 +6
Tests 1 48 0 +48
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 54 0 +54

What I checked:

  • Current main retry behavior: Current main claims the Google Chat card token and releases it for every resolver error, so a terminal approval-not-found error leaves the card binding retryable. (extensions/googlechat/src/approval-card-click.ts:85, c230ab3c924e)
  • Token completion contract: The binding registry distinguishes completion from retry release: completion deletes the token and follow-up suppression, while release only clears the in-flight marker. (extensions/googlechat/src/approval-card-actions.ts:279, c230ab3c924e)
  • Shared approval-not-found contract: The existing shared classifier recognizes structured APPROVAL_NOT_FOUND shapes and is exported through plugin-sdk/error-runtime, so the plugin import follows the bundled-plugin SDK boundary. (src/infra/approval-errors.ts:23, c230ab3c924e)
  • Proposed diff: The PR adds the classifier import, completes the Google Chat card binding on approval-not-found, and adds a regression test that a second stale click does not retry gateway resolution. (extensions/googlechat/src/approval-card-click.ts:84, b518f60f55a6)
  • Linked bug report: The linked issue describes the same sequence: a Google Chat card click receives APPROVAL_NOT_FOUND, current main releases the token, and later stale clicks retry the same missing approval.
  • Sibling stale-callback invariant: The Telegram sibling path already treats approval-not-found callbacks as terminal and returns after optional button clearing, supporting the same terminal-error invariant for native approval buttons. (extensions/telegram/src/bot-handlers.runtime.ts:2718, c230ab3c924e)

Likely related people:

  • kevinslin: Merged pull request feat(googlechat): add native approval cards #89502 introduced the Google Chat native approval card files and callback-token behavior this PR repairs. (role: introduced Google Chat native approvals; confidence: high; commits: d7759c6a35ac; files: extensions/googlechat/src/approval-card-click.ts, extensions/googlechat/src/approval-card-actions.ts, extensions/googlechat/src/approval-handler.runtime.ts)
  • gumadeiras: Merged pull request core: dedupe approval not-found handling #60932 added the shared approval-not-found classifier and plugin SDK export reused by this PR. (role: shared approval error helper owner; confidence: medium; commits: e627f53d24a9; files: src/infra/approval-errors.ts, src/plugin-sdk/error-runtime.ts, src/auto-reply/reply/commands-approve.ts)
  • joshavant: Merged pull request fix(telegram): drop expired approval callbacks #82455 made Telegram expired approval callbacks terminal, a sibling channel invariant for stale native approval clicks. (role: sibling stale callback contributor; confidence: medium; commits: 916234977a7c; files: extensions/telegram/src/bot-handlers.runtime.ts, extensions/telegram/src/bot.test.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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 1, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix: consume stale google chat approval clicks This is item 1/1 in the current shard. Shard 2/22.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: googlechat Channel integration: googlechat P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Google Chat stale approval cards keep retrying after approval not found

1 participant