Skip to content

Tools: Gmail attachments, Google Sheets, and scheduling - #12

Merged
Taskmaster-1 merged 4 commits into
mainfrom
feat/tools-3
Oct 31, 2026
Merged

Taskmaster-1 merged 4 commits into
mainfrom
feat/tools-3

Conversation

@Taskmaster-1

Copy link
Copy Markdown
Owner

Three more groups of tools for the agent, built on the existing approval and policy rules.

Gmail attachments

  • gmail_read_thread lists each message's attachments.
  • gmail_save_attachment copies an attachment into your files. Text and PDFs are extracted and indexed, photos can be viewed with file_read, and anything saved can be forwarded with gmail_send.
    • Its effect is read: it only makes a private copy on the server. Its output is untrusted.
    • The 25 MB cap is checked before downloading.
    • Gmail changes attachment ids on every fetch, so the tool re-reads the message and matches the attachment again.

Google Sheets

These need a new optional permission group, "Sheets" (spreadsheets); grants without it get a reconnect prompt.

  • sheets_read: with no range it lists the tabs; with a range it returns values, up to 200 rows × 50 columns per page, with nextRange for the next page.
  • sheets_append, sheets_update and sheets_create are writes and ask for approval. All of them accept a spreadsheet link or id.
  • Append and update require spreadsheetTitle, and nothing is written if it doesn't match the real title. This keeps the approval card from naming a different spreadsheet than the one written to.
  • New risk facts: "Overwrites N cells", and "Includes formulas" for any cell starting with = (a formula like =IMPORTDATA can leak the sheet when someone opens it).
  • The approval view shows the rows as a small table, with formulas in monospace.

Scheduling

  • schedule_task creates a reminder, which notifies you through push, Slack DM or email without calling the model, or a task, which the agent carries out in the same chat at that time.
    • Accepted times: ISO with an offset, in the future, and at most a year ahead.
    • repeat takes none, daily, weekdays, weekly or monthly, or a cron at least 15 minutes apart.
  • list_scheduled and cancel_scheduled. Cancelling pauses the item; nothing is deleted.
  • Scheduling and cancelling for yourself are allowed by default, the same as memory_save. In a run that has read outside content (tainted), both ask, so an email can't plant a future instruction or turn off your automations.
  • Migration 0010_schedule_tasks adds one-off automations (run_at, kind) and user_settings.timezone.
  • Settings has a time zone picker, and the browser's zone is filled in once. The prompt now includes your local date and time zone.
  • On the Automations page, one-offs show "Once" / "Reminder" labels and can be cancelled.
  • A task scheduled for a chat that is busy retries every minute.

Checked

  • 317 tests pass; lint, typecheck and the web build pass.
  • In the browser, against fake Google and Slack: the Sheets append card (table and formula warning), the tainted scheduling card, a reminder allowed without asking, and the Automations, Settings and Connections pages at 1440 and 390 px, with no overflow.
    • This turned up one bug, now fixed: the scheduling card's time was shown in the browser's zone while its title used the server's zone.
  • Not tested against the real Gmail or Sheets APIs, or real push or Slack reminder delivery. Email reminder delivery is covered by tests.

- gmail_read_thread lists each message's attachments (id, name, type, size)
- gmail_save_attachment (read, untrusted) copies an attachment into the
  user's files: text and PDFs are extracted and indexed, photos become
  viewable with file_read, anything can be forwarded with gmail_send.
  Matches by name when Gmail's per-fetch attachment id changed, sniffs
  octet-stream types, refuses over 25 MB before downloading
- New optional Sheets scope group (spreadsheets) with sheets_read,
  sheets_append, sheets_update and sheets_create; ids or links accepted,
  writes check the spreadsheet title the approval card shows
- Risk facts: "Overwrites N cells" and "Includes formulas"
- Approval card shows sheet writes as a table; Connections lists the tools
- Fake Google covers attachments and the Sheets API; tests incl. an
  invoice-to-sheet run with approval
- Docs: google.md, README, api.md
The agent can now schedule future work for the user with schedule_task,
list_scheduled and cancel_scheduled. Each scheduled item is a one-off
(new run_at column, turns itself off after firing) or recurring schedule
automation on the chat it was asked in, so a fired task continues that
conversation with its context. Reminders (kind "reminder") make no model
call: they add a note to the chat and notify through push, Slack DM and
email. Scheduling is allowed by default but asks in tainted runs, so an
email cannot plant a scheduled instruction.

Adds a per-user time zone setting (auto-filled from the browser), used for
schedules, previews and the date in the system prompt; one-offs and
reminders on the Automations page; an approval view for schedule_task.
# Conflicts:
#	apps/web/components/approval/payload.tsx
#	packages/tools/src/index.ts
@Taskmaster-1
Taskmaster-1 merged commit 90ab385 into main Oct 31, 2026
1 check passed
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