Repository navigation
fix(gmail): prevent duplicate watch renewals during stalls - #108974
Conversation
|
Codex review: passed. Reviewed July 19, 2026, 7:09 AM ET / 11:09 UTC. Summary PR surface: Source +40, Tests +100. Total +140 across 4 files. Reproducibility: yes. from source: with a renewal interval shorter than an unresolved watch-start command, the former interval callbacks could each start another renewal; the new promise guard directly covers that path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Merge the reviewed exact head through the existing automerge gates so both Gmail watcher lifecycles retain one active periodic renewal at a time. Do we have a high-confidence way to reproduce the issue? Yes, from source: with a renewal interval shorter than an unresolved watch-start command, the former interval callbacks could each start another renewal; the new promise guard directly covers that path. Is this the best way to solve the issue? Yes. Lifecycle-local single-flight guards at the two scheduler entry points prevent overlap without adding configuration or changing successful renewal scheduling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3b84a55d9943. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +40, Tests +100. Total +140 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
Review history (6 earlier review cycles)
|
|
@clawsweeper automerge |
|
🦞🧹
Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
Re-review progress:
|
|
@clawsweeper automerge |
|
@clawsweeper automerge |
|
@clawsweeper automerge |
|
@clawsweeper automerge Retry the exact current head 34a3001 after ClawSweeper main merged openclaw/clawsweeper#670, #671, and #672. Keep the existing fail-closed validation boundaries and use the production automerge path. |
|
@clawsweeper automerge Retry the exact current head 34a3001 after openclaw/clawsweeper#679 merged. Use the production direct-behind path, preserve exact-head/check/review gates, and do not rewrite the contributor branch solely for base drift. |
|
@clawsweeper re-review Refresh the exact-head verdict after openclaw/clawsweeper#679 landed. Automerge is already enabled; preserve the current head and let the trusted exact-head verdict resume the production direct-behind path. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
@clawsweeper automerge Resume the exact current head after openclaw/clawsweeper#680 landed. |
|
@clawsweeper automerge Resume the exact current head after openclaw/clawsweeper#691 merged. Reuse and re-dispatch the completed exact-head pass verdict; keep all production merge gates fail-closed. |
|
@clawsweeper automerge |
1 similar comment
|
@clawsweeper automerge |
|
@clawsweeper automerge |
|
@clawsweeper automerge Resume the exact current head after openclaw/clawsweeper#702 merged. If the protected merge gate reports the head behind base, route it through the existing cloud rebase repair lane; preserve all exact-head review, CAS, immutable-ledger, and merge safety gates. |
|
Merged via squash.
|
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where Gmail watch renewal could launch duplicate
gog gmail watch startcommands when a previous periodic renewal was still stalled. This affects both the gateway-managed watcher andopenclaw webhooks gmail runwhen the configured renewal interval is shorter than the command's two-minute timeout.Why This Change Was Made
Each Gmail watcher lifecycle now admits only one periodic renewal at a time. Later timer ticks are coalesced until the active command settles, while existing retry timing, failure logging, configuration, and process lifecycle behavior remain unchanged.
User Impact
Operators no longer get overlapping Gmail watch registration commands during slow or stalled renewals. Normal renewals continue on the next interval after the active command settles.
Evidence
src/hooks/gmail-watcher.test.tsandsrc/hooks/gmail-ops.test.ts— 2 files, 12 tests passed.startGmailWatcherscheduler and actual child processes. WithrenewEveryMinutes: 1, the first periodic renewal was held for 70 seconds; after 135 seconds exactly two watch-start calls were observed: the initial registration and one renewal. The minute-two tick did not launch a third command.