Skip to content

Built-in Gmail and Calendar, plus email and webhook triggers - #6

Merged
Taskmaster-1 merged 1 commit into
mainfrom
feat/reach
Oct 24, 2026
Merged

Taskmaster-1 merged 1 commit into
mainfrom
feat/reach

Conversation

@Taskmaster-1

Copy link
Copy Markdown
Owner

Phase 1 of making the product stronger: the agent now works where your work is, and starts on its own when something happens.

What's new

Gmail and Google Calendar, built in. Connect Google once from Connections; no MCP server to run.

  • Gmail: search, read a full thread, save drafts, send or reply in-thread, label, archive, mark read, star, trash
  • Calendar: list events, create with invites (and Meet links), update, accept or decline, delete
  • Every tool has an effect, so the existing approval rules apply. Drafts are allowed by default; sending, inviting and deleting ask.

Automations that react to events, not just the clock.

  • When email arrives: new Gmail messages matching a search (from:@customer.com, is:important, …). Polled every 2 minutes, so it works without a public push endpoint.
  • On a webhook: a secret URL for GitHub, Linear, Stripe, Zapier, or curl.
  • Each event becomes its own task with the email or payload attached, so an incoming event can never interrupt an approval you're in the middle of.

Safety

  • Event-triggered tasks start tainted: only reads are auto-allowed, even with an "always allow" rule. Tested end to end: a malicious email asks for the board deck, the agent tries gmail_send, and the send waits for approval.
  • Third-party text is quoted in a delimited block and can't close it early.
  • Google OAuth uses PKCE. The state is sealed and bound to the user who started the flow, and tokens are encrypted at rest. Disconnecting revokes the grant at Google.
  • Outgoing email headers are stripped of line breaks, so no header injection.
  • Webhook URLs carry a 192-bit token, compared in constant time and rotatable. They're rate-limited to 60 per hour and capped at 256 KB.

Also fixed

  • PATCH /api/automations/:id used to reset omitted fields to their defaults. For example, pausing an automation reset its timezone to UTC. Omitted fields now keep their values.

Testing

  • A fake Google server (@synapse/tools/testing) backs 16 tool tests: OAuth, refresh and revoke, threading headers, labels, the trigger cursor's no-double-fire behavior, and calendar responses.
  • 6 server tests cover connecting over HTTP, polling email triggers, the injection case, webhooks (wrong token, pause, rotate), and the PATCH regression.
  • Totals: 109 tests pass, plus lint, typecheck and the Next production build.
  • UI checked in light and dark at 1440 and 390 wide. The sweep found no overflow and no console errors.
  • Not yet tested against real Google. That needs a Google Cloud OAuth app (see docs/google.md).

Setup guide: docs/google.md. Migration: 0003_triggers_and_integrations.

🤖 Generated with Claude Code

…or webhooks

- Google OAuth (PKCE, sealed state bound to the user, sealed tokens, refresh, revoke)
- Gmail tools: search, read thread, draft, send/reply in thread, organize, trash
- Calendar tools: list, create, update, respond, delete
- Automation triggers: schedule, new Gmail matching a search (polled), secret webhook URL
- Each event starts its own task, tainted from the first message
- Fix: PATCH /api/automations no longer resets omitted fields to defaults
- Connections: built-in Google card; Automations: trigger picker, webhook URL, errors
- docs/google.md setup guide; API, README and SECURITY updates
@Taskmaster-1
Taskmaster-1 merged commit 7499026 into main Oct 24, 2026
1 check passed
@Taskmaster-1
Taskmaster-1 deleted the feat/reach branch October 24, 2026 23:52
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.

1 participant