Repository navigation
fix(bug): Google Chat stale approval cards keep retrying after approv… - #98457
WYH1597650869 wants to merge 1 commit into
Conversation
|
Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask. Close this stale external PR: it has had no author update since July 1, 2026, carries the dated Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again. Review detailsBest possible solution: Implement the narrow terminal-error classification against the current typed Google Chat click handler under #98432: consume only Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: have the canonical Gateway resolver return an approval-not-found error for a valid Google Chat card token, then invoke the same card action twice. Current main releases the token for every thrown resolver error, and the second click can therefore retry it. Is this the best way to solve the issue? No for this branch. Its terminal-error idea is narrow and sound, but current main now uses typed canonical approval results and card rendering; the dirty branch must be rebuilt with a current-main regression test and real behavior proof. Security review: Security review cleared: The submitted diff only changes channel-local error classification and tests; no concrete credential, authorization, dependency, or supply-chain regression is introduced. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against b8a6ea12cc2f. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
What Problem This Solves
Fixes an issue where Google Chat approval card clicks treat
APPROVAL_NOT_FOUNDgateway errors the same as transient failures. When a user clicks a stale/expired approval card after the backing approval was already resolved or deleted elsewhere, the click handler incorrectly releases the card token for retry instead of consuming it.Concrete problem: Users can repeatedly click the same expired approval card, causing the gateway to receive multiple resolution attempts for an approval that no longer exists. Each click appears to "work" (returns
true) but the gateway logs show repeatedAPPROVAL_NOT_FOUNDerrors for the same approval ID.Reproduction:
APPROVAL_NOT_FOUNDWhy This Change Was Made
The fix distinguishes between terminal errors (approval no longer exists) and transient errors (gateway temporarily unavailable):
APPROVAL_NOT_FOUND→ Terminal state: consume the token, log that the approval is expired/stale, and returnhandledwithout retryingThe change was made in
extensions/googlechat/src/approval-card-click.ts:86-98by adding a type check in the catch block:This follows the same pattern used by other approval channels (Telegram, Matrix, Signal, etc.) which already handle
APPROVAL_NOT_FOUNDas a terminal condition.User Impact
Google Chat users: Expired/stale approval cards now fail gracefully on first click instead of creating a retry loop. Users will see a log message indicating the approval has expired, and subsequent clicks on the same card are silently ignored.
Operators/Admins: Gateway logs will no longer show repeated
APPROVAL_NOT_FOUNDerrors for the same approval ID from stale card clicks.No breaking changes: The fix only affects error handling behavior. Successful approval flows remain unchanged.
Evidence
Test Run
pnpm test extensions/googlechat/src/approval-card-click.test.ts[test] starting test/vitest/vitest.extension-messaging.config.ts
RUN v4.1.8 /home/0668001433/python_project/openclaw
✓ extension-messaging extensions/googlechat/src/approval-card-click.test.ts (7 tests) 31ms
Test Files 1 passed (1)
Tests 7 passed (7)
Start at 14:10:44
Duration 22.91s (transform 15.53s, setup 837ms, import 21.66s, tests 31ms, environment 0ms)
Related Files
extensions/googlechat/src/approval-card-click.ts:86-98extensions/googlechat/src/approval-card-click.test.ts:291-332(existing test validates the fix)src/infra/approval-errors.tsextensions/googlechat/src/approval-card-actions.ts