Skip to content

Gmail watcher: start when gateway (re)starts#87

Merged
steipete merged 1 commit intoopenclaw:mainfrom
jverdi:jverdi/gmailwatcher-survive-restarts
Jan 3, 2026
Merged

Gmail watcher: start when gateway (re)starts#87
steipete merged 1 commit intoopenclaw:mainfrom
jverdi:jverdi/gmailwatcher-survive-restarts

Conversation

@jverdi
Copy link
Copy Markdown
Contributor

@jverdi jverdi commented Jan 2, 2026

Start and stop gog based on existence of gmail hooks config, when the gateway starts up.

This fixes a bug where restarting the gateway would leave the gmail hooks no longer watching.

@steipete
Copy link
Copy Markdown
Contributor

steipete commented Jan 3, 2026

🦞 Codex Review

Findings

  • 🚨 HIGH: Secrets logged in cleartext; log.info("starting gog ...") includes --token/--hook-token/--hook-url args; leaks creds to logs. (src/hooks/gmail-watcher.ts:62, src/hooks/gmail.ts:231)
  • ⚠️ Medium: Watcher start not idempotent; repeat startGmailWatcher leaks interval + double gog process/port conflict; no guard/stop-first.
  • ⚠️ Medium: Spawn error leaves watcherProcess set + no restart; error handler logs only; watcher stuck "running."
  • ℹ️ Low: No tests covering start/stop/restart/renew; regressions hard to catch.

Open Questions

  • Can startGatewayServer run multiple times in one process? If yes, need reentry guard.

Summary
Adds Gmail watcher service; starts at gateway boot, renews watch, restarts on exit, stops on shutdown.

Review by Clawd 🦞 via Codex

@steipete steipete merged commit ca9b0db into openclaw:main Jan 3, 2026
1 check passed
dgarson referenced this pull request in dgarson/clawdbot Feb 4, 2026
slathrop referenced this pull request in slathrop/openclaw-js Feb 11, 2026
Tasks completed: 2/2
- Task 1: Port commits #87 and #88 (cache eviction + SQLITE_BUSY regression test)
- Task 2: Port commits #114 and #149 (scope warning + model cache reuse)

SUMMARY: .planning/phases/12-memory-qmd-hardening/12-09-SUMMARY.md
slathrop referenced this pull request in slathrop/openclaw-js Feb 11, 2026
Tasks completed: 2/2
- Port i18n tooling + seed translations (commits #87, #88)
- Port language code + switcher fixes (commits #89, #91)

SUMMARY: .planning/phases/17-docs/17-08-SUMMARY.md
songliu0403-rgb pushed a commit to songliu0403-rgb/openclaw that referenced this pull request Feb 26, 2026
github-actions bot pushed a commit to Piboonsak/openclaw_github that referenced this pull request Mar 8, 2026
zhyongrui added a commit to zhyongrui/openclaw that referenced this pull request Mar 20, 2026
0x666c6f added a commit to 0x666c6f/openclaw that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants