#763 Phase B: Gmail triggers (watch_gmail) — durable poll-and-react

closed high Created 2026-06-21 23:27 · Updated 2026-06-21 23:27

Description

Edit
watch_gmail(match, instruction, interval_minutes) + stop_gmail_watch(watch_id) MCP tools. Reuses the proven schedule_goal durable-cron + unattended SCHEDULED_AGENT_DSL (tool_catalog includes gmail). The watcher polls Gmail every minute for 'match', and for each new message runs 'instruction' agentically (reply via gmail_send). Dedup is STATELESS (readonly scope can't mark read): the agent checks its own Sent mail (in:sent to:<sender>) before replying, self-correcting across cron ticks. Validated e2e on demo: rule subject:JOKEME -> reply with a joke; durable cron fired every minute for ~10 min; inbound from rodmena@me.com -> single joke reply (messages/send 200), exactly 1 reply (no double-send). stop = POST /workflows/{cron_run_id}/cancel. Follow-up: real-time Pub/Sub push path (gmail.watch -> topic -> gateway/events) as the low-latency upgrade; gmail.modify scope for label-based dedup; per-tenant watch registry/listing.

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...