Skip to content

feat(email): scheduled send + snooze (one-shot scheduler, cancel handles) - #1919

Merged
kovtcharov merged 6 commits into
mainfrom
claudia/task-2a5db755
Jul 6, 2026
Merged

kovtcharov merged 6 commits into
mainfrom
claudia/task-2a5db755

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

"Send this tomorrow at 9am" and "snooze this until Monday" simply didn't exist in the email agent — both are table-stakes in every comparable mail client, and neither Gmail nor Outlook exposes them via API (they're client-side features), so users had no workaround. This adds both as agent tools on a new persistent one-shot scheduler: a scheduled send is user-confirmed at creation (literal recipient/subject/body + fire time, per the #1264 Tier-2 gate) and then fires unattended at/after its time; snooze drops the message out of INBOX now and brings it back at the chosen time. Both are cancellable until they fire, jobs survive restarts (past-due jobs fire on next start), and a firing failure is recorded on the job and logged — never silently swallowed.

Since PR #1371 (gaia schedule cron dispatch) is approved but unmerged, the scheduler is deliberately minimal and email-scoped, with a documented seam: once #1371 lands (autonomy epic #555), its dispatcher can drive fire_due_jobs() directly — no store or tool changes. Privacy note: the pending send lives as a regular draft in the user's mailbox; the body is never persisted in the agent's SQLite.

Closes #1609

Test plan

  • python -m pytest hub/agents/python/email/tests/test_email_schedule.py -v — 16 tests covering the issue's acceptance criteria: fires once at/after its time and not before; snoozed message leaves INBOX and re-surfaces on time; cancel prevents both; send failure at fire time is persisted + loud; snooze rolls back the archive if the job write fails; jobs persist across restart; a scheduled send fired from the real polling thread writes its audit row safely (cross-thread sqlite regression guard).
  • python -m pytest tests/unit/agents/test_email_agent.py tests/unit/agents/test_email_agent_confirmation.py tests/integration/test_never_auto_send.py — confirmation gating: schedule_send is in TOOLS_REQUIRING_CONFIRMATION; the never-auto-send invariant is unchanged.
  • python util/lint.py --all — clean.
  • Manual (needs a connected mailbox): gaia email, ask "send X to Y tomorrow at 9am" → confirmation shows literal payload + time; list_scheduled_jobs shows the job; cancel_scheduled_job cancels it; draft is visible in the mail client.

Users can now say "send this tomorrow at 9am" or "snooze this until
Monday" — the two standard mail-client conveniences the agent lacked
(capability 17 in #1691, gap G6). Neither Gmail nor Outlook exposes
these through their APIs, so both are implemented GAIA-side on a new
one-shot fire-at-T scheduler.

- schedule_send: Tier-2 confirmation AT CREATION (#1264) — the user
  approves the literal recipient/subject/body and the fire time; the
  send then fires unattended at/after that time. The body is stored as
  a regular mailbox draft (visible in the user's mail client), never in
  SQLite; firing reuses send_draft_impl so the audit trail matches an
  interactive send.
- snooze_message: archive now via the existing organize path, re-add
  INBOX at the chosen time via unarchive_message with the prior label
  set (provider-correct for Gmail and Outlook). If persisting the
  re-surface job fails, the archive is rolled back — a message never
  silently vanishes from INBOX.
- Both cancellable before they fire (cancel_scheduled_job /
  list_scheduled_jobs); cancelling a non-pending job is a loud error.

The scheduler (EmailJobScheduler) polls a persistent SQLite job store
from a daemon thread and claims each job with an atomic
pending->firing UPDATE, so a job fires exactly once even with two
drivers; past-due jobs from a previous run fire on the next start. It
opens its own connection per pass — sharing the agent's sqlite3 handle
across threads is a use-after-close crash. A firing failure is
persisted on the job row and logged at ERROR, never swallowed.

PR #1371 (gaia schedule cron dispatch) is approved but unmerged, so
the store is email-scoped with a documented seam: once #1371 lands
(autonomy epic #555), its dispatcher can call fire_due_jobs() on its
cadence instead of the polling thread — no store or tool changes.
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve — no blocking issues.

This adds scheduled-send and snooze to the email agent via a new persistent one-shot job scheduler: a scheduled send is confirmed at creation (literal recipient/subject/body + fire time), the body stays as a mailbox draft rather than in SQLite, jobs survive restarts and fire on the next start if their time already passed, and firing failures are recorded on the job and logged rather than swallowed. The design is careful in the places that matter — the "backend call first, job row only on success" ordering, the atomic pending → firing claim that guarantees exactly-once firing, the snooze archive-rollback when the job write fails, and a dedicated per-pass DB connection so the polling thread never shares the agent's sqlite handle. Test coverage is genuinely thorough (16 tests hitting each acceptance criterion plus a cross-thread regression guard), and all four npm doc surfaces (README/SPEC/SKILL/CHANGELOG) plus the guide were updated together.

Only a few minor notes below, none blocking.

🔍 Technical details

🟢 Minor

Polling thread has no explicit stop hook (agent.py:349-358) — start_scheduler=True spins up a daemon thread but there's no stop()/close on the agent, so it's only reclaimed at process exit. That's correct for the long-lived REST sidecar (one agent per process), and tests disable it. It would only leak a thread if an EmailTriageAgent were constructed-and-discarded inside a long-lived process. Worth a small stop()/__del__ hook if that ever becomes a usage pattern — fine to leave as-is for now.

Concurrent-writer busy timeout is implicit (scheduler.py) — the polling thread's per-pass connection and the agent's main-thread connection both write email_scheduled_jobs on the same file. The atomic claim is correct (SQLite serializes writers), but collisions rely on sqlite3's default 5s busy timeout — there's no explicit busy_timeout/WAL. Very low risk at a 30s poll with tiny writes; noting it in case poll intervals ever shrink.

mark_failed sets fired_at (schedule_store.py:452-458) — a job that failed to fire gets a fired_at timestamp. Cosmetic only (the error column and failed status carry the real signal), but the column name reads as "this fired," which it didn't.

Strengths

  • Fail-loud throughout, matching the repo rule: missing executor → job marked failed with a persisted reason; executor exception → failed + log.exception; snooze rollback raises a message that names the exact mailbox state ("archived with no scheduled return") instead of leaving the message silently vanished.
  • The cross-thread sqlite trap is both avoided and tested — _execute_scheduled_send writes its audit row through the scheduler's per-pass connection, and test_polling_thread_fires_scheduled_send_with_db_write is a real regression guard for it rather than a happy-path smoke test.
  • Correct scope discipline: schedule_send is added to TOOLS_REQUIRING_CONFIRMATION (Tier-2 at creation, feat(email): send with confirmation (never auto-send) #1264) while snooze stays ungated as a reversible organize-tier action, and the "no REST route yet" boundary is documented consistently across README/SPEC/SKILL so integrators don't look for a client.scheduleSend() that doesn't exist.

@kovtcharov
kovtcharov enabled auto-merge July 1, 2026 22:42
itomek
itomek previously approved these changes Jul 6, 2026
# Conflicts:
#	hub/agents/npm/agent-email/CHANGELOG.md
#	hub/agents/python/email/gaia_agent_email/agent.py
@itomek

itomek commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Branch updated to main and the scheduler verified working on real hardware with real wall-clock timing — this PR is ready to merge.

Real-world proof — Ryzen AI box (Radeon, Ubuntu), Lemonade v10.8.1 + Gemma-4-E4B, real EmailJobScheduler polling thread (no injected clocks):

Step Result
schedule_send ~75s out (planted subject/body) Job persisted pending; body kept out of the SQLite payload (privacy invariant held)
Real fire fired_at − due_at = +1.027s — at/after due, never early; draft sent once
One-shot 3 further poll passes: send count still 1, row status=fired (consumed)
Cancel handle Second job flipped to cancelled; double-cancel rejected loudly (no silent no-op)
Snooze 30s Message left INBOX, resurfaced at +1.040s after due with prior labels restored
LLM-in-the-loop Live Gemma chose schedule_send with correct args; the new confirmation gate fired (15.1s end-to-end)
Notes
  • Only red check ("API Tests") is pre-existing on main — identical email-route 404 signature on main's latest run (50c17de). behavior-e2e is green after the update.
  • Merge to main: 2 conflicts (CHANGELOG + system-prompt block vs the merged voice tools), both sides kept. src/gaia/agents/base/agent.py change is a single addition of schedule_send to TOOLS_REQUIRING_CONFIRMATION — no prompt-assembly or parsing paths touched.
  • Local suite: 16/16 new schedule tests; 1311 passed across email suites; full tests/unit/ failures (8) all reproduce identically on main (pre-existing). Lint fully green.
  • Minor observation, non-blocking: the scheduler logs "Database initialized" at INFO on every poll pass (~2,880 lines/day at the 30s default) — worth downgrading to DEBUG or logging once in a follow-up.

itomek
itomek previously approved these changes Jul 6, 2026
# Conflicts:
#	docs/guides/email.mdx
#	hub/agents/npm/agent-email/CHANGELOG.md
#	hub/agents/npm/agent-email/README.md
itomek and others added 3 commits July 6, 2026 15:52
# Conflicts:
#	hub/agents/npm/agent-email/CHANGELOG.md
Cap 17 shipped with #1609 but the spec table/cards still tagged it
Planned after the main merge. Flip it to Wired and correct the
wired/planned counts and cross-references (cap 14 task extraction is
also Wired, not Planned) that assumed the stale state.
@itomek

itomek commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Final status: fully green and mergeable at dc05e4f — conflicts from the #1917/#1921 merges resolved, all checks passing (the API Tests fix from #1939 is now on main), 822 tests + lint green locally. Real-world scheduler evidence is in the comment above; the spec's capability-17 row was also corrected to Wired in this update.

@kovtcharov
kovtcharov added this pull request to the merge queue Jul 6, 2026
Merged via the queue into main with commit 491eb1f Jul 6, 2026
51 checks passed
@kovtcharov
kovtcharov deleted the claudia/task-2a5db755 branch July 6, 2026 21:33
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 7, 2026
The "API Tests" check has been red on every branch including main since
the email agent moved to a standalone hub wheel: the workflow installs
the routing and code hub packages into its venv but not
`gaia-agent-email`, so the email REST router never mounts and every
`/v1/email` test in `tests/test_api.py` fails with `404 {"detail":"Not
Found"}`. One install line fixes it.

**Test plan**
- [ ] "API Tests" check on this PR goes green (the email tests were the
only failures — same signature as main run 28462826567)
- [ ] After merge, re-run API Tests on open PRs amd#1917/amd#1919 — they
should go fully green

<details>
<summary>Evidence</summary>

- Main's latest run of this workflow (28462826567 @ 50c17de) fails with
the identical email-route 404 list as every PR branch — e.g.
`TestEmailTriageEndpoint::test_single_email_in_structured_out`: `assert
404 == 200`.
- Last green main run of this workflow was amd#1455 (2026-06-26) — the last
commit to touch `test_api.yml`; the failures start with the
hub-migration commits that followed.
- The workflow already installs the other two hub wheels for exactly
this reason (routing/code, amd#1102) — email was missed.
</details>

Co-authored-by: Tomasz Iniewicz <[email protected]>
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 14, 2026
… refresh (amd#2058)

Closes amd#2017. Part of the Agent UI v2 epic (amd#2014), Phase 0.

Four sibling plan docs describe the pre-v2 (localhost-trust, UI-owned
supervisor, sidecar-reads-grants) model as if it were current — a reader
following the wrong one builds the wrong thing. Separately, a week of
merged email work made several of the v2 breakdown doc's "verified"
facts stale (wrong contract version, closed issues, new in-sidecar
clocks). This aligns the docs with head of main so implementers of the
later batches aren't misled.

Adds the ⚠️ superseded/reconcile banner to `security-model.mdx`,
`email-sidecar-agent-ui-implementation.md`, `connectors.mdx`, and
`autonomy-engine.mdx`; fixes the `agent-ui.mdx` sentence that wrongly
put RAG/memory in sidecars; and refreshes
`agent-ui-v2-implementation-breakdown.md` (contract is 2.3 not 2.1,
amd#1706 closed by amd#1980, two merged in-sidecar clocks amd#1918/amd#1919 +
durable stores widen V2-15, hub paths updated to agent-first).

**Test plan**
- [ ] All four banners render and point at v2 §0.
- [ ] `agent-ui.mdx` no longer claims RAG/memory live in sidecars.
- [ ] Breakdown-doc facts match head of main.

---------

Co-authored-by: Ovtcharov <[email protected]>
kovtcharov pushed a commit that referenced this pull request Jul 18, 2026
…r (V2-15)

Before: four independent clocks — the UI backend Scheduler, the `gaia
schedule` CLI, and the email sidecar's two in-process clocks
(BriefingScheduler #1918, EmailJobScheduler #1919) — each died with the
process that owned it, so an "always-on" brief or scheduled send stopped
firing the moment the UI/CLI/sidecar closed, and V2-6's idle reaper had to
stay disabled (#2142) because reaping a sidecar silently killed its clock.

After: a single daemon-owned clock (`gaia.daemon.scheduler`) with an
exactly-once migration ledger. The email sidecar's jobs migrate into it
exactly once — a re-run is a no-op, an unschedulable job raises loudly, and
a dropped job is detected loudly (assert_no_dropped) rather than silently
lost. Under daemon supervision (GAIA_DAEMON_SUPERVISED, injected at spawn)
the sidecar gates its own embedded clocks off; standalone / bare-integrator
runs keep them live, so scheduling never silently stops for anyone the
daemon isn't driving.

Scope note (draft): the daemon clock + reconciliation + email gating land
here; rewiring routers/schedules.py, routers/goals.py and the `gaia
schedule` CLI to thin daemon clients rides on the #2153 custody store and
is a follow-up. The clock's SQLite store is custody-agnostic so it swaps
onto the #2153 host-custody store without touching this logic.

Part of #2014
Closes #2156
kovtcharov pushed a commit that referenced this pull request Jul 18, 2026
…r (V2-15)

Before: four independent clocks — the UI backend Scheduler, the `gaia
schedule` CLI, and the email sidecar's two in-process clocks
(BriefingScheduler #1918, EmailJobScheduler #1919) — each died with the
process that owned it, so an "always-on" brief or scheduled send stopped
firing the moment the UI/CLI/sidecar closed, and V2-6's idle reaper had to
stay disabled (#2142) because reaping a sidecar silently killed its clock.

After: a single daemon-owned clock (`gaia.daemon.scheduler`) with an
exactly-once migration ledger. The email sidecar's jobs migrate into it
exactly once — a re-run is a no-op, an unschedulable job raises loudly, and
a dropped job is detected loudly (assert_no_dropped) rather than silently
lost. Under daemon supervision (GAIA_DAEMON_SUPERVISED, injected at spawn)
the sidecar gates its own embedded clocks off; standalone / bare-integrator
runs keep them live, so scheduling never silently stops for anyone the
daemon isn't driving.

Scope note (draft): the daemon clock + reconciliation + email gating land
here; rewiring routers/schedules.py, routers/goals.py and the `gaia
schedule` CLI to thin daemon clients rides on the #2153 custody store and
is a follow-up. The clock's SQLite store is custody-agnostic so it swaps
onto the #2153 host-custody store without touching this logic.

Part of #2014
Closes #2156
kovtcharov pushed a commit that referenced this pull request Jul 18, 2026
…r (V2-15)

Before: four independent clocks — the UI backend Scheduler, the `gaia
schedule` CLI, and the email sidecar's two in-process clocks
(BriefingScheduler #1918, EmailJobScheduler #1919) — each died with the
process that owned it, so an "always-on" brief or scheduled send stopped
firing the moment the UI/CLI/sidecar closed, and V2-6's idle reaper had to
stay disabled (#2142) because reaping a sidecar silently killed its clock.

After: a single daemon-owned clock (`gaia.daemon.scheduler`) with an
exactly-once migration ledger. The email sidecar's jobs migrate into it
exactly once — a re-run is a no-op, an unschedulable job raises loudly, and
a dropped job is detected loudly (assert_no_dropped) rather than silently
lost. Under daemon supervision (GAIA_DAEMON_SUPERVISED, injected at spawn)
the sidecar gates its own embedded clocks off; standalone / bare-integrator
runs keep them live, so scheduling never silently stops for anyone the
daemon isn't driving.

Scope note (draft): the daemon clock + reconciliation + email gating land
here; rewiring routers/schedules.py, routers/goals.py and the `gaia
schedule` CLI to thin daemon clients rides on the #2153 custody store and
is a follow-up. The clock's SQLite store is custody-agnostic so it swaps
onto the #2153 host-custody store without touching this logic.

Part of #2014
Closes #2156
kovtcharov pushed a commit that referenced this pull request Jul 18, 2026
…r (V2-15)

Before: four independent clocks — the UI backend Scheduler, the `gaia
schedule` CLI, and the email sidecar's two in-process clocks
(BriefingScheduler #1918, EmailJobScheduler #1919) — each died with the
process that owned it, so an "always-on" brief or scheduled send stopped
firing the moment the UI/CLI/sidecar closed, and V2-6's idle reaper had to
stay disabled (#2142) because reaping a sidecar silently killed its clock.

After: a single daemon-owned clock (`gaia.daemon.scheduler`) with an
exactly-once migration ledger. The email sidecar's jobs migrate into it
exactly once — a re-run is a no-op, an unschedulable job raises loudly, and
a dropped job is detected loudly (assert_no_dropped) rather than silently
lost. Under daemon supervision (GAIA_DAEMON_SUPERVISED, injected at spawn)
the sidecar gates its own embedded clocks off; standalone / bare-integrator
runs keep them live, so scheduling never silently stops for anyone the
daemon isn't driving.

Scope note (draft): the daemon clock + reconciliation + email gating land
here; rewiring routers/schedules.py, routers/goals.py and the `gaia
schedule` CLI to thin daemon clients rides on the #2153 custody store and
is a follow-up. The clock's SQLite store is custody-agnostic so it swaps
onto the #2153 host-custody store without touching this logic.

Part of #2014
Closes #2156
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 18, 2026
…r (V2-15) (amd#2199)

## Why this matters

Four independent clocks used to run GAIA's periodic work — the UI
backend's `Scheduler`, the `gaia schedule` CLI, and the email sidecar's
two in-process clocks (`BriefingScheduler` amd#1918, `EmailJobScheduler`
amd#1919) — and **each died with the process that owned it**. A briefing or
scheduled send stopped firing the moment the UI/CLI/sidecar closed, so
"always-on" was false; worse, V2-6's idle-sidecar reaper had to stay
disabled (amd#2142) because reaping a sidecar silently killed its clock.

This lands the spine of the fix: **one daemon-owned clock**
(`gaia.daemon.scheduler`) that adopts the in-sidecar jobs **exactly
once** through a migration ledger. A re-run of the migration is a no-op,
an unschedulable job raises loudly, and a dropped job is detected loudly
(`assert_no_dropped`) instead of silently vanishing — the exact
regression the epic flagged as most likely here. Under daemon
supervision (`GAIA_DAEMON_SUPERVISED`, injected at spawn) the email
sidecar gates its own embedded clocks off; standalone / bare-integrator
/ `CustodyProvider` runs never see the var and keep them live, so
scheduling never silently stops for anyone the daemon isn't driving.

**Draft, and why:** the daemon clock + reconciliation + email gating are
complete and tested here. Rewiring `routers/schedules.py`,
`routers/goals.py`, and the `gaia schedule` CLI into thin daemon clients
— and landing schedule/task state in *host custody* (AC #2) — rides on
**amd#2153** (custody store), which is being built in parallel. The clock's
SQLite store is deliberately custody-agnostic so it swaps onto amd#2153's
host-custody store without touching this logic. Expect a rebase once
amd#2153 lands; the idle-reaper flip (AC #6) is gated behind that same
follow-up so gating lands before reaping, never after.

## Test plan

- [x] `python -m pytest tests/unit/test_daemon_scheduler.py
tests/unit/test_daemon_scheduler_migration.py` — clock fires
exactly-once, recurring re-arms, missing executor / executor exception
fail loudly (not dropped), atomic claim blocks double-fire; reconcile is
idempotent, dropped-job + unschedulable-job raise loudly, no double-run
when old+new paths coexist.
- [x] `python -m pytest
hub/agents/python/email/tests/test_daemon_migration.py` — **exactly-once
migration of the in-sidecar jobs** (the flagged regression): real
`schedule_store` one-shots + the daily briefing migrate once, a re-run
adopts nothing, a fired job is never re-migrated; supervision gate
detected only on the exact env value.
- [x] `python -m pytest
hub/agents/python/email/tests/test_email_schedule.py` — existing email
scheduler suite stays green (standalone parity, AC #4): 16 passed.
- [x] `python util/lint.py` — black + isort + flake8(F) clean on all
changed files (pre-existing unrelated failures noted below).

Pre-existing, unrelated to this change (identical on `main`):
`tests/unit/test_agent_sidecar_manager.py` and one
`test_daemon_agents_routes.py` case fail on Windows (`os.killpg` /
group-kill are Unix-only); `tests/unit/test_schedule_daemon.py` errors
on a missing `tomli_w` dep in this env.

Part of amd#2014
Closes amd#2156

Co-authored-by: Ovtcharov <[email protected]>
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Aug 17, 2026
Release notes had grown into long blocks of prose with a marketing-toned
paragraph on top. They now generate as short bullets grouped by section,
with a word cap on the narrative part. Nothing informational is lost —
every PR link, contributor credit, and changelog entry is preserved; the
prose around them is cut.

Two generators write `docs/releases/<tag>.mdx` and they had drifted
apart. The `gaia-release` skill told the model GAIA's notes "read dry"
and to make them "engaging"; the `release-notes` job in `claude.yml`
asked for "comprehensive" notes with an `## Overview` paragraph and
emoji headings. Fixing one alone would have been overwritten by the
other on the next tag, so both now share one spec.

Closes amd#2961

## What it looks like now

Regenerated from the last two releases — same facts, same PR numbers,
new template. Narrative words (the capped part, excluding
bug-fix/contributor/changelog lists):

| Release | Published | Regenerated | Cap |
|---|---|---|---|
| v0.22.0 (minor) | 1705 | **538** | 600 |
| v0.23.0 (minor) | 1119 | **280** | 600 |

<details>
<summary>Example 1 — v0.23.0 regenerated</summary>

```markdown
---
title: "v0.23.0"
description: "Install and run agents from the terminal, add capabilities as skills, and connect a Microsoft account without a secret."
---

# GAIA v0.23.0 Release Notes

Agents are now installable from the terminal, and the confirmation gate that pauses an agent before a consequential action works everywhere, not just in the Agent UI.

## Breaking Changes

- **`GAIA_MICROSOFT_TENANT` is gone** — the Microsoft connector split into Personal and Work/School, each with its own tenant. Drop the variable and pick the matching connector. (PR [amd#2729](amd#2729))

## What's New

- **Install and run agents from the terminal** — `gaia hub list`, `gaia hub install <agent> --trust`, `gaia hub uninstall <agent>`. `--trust` is required for an unverified agent. (PRs [amd#2484](amd#2484), [amd#2530](amd#2530), [amd#2708](amd#2708))
- **Every agent asks before it acts** — the confirmation gate for sending mail, writing files, and running commands now fires from the terminal, the local API, and MCP tool calls, not only the Agent UI. Set `GAIA_AUTO_APPROVE_TOOLS=1` to opt out. (PRs [amd#2475](amd#2475), [amd#2544](amd#2544), [amd#2846](amd#2846), [amd#2854](amd#2854))
- **Safer by default** — the MCP bridge binds to localhost and enforces `--auth-token`; the local API refuses credentialed cross-origin requests from non-allow-listed sites; MCP servers launch without a shell; agents cannot write to `~/.gaia` or pass crafted SQL to the database agent. (PRs [amd#2246](amd#2246), [amd#2238](amd#2238), [amd#2344](amd#2344), [amd#2844](amd#2844), [amd#2847](amd#2847), [amd#2860](amd#2860))
- **Add capabilities as skills** — `gaia skill create|import|list|info` gives an agent a new capability from a folder and a manifest. Skills are signed with trust tiers, audited before publish, and opt-in. (PRs [amd#2669](amd#2669), [amd#2692](amd#2692), [amd#2702](amd#2702), [amd#2693](amd#2693))
- **Connect a Microsoft account without a secret** — Personal and Work/School are separate connectors with device-code sign-in. (PRs [amd#2718](amd#2718), [amd#2364](amd#2364))
- **Lemonade Server 11.5.0.**

## Bug Fixes

- **Triage paginates large inboxes and reports truncation** (PR [amd#2646](amd#2646)) — mail past a hidden limit is no longer dropped without saying so.
- **Thread messages come back sorted and numbered** (PR [amd#2570](amd#2570)) — "reply to 3" hits the message shown at position 3.
- **The inbox pre-scan reports uncertainty as uncertainty** (PR [amd#2587](amd#2587)).
- **An email conversation survives its turns** (PR [amd#2837](amd#2837)) — a follow-up keeps session context.
- **A bare reconnect keeps existing grants** (PR [amd#2733](amd#2733)).
- **Restore from Trash anytime** (PR [amd#2542](amd#2542)) — no time window on undo.
- **Sender priority no longer overrides content classification** (PR [amd#2774](amd#2774)).
- **The agent survives an OpenMP double-init** (PR [amd#2508](amd#2508)).
- **Large tool results truncate to valid JSON** (PR [amd#2645](amd#2645)).
- **A missing model surfaces as a real 404** (PR [amd#2245](amd#2245)).
- **GPU is detected on all platforms and `default_device` is honoured** (PR [amd#2244](amd#2244)).
- **A sidecar that is alive but not serving is detected** (PR [amd#2707](amd#2707)).
- **The model-slot lease is held across inference** (PR [amd#2394](amd#2394)) — a second agent can't evict the model mid-generation.
- **A browser that never launched is surfaced** (PR [amd#2507](amd#2507)).
- **Stop aborts in-flight streaming** (PR [amd#2166](amd#2166)).

## Known Issues

- **The email agent is beta and CLI-first** — treat its output as a draft to review.
- **A full inbox triage can time out on larger mailboxes.**
- **Email autonomy is experimental** and not wired up in the packaged sidecar.

## Contributors

- [@handle](https://github.com/handle) — <contribution> (PR [#NNN](https://github.com/amd/gaia/pull/NNN))
  <!-- generated from the commit log; v0.23.0's list is unchanged from the published notes -->


## Full Changelog

**N commits** since v0.22.0:

- `<sha>` — <subject>

Full Changelog: [v0.22.0...v0.23.0](amd/gaia@v0.22.0...v0.23.0)
```
</details>

<details>
<summary>Example 2 — v0.22.0 regenerated (the largest recent
release)</summary>

```markdown
---
title: "v0.22.0"
description: "The email agent tracks follow-ups and action items, drafts in your voice, and runs as its own process. Plus a cron scheduler and Word document support in RAG."
---

# GAIA v0.22.0 Release Notes

A large release built around the email agent, which now tracks what you're waiting on instead of forgetting it after triage.

## Breaking Changes

- **Triage returns a reply scaffold, not an empty draft** — `POST /v1/email/triage` and `/triage/batch` now return a `DraftScaffold` without `body`. Code reading `result.draft.body` gets a missing key instead of `""`; use `POST /v1/email/draft` for composed prose. (PR [amd#1984](amd#1984))
- **RoutingAgent and DocumentQAAgent moved to standalone packages** — install `gaia-agent-routing` and `gaia-agent-docqa`. The old imports fail; there is no deprecation shim. (PR [amd#1455](amd#1455))

## What's New

- **An inbox agent that keeps track** — `gaia email` scans Sent folders across every connected mailbox and flags threads still waiting on a reply past a window you set (default 3 days). Detection only; it never nudges anyone for you. (PRs [amd#1922](amd#1922), [amd#1917](amd#1917), [amd#1919](amd#1919), [amd#1918](amd#1918))
- **Drafts in your own voice** — the agent derives greeting, sign-off, length, and formality from your Sent history and composes against that. Only the derived characteristics are stored, never old mail content. (PR [amd#1925](amd#1925))
- **Attachments work end to end** — triage surfaces each attachment's name, type, and size, and drafting and sending accept real attachments as Gmail multipart MIME or Outlook Graph attachments. (PRs [amd#1921](amd#1921), [amd#1883](amd#1883))
- **Email runs as its own process in the Agent UI (beta)** — install it from the Agent Hub panel and the UI talks to it over HTTP, instead of loading the email stack into the UI process. (PRs [amd#1884](amd#1884), [amd#1910](amd#1910), [amd#2100](amd#2100), [amd#2101](amd#2101), [amd#2105](amd#2105))
- **Run prompts on a cron from the terminal** — `gaia schedule add --name digest --cron "0 9 * * *" --prompt "summarize my inbox" --sink stdout`, then `gaia schedule daemon`. Schedules live in a hand-editable `~/.gaia/schedules.toml`; sinks are `stdout`, `file:<path>`, `notification`, or `telegram`. (PR [amd#1371](amd#1371))
- **Agents learn from work they repeat** — after enough successes on the same shape of goal, an agent distills the tool sequence into a reusable procedure and recalls it next time. Runs inside the existing memory pass; nothing to install. (PR [amd#1794](amd#1794))
- **Pick your model once** — `gaia config set default_model <id>` persists across `gaia chat`, `gaia llm`, and `gaia prompt`. An explicit `--model` still wins for a one-off. (PR [amd#1863](amd#1863))
- **RAG reads Word documents** — `.docx` files index like PDF and PPTX, including table cells, nested tables, content controls, hyperlinks, and textboxes, so filled-in form values get indexed. (PR [amd#1866](amd#1866))
- **A new default embedder** — the previous default cannot be loaded by current llama.cpp builds, which broke indexing, code search, and memory embedding on an up-to-date Lemonade. The default is now EmbeddingGemma 300M at the same 768 dimensions. (PRs [amd#1952](amd#1952), [amd#1761](amd#1761), [amd#1748](amd#1748))
- **The Agent Hub shows what an agent is worth** — an agent's page now carries its eval scorecard with a score badge and a code-derived capability matrix. (PRs [amd#1985](amd#1985), [amd#2020](amd#2020), [amd#2066](amd#2066))
- **Lemonade Server 10.10.0** — adds an audio-generation endpoint, lets Windows reuse system ROCm, and inhibits suspend during inference. Two upstream breaking changes are Linux-specific. (PR [amd#1969](amd#1969))

## Bug Fixes

- **`gaia init` said a working Lemonade wasn't installed** (PR [amd#1940](amd#1940)) — modern Lemonade (10.7+) dropped the `lemonade-server` CLI that GAIA probed for.
- **Installing the email agent from the Hub failed on every platform** (PR [amd#2086](amd#2086)).
- **Bulk triage broke on any real inbox** (PR [amd#2088](amd#2088)) — 60 emails overflowed the 16K context window; the result envelope is now condensed.
- **RAG silently indexed nothing** (PR [amd#1979](amd#1979)) — a failed `sentence-transformers` import made every indexing call a no-op.
- **Email bodies were truncated at 4,000 characters with no override** (PR [amd#2036](amd#2036)) — MFA codes and precise replies lost content past the cutoff.
- **Long threads overflowed the model's context** (PR [amd#2076](amd#2076)).
- **A disabled device was treated as usable** (PR [amd#2081](amd#2081)) — a device reporting `available: false`, such as an unpowered NPU, was misread as ready.
- **A newly connected mailbox was skipped** (PR [amd#1808](amd#1808)) — mailboxes connected mid-session were not picked up.
- **JSON with a `}` inside a string was dropped** (PR [amd#1824](amd#1824)).
- **Outlook users were told to reconnect Google** (PR [amd#1757](amd#1757)) — `AGENT_NOT_GRANTED` named the wrong provider.
- **The Agent UI hard-crashed on a recoverable GPU crash** (PR [amd#1799](amd#1799)) — it now falls back to software rendering.
- **A user-edited memory could be silently downgraded and then wiped** (PR [amd#1958](amd#1958)).
- **The builder agent ignored an agent name you had already given** (PR [amd#1981](amd#1981)).
- **The landing and hub pages scrolled sideways on phones** (PR [amd#1959](amd#1959)).

## Known Issues

- **Inbox pre-scan needs a single mailbox for now** — with both Gmail and Outlook connected, an Agent UI pre-scan errors. Disconnect one in Settings → Connectors; triage itself still spans every mailbox. ([amd#2127](amd#2127))
- **Spam detection under-flags over the REST API** — `/v1/email/triage` uses a narrow sender check rather than the model's reading. The agent's own inbox scanning is unaffected. ([amd#2124](amd#2124))
- **The email agent is beta** — treat its output as a draft to review. It never sends without your confirmation.

## Contributors

- [@alexey-tyurin](https://github.com/alexey-tyurin) — skill auto-synthesis / procedural memory (PR [amd#1794](amd#1794))
- [@TravisHaa](https://github.com/TravisHaa) — the `gaia schedule` CLI and cron-based dispatch (PR [amd#1371](amd#1371))
- [@Rohithmatham12](https://github.com/Rohithmatham12) — refresh resolved email backends before multi-mailbox triage (PR [amd#1808](amd#1808))
- [@Osamaali313](https://github.com/Osamaali313) — fix `extract_json_from_text` dropping JSON containing `}` (PR [amd#1824](amd#1824))
- [@eeee2345](https://github.com/eeee2345) — offline model-endpoint guard-proxy integration guide (PR [amd#1809](amd#1809))
- [@somo9909](https://github.com/somo9909) — prerequisites section for the memory guide (PR [amd#1665](amd#1665))

## Full Changelog

**N commits** since v0.21.2:

- `<sha>` — <subject>

Full Changelog: [v0.21.2...v0.22.0](amd/gaia@v0.21.2...v0.22.0)
```
</details>

<details>
<summary>What changed in the templates</summary>

- The narrative overview paragraph and the `**Why upgrade:**` block are
gone — the latter restated `What's New` verbatim.
- `What's New` entries are bullets, not `###` prose blocks.
- Tone guidance is no longer restated in the skill; it points at
CLAUDE.md § How You Communicate.
- The skill's embedded example now shows the old prose block as **bad**
and the bullet form as **good**.
- Emoji removed from the CI prompt (it asked for 🚀 / 🎯 / 🐛 headings
against the skill's own no-emoji rule).
- Both generators now emit the same sections in the same order, so the
file's shape no longer depends on which one ran.
- The cap excludes `Bug Fixes` / `Known Issues` / `Contributors` / `Full
Changelog`. Those are reference lists sized by how many fixes shipped —
capping them would hide work. This was caught by regenerating v0.22.0,
which overflowed a whole-file cap purely on its 14 bug-fix bullets.

**Follow-up, not in this PR:** the cap lives in prompt text, so it is
advisory. Making it a hard check in `util/validate_release_notes.py`
would enforce it in CI.
</details>

## Test plan

- [ ] `python util/validate_release_notes.py <regenerated sample> --tag
v0.23.0` exits 0 — passes unmodified, no validator changes in this PR
- [ ] `awk '/^## (Bug Fixes|Known Issues|Contributors|Full
Changelog)/{exit} {print}' <file> | wc -w` is under 350 (patch) / 600
(minor-major)
- [ ] `.github/workflows/claude.yml` parses as valid YAML and its
release-notes prompt contains no emoji
- [ ] `.claude/skills/gaia-release/SKILL.md` is under 500 lines (498)
- [ ] Both generators list the same sections in the same order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent::email Email agent changes agents documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(email): scheduled send + snooze

3 participants