openclaw - 💡(How to fix) Fix Gmail watcher should honor 429 retry-after and avoid repeated history/message fetch retries

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

watch: handle push failed: googleapi: Error 429: User-rate limit exceeded. Retry after <redacted-timestamp>, rateLimitExceeded

Root Cause

A parked legacy Gmail watcher repeatedly hit Gmail 429 rateLimitExceeded during push handling. The Gmail retry-after timestamp kept moving forward because the handler continued receiving Pub/Sub retries and making Gmail API calls instead of circuit-breaking the affected account.

Code Example

watch: handle push failed: googleapi: Error 429: User-rate limit exceeded. Retry after <redacted-timestamp>, rateLimitExceeded
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw 2026.5.22 (a374c3a)
  • gogcli 0.15.0
  • Trigger path: Gmail Pub/Sub push handling in gog gmail watch serve

Impact

A parked legacy Gmail watcher repeatedly hit Gmail 429 rateLimitExceeded during push handling. The Gmail retry-after timestamp kept moving forward because the handler continued receiving Pub/Sub retries and making Gmail API calls instead of circuit-breaking the affected account.

Evidence

Runtime logs repeatedly showed push-handler failures like:

watch: handle push failed: googleapi: Error 429: User-rate limit exceeded. Retry after <redacted-timestamp>, rateLimitExceeded

Additional observations:

  • The errors were from push handling, not only manual watch start attempts.
  • Local config had already paused the legacy account by blanking the relevant hooks.gmail.account value.
  • The legacy Pub/Sub subscription was absent locally.
  • gog gmail watch status --account <redacted-legacy-account> still showed a stored server-side Gmail watch expiring May 31, 2026.
  • gog gmail watch stop --account <redacted-legacy-account> --force succeeded and cleared the stale local watch state.

Expected behavior

When Gmail returns 429 with a retry-after value, the watcher should pause Gmail API fetches for that account until after the retry-after time. Pub/Sub push handling should not continue making history.list / messages.get calls on every redelivery while the account is already rate-limited.

Suggested fix

  • Add a per-account 429 circuit breaker in gog gmail watch serve.
  • Persist the retry-after timestamp in watch state.
  • While the circuit is open, return a controlled response and avoid Gmail API calls for that account.
  • Consider a lower-cost metadata-only mode for low-importance watchers.
  • Add an explicit command to pause/stop the server-side watch while keeping local config parked.

Local recovery used

Stopped the stale server-side watch for the parked legacy account and left only the intended workspace watcher active. After recovery, the parked account had no local listener, no legacy Pub/Sub subscription, and no stored gog watch state.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When Gmail returns 429 with a retry-after value, the watcher should pause Gmail API fetches for that account until after the retry-after time. Pub/Sub push handling should not continue making history.list / messages.get calls on every redelivery while the account is already rate-limited.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING