Skip to content

feat(schedule): add gaia schedule CLI + cron-based dispatch - #1371

Merged
kovtcharov-amd merged 4 commits into
amd:mainfrom
TravisHaa:feature/schedule-cli-892
Jul 7, 2026
Merged

kovtcharov-amd merged 4 commits into
amd:mainfrom
TravisHaa:feature/schedule-cli-892

Conversation

@TravisHaa

Copy link
Copy Markdown
Contributor

Why this matters

GAIA had no way to run a skill or prompt on a recurring schedule, as every recurring use case like a morning brief needed an external cron plus manual wiring. This adds a gaia schedule command group: register a prompt with a cron expression and the agent runs it on schedule in a fresh session, delivering output to a configurable sink (stdout, file, desktop notification, or Telegram), persisted in a hand-editable ~/.gaia/schedules.toml that survives restarts.

This is the core minimal scheduler meant to fit in one PR. The --prompt path is fully wired; --skill raises an actionable error pending the skill format (#888). Sinks fail loudly on delivery errors per the no-fallback rule.

Draft — not yet included (follow-ups): unit/integration tests, CLI docs (docs/reference/cli.mdx + docs/docs.json), and the optional OS-service installers (systemd/launchctl/schtasks).

Test plan

  • gaia schedule add --name hello --cron "* * * * *" --prompt "say hello" --sink stdout
  • gaia schedule list shows the schedule with a next-fire time
  • gaia schedule run hello fires once and prints the agent output
  • gaia schedule pause hello / resume hello toggles enabled in ~/.gaia/schedules.toml
  • gaia schedule remove hello cleanly deletes it from the store
  • gaia schedule daemon fires the job once per minute
  • Unit tests (store/sinks/cron) + daemon integration test — TODO

Closes #892.

GAIA had no way to run a skill or prompt on a recurring schedule, so every
recurring use case (morning brief, hourly watcher, weekly digest) needed an
external cron plus manual wiring. This adds a `gaia schedule` command group
backed by a hand-editable ~/.gaia/schedules.toml store and an APScheduler
daemon: register a prompt with a cron expression and the agent runs it on
schedule in a fresh session, delivering output to a configurable sink
(stdout, file, desktop notification, or Telegram).

The --prompt path is fully wired; --skill raises an actionable error pending
the skill format (amd#888). Sinks fail loudly on delivery errors per the
no-fallback rule. Tests, CLI docs, and the optional OS service installers are
follow-ups, not included here.
@github-actions github-actions Bot added dependencies Dependency updates cli CLI changes labels Jun 2, 2026
@kovtcharov

Copy link
Copy Markdown
Contributor

Heads-up: we're also landing a scheduler panel in the Agent UI, salvaged from #517 (NL intervals, REST API, run history in chat sessions). Paths are disjoint from this PR (src/gaia/ui/ vs src/gaia/schedule/), so no mechanical conflicts. Proposed split: this PR keeps the cron core + CLI/sinks, the UI layer lands separately, and we converge on a single store in a follow-up. What's your timeline on this draft?

@TravisHaa

TravisHaa commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Heads-up: we're also landing a scheduler panel in the Agent UI, salvaged from #517 (NL intervals, REST API, run history in chat sessions). Paths are disjoint from this PR (src/gaia/ui/ vs src/gaia/schedule/), so no mechanical conflicts. Proposed split: this PR keeps the cron core + CLI/sinks, the UI layer lands separately, and we converge on a single store in a follow-up. What's your timeline on this draft?

Sorry for the delay, it's finals week for me so it's been a bit busy. I'll have this PR done by next Friday at the latest. Also, I was wondering what the single store should be, so I can mold the structure of the scheduling core to it?

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

No rush — good luck with finals. Next Friday is fine.

On the single store: let's make SQLite the canonical runtime store and keep your TOML as the hand-editable declarative layer on top of it, rather than picking one and dropping the other. Here's the split that lets both surfaces converge cleanly:

  • Canonical persistence: the UI scheduler (feat(ui): scheduled recurring tasks in Agent UI #1566) persists schedules to the ChatDatabase (SQLite) and gives each schedule its own chat session for run history. That's the source of truth the daemon reads at runtime, so your daemon.py dispatch loop should ultimately load from it too.
  • Your TOML stays as a declarative/import-export format (it's a real CLI virtue — hand-editable, diffable, survives restarts). Think of ~/.gaia/schedules.toml as kubectl apply-style desired state that syncs into the SQLite store, not a competing store.
  • Shared Schedule model: align field names so one dataclass serves both. Proposed canonical fields: id/name, cron (canonical schedule expression — the UI parses its NL intervals down to cron so persistence is uniform), prompt, skill, sink/target, enabled, created_at, last_run, next_run, and an optional session_ref linking to the run-history session. Your current model (name/cron/skill/prompt/sink/enabled) is already most of the way there — adding the timestamps + session_ref is the gap.
  • Store as an interface: define a small ScheduleStore protocol (load/save/add/remove/get/set_enabled — exactly your current surface), with the SQLite-backed impl from feat(ui): scheduled recurring tasks in Agent UI #1566 as the default and your TOML impl as the file-backed one. That keeps your PR shippable now and makes the follow-up unification a swap, not a rewrite.

So for this PR: keep building the cron core + CLI/sinks against your ScheduleStore, just shape the Schedule dataclass to the fields above so we don't have to migrate it later. The SQLite convergence lands as the agreed follow-up once both this and #1566 are in.

One open question for you: do you want the daemon to own scheduling for both surfaces, or should the UI keep its own in-process scheduler short-term? Happy to sync on that before you finalize.

pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jun 11, 2026
## Why this matters

GAIA had no way to run anything on a schedule from the Agent UI — every
recurring use case ("every morning at 9, summarize my inbox") needed
external tooling. This adds a Schedule Manager to the UI: describe a
schedule in natural language ("every 30m", "daily at 9pm", "every monday
at 8am"), attach a prompt, and the agent runs it on time through the
local LLM, with each schedule's full run history living in its own chat
session. Salvaged from amd#517 and rebuilt on current main with fail-loudly
hardening (malformed configs raise instead of silently never firing; the
scheduler refuses to boot with lost tasks; no dry-run no-op path), a
concurrency cap, and the same tunnel security gate the autonomous agent
loop uses.

Scope notes: NL intervals only — cron syntax and heartbeat tiers stay
with the autonomy-engine plan, and the `gaia schedule` CLI (amd#1371)
remains a separate complementary surface (coordination comment posted
there; store unification is a follow-up for whichever lands second).

## Test plan

- [x] 54 scheduler unit tests (`tests/unit/test_scheduler.py`)
- [x] 18 REST API tests (`tests/unit/test_scheduler_api.py`)
- [x] 13 integration tests incl. restart persistence + full API
lifecycle (`tests/integration/test_scheduler_e2e.py`)
- [x] 6 new ChatDatabase persistence tests
- [x] Full unit suite: 5491 passed, 0 new failures (6 pre-existing on
main)
- [x] `tsc --noEmit` clean + frontend build
- [x] Manual golden path via Playwright: Clock button → panel → NL parse
preview → create → countdown → pause/delete with confirm
- [x] Boot smoke test: `/api/schedules` CRUD round-trip on a live server
- [ ] Live end-to-end run with Lemonade (create "every 1m" schedule,
verify response lands in the schedule's session)

---------

Co-authored-by: kovtcharov-amd <[email protected]>
Co-authored-by: Ovtcharov <[email protected]>
Co-authored-by: Tomasz Iniewicz <[email protected]>
@TravisHaa

Copy link
Copy Markdown
Contributor Author

I think it would intuitively make more sense if the daemon owned scheduling for both surfaces to reduce both scheduling race conditions/double-fires. But making the CLI daemon process the owner has its own trap, as the UI server is already a long-lived process, so if UI schedules only fire when a separate daemon is also up, users get silent no-ops. So I've kept build_scheduler(store) as the single shared engine (it's already a pure function over the ScheduleStore Protocol), and let whichever long-lived process exists host it - the UI server embeds it when running, gaia schedule daemon hosts it headless otherwise. A single-owner guard (lockfile now, or a DB advisory lock once SQLite is canonical) prevents double-fire if both happen to be up. I'd land that lock as part of the SQLite convergence, not this PR.

Prepare the schedule store to converge with the Agent UI's SQLite store
(amd#1566) and close the test/doc gaps the initial CLI PR deferred.

- Schedule gains last_run/next_run/session_ref so one dataclass serves
  both the hand-editable TOML layer and the future SQLite/run-history
  store; TOML serialization omits each field when unset.
- ScheduleStore becomes a runtime_checkable Protocol
  (load/save/add/remove/get/set_enabled/mark_run) and the TOML
  implementation is renamed TomlScheduleStore, so a database-backed
  store can drop in without changing the daemon or CLI.
- mark_run records last_run/next_run after a successful fire (daemon and
  `gaia schedule run`); a failed fire still logs loudly and leaves
  run-state untouched, keeping the daemon alive.
- build_scheduler now depends only on the Protocol surface (no concrete
  store.path access) so the UI server can embed the same engine on a
  background thread instead of requiring a separate daemon process.
- Add hermetic unit tests for the store, sinks, and daemon (LLM and
  network mocked), and document `gaia schedule` in docs/reference/cli.mdx.
@TravisHaa
TravisHaa marked this pull request as ready for review June 21, 2026 16:28
@github-actions github-actions Bot added documentation Documentation changes tests Test changes labels Jun 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🟡 store.py:132 — save() is unlocked; mark_run (called by the daemon after every job fire) and CLI writes like set_enabled/remove both do load→modify→save with no file lock. Last writer silently wins, so a gaia schedule pause morning-brief that races a daemon fire can lose the enabled=False update.

# save() with POSIX advisory locking (Linux/macOS)
import fcntl

def save(self, schedules: Dict[str, Schedule]) -> None:
    self.path.parent.mkdir(parents=True, exist_ok=True)
    self.path.touch()
    with open(self.path, "r+b") as f:
        fcntl.flock(f, fcntl.LOCK_EX)
        doc = {"schedules": {s.name: s.to_toml_dict() for s in schedules.values()}}
        f.seek(0)
        f.truncate()
        tomli_w.dump(doc, f)

fcntl is POSIX-only. If Windows support matters here, portalocker is the cross-platform drop-in (one extra dep). The alternative is to note in the docstring that concurrent daemon + CLI writes are unsafe and document the limitation.

@kovtcharov

kovtcharov commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Nice work, @TravisHaa — and it tracks the plan from the thread cleanly (canonical Schedule fields in place, so the SQLite convergence is a swap not a rewrite). The no-fallback discipline is solid and APScheduler-over-cron is the right Windows call. Two real things to sort before merge, both about the daemon: scheduled runs can collide on the single Lemonade slot, and the daemon doesn't notice store edits or missed fires. Everything else is nits. One bookkeeping note — the description still lists tests + CLI docs as TODO, but you've actually shipped both; worth updating so they're credited.

CI is all red from pre-existing main failures (a goal_store.py pylint error, a docs-validation issue, Lemonade infra), not your code — a rebase should clear it.

🔍 Technical details

🟡 Should-fix

  • Serialize daemon fires against Lemonade — daemon.py:47 BackgroundScheduler() uses a threadpool, so two schedules due the same minute run concurrent AgentSDK.send() calls into one Lemonade slot (CLAUDE.md's ctx-eviction hazard). This is separate from the cross-process single-owner lock you're deferring. Use max_workers=1 or a job lock.
  • Daemon reads the store once at startup (daemon.py:45, build_scheduler): add/pause/remove while it runs no-op until restart, and a fire due while it was down is silently skipped (no catch-up). Periodic re-read, or document both.
  • Validate sink args at add time (cli.py:2973): --sink telegram without --to, or an unknown sink, only error on first fire.

🟢 Nits

  • Say plainly the UI and CLI schedulers are separate engines for now — build_scheduler(store) is the right seam, but the UI doesn't embed it yet.
  • apscheduler/tomli-w go in the base install rather than a [schedule] extra (setup.py:113) — intended?
  • Telegram output isn't chunked to the 4096-char limit (sinks.py:114).
  • No test over the _handle_schedule dispatch (store/sink/daemon/runner coverage is otherwise strong).
  • The unlocked save() race (store.py:132) is fine to defer with the SQLite work, as you said.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Two newly-introduced issues:

1. Invalid cron crashes the daemon for all schedules, not just the broken one.
gaia schedule add --cron "not-valid" ... succeeds silently, but when the daemon starts, build_scheduler calls CronTrigger.from_crontab(schedule.cron) for every enabled schedule in a tight loop — one invalid entry raises and aborts the loop, so all other valid schedules never get armed. The fix is to validate the cron at add time (call CronTrigger.from_crontab(args.cron) before store.add) so bad expressions are rejected immediately with an actionable error.

2. Telegram bot token can leak into logs via requests exception messages.
When requests.post(url, ...) raises a RequestException (network failure, DNS timeout, etc.), the requests library includes the full URL — "/botTOKEN/sendMessage" — in the exception string. That {e} is embedded into the RuntimeError message, which then propagates to daemon._job's log.exception("schedule %r failed", ...), printing the full traceback (including the chained cause) to the log file. Fix: don't embed {e} directly; log a sanitized message that names the host without the token-bearing path.

🔍 Technical details

Cron validation — src/gaia/cli.py:3015 (_handle_schedule, add branch)

Add early validation before store.add:

from apscheduler.triggers.cron import CronTrigger

if action == "add":
    try:
        CronTrigger.from_crontab(args.cron)
    except ValueError as e:
        print(f"Invalid cron expression {args.cron!r}: {e}", file=sys.stderr)
        return
    ...
    store.add(schedule)

APScheduler raises ValueError for bad cron strings. This way a bad --cron is rejected immediately instead of being silently stored and blowing up the daemon later (and taking all other schedules down with it).


Token leak — src/gaia/schedule/sinks.py:114-119

# current (leaks token via {e})
except requests.RequestException as e:
    raise RuntimeError(
        f"telegram sink could not reach {TELEGRAM_API}: {e}. ..."
    ) from e

requests' ConnectionError typically formats as:

HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botSECRET_TOKEN/sendMessage

log.exception in daemon._job emits the full exception chain, so SECRET_TOKEN ends up in logs.

Fix — omit {e} from the message (the from e chain still preserves the traceback for debugging, but the token doesn't land in the log line):

except requests.RequestException as e:
    raise RuntimeError(
        f"telegram sink could not reach {TELEGRAM_API} (sendMessage). "
        f"Check network connectivity."
    ) from e

pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 6, 2026
## Why this matters

The v2 sidecar-first architecture (amd#1913) is signed-in design, but
nothing yet tells an implementer where to start, what's reusable vs.
net-new, or which unsigned decisions block which work — so the build
can't be parallelized or even safely begun. This adds the implementation
decomposition: a code-verified delta table for every v2 building block,
19 sequenced issue proposals (with acceptance criteria, dependencies,
S/M/L sizes — proposals only, none filed), a specced first vertical
slice (headless daemon + supervised email sidecar + `/query` streamed to
the CLI), and the three sign-off decisions (§0.4 confirmation model,
§0.9 custody home, §0.24 containment 🔒) as explicit questions.

It also pins verified design-vs-merged deviations so implementers don't
trip on them: `gaia api` still mounts email in-process (the pattern
amd#1910 removed from the UI only), the only scheduler on main is
UI-internal (PR amd#1566 — `gaia schedule`/PR amd#1371 is unmerged), and
contract 2.1 has no `/query`, no auth (amd#1706), and no `/shutdown`.

## Test plan

- [ ] Docs-only — no code paths touched
- [ ] Spot-check the delta table's file/LoC claims against `main` @
`080e7259` (all were verified while writing)
- [ ] Confirm the issue proposals don't duplicate existing open issues
(checked: amd#1706, amd#1653, amd#1896, amd#1717 are linked, not duplicated)
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 6, 2026
The morning triage card existed only on demand — a user had to ask for a
pre-scan every time. Now the email sidecar can generate it on a daily
schedule with no prompt: each run reuses the agent's own
`pre_scan_inbox` path (same `email_pre_scan` envelope, nothing
re-classified), persists it with a `generated_at` stamp, and any surface
pulls the latest run from the new additive `GET /v1/email/briefing`. Off
by default — enabled explicitly with `GAIA_EMAIL_BRIEFING_ENABLED=true`
(fire time `GAIA_EMAIL_BRIEFING_TIME`, default 08:00); an invalid value
fails sidecar startup loudly instead of guessing a schedule.

The `gaia schedule` dispatcher (amd#1371) is approved but not merged, so
the in-process timer is deliberately minimal and email-scoped:
`run_briefing_job()` is the one-shot seam the amd#1371 dispatcher /
autonomy engine (amd#555) will invoke directly when they land, at which
point the timer can be deleted without touching the job or delivery.
`SCHEMA_VERSION` stays 2.1 (additive, like amd#1887).

Closes amd#1608 (capability 16 in amd#1691).

## Test plan

- [x] AC: scheduled job invokes `pre_scan_inbox` and produces the
`email_pre_scan` envelope —
`test_briefing_job_produces_email_pre_scan_envelope`
- [x] AC: disabled schedule produces no briefing (no task, no job run,
nothing persisted) — `test_disabled_schedule_produces_no_briefing`
- [x] Config is explicit + fail-loud: off when unset;
`maybe`/`8am`/`0`/`101` each raise at startup —
`test_config_invalid_values_fail_loud`
- [x] `GET /v1/email/briefing`: 404 before the first run, conforms to
`EmailBriefingResponse` after one
(`tests/test_email_openapi_conformance.py::test_briefing_conforms_to_spec`)
- [x] `python -m pytest hub/agents/python/email/tests/
tests/test_email_openapi_conformance.py tests/unit/agents/email/
tests/unit/email/` — 762 passed
- [x] `python -m gaia_agent_email.export_openapi --check` (artifact
regenerated) · `python util/lint.py --all` clean
- [x] Sidecar golden path: booted `packaging/server.py`'s app with the
lifespan — health OK, briefing 404 with actionable detail, invalid env
aborts startup with `BriefingConfigError`
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 7, 2026
…les) (amd#1919)

"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 amd#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 amd#1371 (`gaia schedule` cron dispatch) is approved but unmerged,
the scheduler is deliberately minimal and email-scoped, with a
documented seam: once amd#1371 lands (autonomy epic amd#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 amd#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.

---------

Co-authored-by: Tomasz Iniewicz <[email protected]>
Co-authored-by: Tomasz Iniewicz <[email protected]>
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Jul 7, 2026
Merged via the queue into amd:main with commit 240c7df Jul 7, 2026
51 of 54 checks passed
kovtcharov-amd pushed a commit that referenced this pull request Jul 8, 2026
Two failures introduced on main by the #1748 (embedding cache) × #1761
(per-instance embedder) interaction and #1371 (schedule), which this branch
inherits via the merge:

1. MemoryMixin._embed_text/_get_embedder referenced self._embedding_model
   directly, which is only set in init_memory — so the embedding-cache unit
   tests (bare mixin) failed with AttributeError, and the cache key used the
   module default while the embed call used the instance model (mismatched for
   the NPU FLM embedder). Resolve the active model/dim via helpers that fall
   back to the module default, and key the cache by the same resolved model.

2. schedule/daemon.py reimported datetime inside next_fire_time (W0404) —
   already imported module-level. Removed.
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

cli CLI changes dependencies Dependency updates documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimal scheduler: gaia schedule CLI + cron-based skill dispatch

3 participants