-
Notifications
You must be signed in to change notification settings - Fork 591
Gmail watcher should honor 429 retry-after and circuit-break per account #643
Copy link
Copy link
Open
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:message-lossThis issue is about lost, duplicated, misrouted, or suppressed channel messages.This issue is about lost, duplicated, misrouted, or suppressed channel messages.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:message-lossThis issue is about lost, duplicated, misrouted, or suppressed channel messages.This issue is about lost, duplicated, misrouted, or suppressed channel messages.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Environment
gogcli0.15.0gog gmail watch servehandling Gmail Pub/Sub push deliverya374c3a) supervising the externalgogwatcher processImpact
A parked legacy Gmail watcher repeatedly hit Gmail
429 rateLimitExceededduring push handling. The Gmailretry-aftertimestamp 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:
Additional observations:
watch startattempts.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> --forcesucceeded and cleared the stale local watch state.Repository boundary
This was first filed as openclaw/openclaw#86610, but review there found OpenClaw only configures, starts, renews, and supervises the external
gog gmail watch serveprocess. The repeatedhistory.list/messages.getfetches are in thegogclipush handler, so this issue belongs here.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.getcalls on every redelivery while the account is already rate-limited.Suggested fix
gog gmail watch serve.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
gogwatch state.