Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(workflows): no seed workflow runs on a schedule by default
rubenluetke10-beep63a5d53dfa8e
diff --git a/docs/product/extend-and-automate/workflows-and-commands.md b/docs/product/extend-and-automate/workflows-and-commands.mdindex 152feb0247..82c2253a01 100644--- a/docs/product/extend-and-automate/workflows-and-commands.md+++ b/docs/product/extend-and-automate/workflows-and-commands.md@@ -115,7 +115,11 @@ dialog from registry metadata.5. **Open Recent runs.** Expand a run to see the saved output or error for eachstep. A failure ends the sequence; later steps do not run.-6. **Control future runs.** Enable a cron workflow to let the local scheduler+6. **Control future runs.** Nothing Jarvis ships runs on a schedule by+ itself: the scheduled examples arrive switched off, and a schedule starts+ only once you enable it. Earlier versions shipped a **Morning Briefing**+ that was switched on; an update removes it unless you changed it. Enable a+ cron workflow to let the local schedulerstart it while Jarvis is running. Schedules currently use the Jarvis host'slocal time, and the next-run value can take up to one minute to appear.Disable it to clear the next automatic run. **Run now** still works for adiff --git a/jarvis/workflows/seed.py b/jarvis/workflows/seed.pyindex e2b564f6d1..4471c1a0dc 100644--- a/jarvis/workflows/seed.py+++ b/jarvis/workflows/seed.py@@ -1,20 +1,23 @@"""Seed workflows — planted into the DB on first startup.Philosophy: **small, immediately functional, demoable.** We want the-user, after the first launch, to open the WorkflowsView and see 3+user, after the first launch, to open the WorkflowsView and seemeaningful examples, be able to click "Run", and get a result right away.-- *Morning Briefing* (cron 30 7 * * *, **enabled**) — brain_prompt → speak- chain. An isolated agent turn over the read-only tools that are connected- (calendar, mail, memory, web/weather) produces a spoken day briefing. It- needs no credentials to run at all, which is exactly why it is the only- cron seed that ships switched on.+**Nothing here runs by itself.** Every seed is either manual or a cron+example that ships switched off; a schedule is the user's own decision+(2026-09-30 — the Morning Briefing, the one cron seed that shipped on, was+retired, see ``_retire_morning_briefing``).+- *Code Review* (manual) — git diff capture followed by a brain review.- *URL Summary* (manual, input field ``url``) — brain_prompt with thetemplate variable {{input.url}}. Demos input binding.+- *Email Digest* / *Git Standup via Telegram* (cron, **off**) — need a+ configured Telegram bot before anyone would switch them on."""from __future__ import annotations+import hashlibimport loggingimport timefrom uuid import UUID@@ -44,102 +47,24 @@ _WF_EMAIL_DIGEST = UUID("4a0f9e01-5c11-4c57-9c1d-10aabb000004")_WF_GIT_STANDUP = UUID("4a0f9e01-5c11-4c57-9c1d-10aabb000005")-def _morning_briefing() -> WorkflowDef:- """The one scheduled workflow that ships ON.-- Every other cron seed here needs something a fresh install does not have- (a configured Telegram bot, an authenticated ``gws`` CLI), so shipping- them enabled would only produce failing runs. This one needs nothing but- a brain and a voice — both of which the app already requires — so it is- the honest default for "Jarvis does things without being asked"- (audit AU-02: with every cron seed disabled, the scheduler polled an- empty list forever and a fresh install did nothing on a schedule).-- Language is NOT pinned here: the prompt asks for the configured output- language and the speak step passes ``auto``, so the one resolver decides- (AGENTS.md §1). The seed used to hardcode German for everyone.-- Version 2 (BUG-212): the first seed asked for "a short, friendly morning- announcement" and got exactly that — a greeting and a motivational- phrase, no facts. The step now runs as an isolated agent turn with a- read-only tool allowlist (calendar, mail, memory, web + weather) and a- prompt that grounds every sentence in tool output. Tools that are not- connected on an install are simply skipped, so a fresh box still gets a- briefing — an honest one about what is and is not connected.- """- now_ns = time.time_ns()- return WorkflowDef(- id=_WF_MORNING_BRIEFING,- name="Morning Briefing",- description=(- "Daily 07:30 spoken briefing: today's calendar, mail that matters, "- "what you noted for today, headlines and weather — from the tools "- "that are connected, nothing invented."- ),- trigger=CronTrigger(expression="30 7 * * *"),- steps=(- BrainPromptStep(- label="Compile the briefing",- prompt=_MORNING_BRIEFING_PROMPT,- max_output_chars=1_600,- tools=MORNING_BRIEFING_TOOLS,- model_tier="auto",- ),- SpeakStep(- label="Speak the briefing",- text="{{prev.output}}",- priority="normal",- language="auto",- ),- ),- enabled=True,- created_at_ns=now_ns,- created_by="seed",- tags=("demo", "brain", "speak"),- )---#: Read-side grants for the briefing. Every name is a live tool name or a-#: plugin prefix (``grant_matches``); a name that is not connected is skipped-#: by ``BrainManager._select_task_tools``. No tool here can send, write or-#: delete anything, so an unattended 07:30 run never waits on an approval.-MORNING_BRIEFING_TOOLS: tuple[str, ...] = (- "google_calendar", "gmail", "wiki-recall", "search_web",-)+#: The Morning Briefing no longer ships (2026-09-30). It was the one seed that+#: ran by itself — a full agent turn every day at 07:30 on every install — and+#: routines are the user's own to make. An existing install still carries the+#: seeded row; ``_retire_morning_briefing`` removes it when it is still exactly+#: what shipped. These are the only traces kept to recognise that row.+_MORNING_BRIEFING_NAME = "Morning Briefing"+_MORNING_BRIEFING_CRON = "30 7 * * *"-#: Marker of the shipped v1 prompt — how the migration recognises the old-#: seed row (and ONLY that row: a user's own edit never carries it).+#: Marker of the shipped v1 prompt (a greeting, no tools). A user's own edit+#: never carries it._LEGACY_MORNING_BRIEFING_MARKER = "Compose a short, friendly morning announcement"-_MORNING_BRIEFING_PROMPT = """\-You are Jarvis, compiling the user's daily briefing that will be SPOKEN aloud.-The current date and time are in your context: open with the greeting that fits-the actual time of day (morning, afternoon or evening) and name the weekday.--Gather the facts with the tools you actually have in this turn. Every sentence-below must come from tool output. When a tool for an area is not available,-skip that area in one short clause (e.g. "the calendar is not connected yet")-and move on. Never invent an event, a mail, a headline or a city.--1. Calendar (a calendar tool): today's events. No events: the day is free.- One: name it with its time. Several: the count plus the next one with its- time. If the next event starts within the hour, say so.-2. Mail (a mail tool): unread mail. Name at most three that matter, each as- sender and subject in one clause. Never read a mail body out.-3. Memory (wiki-recall): anything the user noted as due or planned for today.-4. World (search_web): the two or three headlines that matter most for the- user's interests, each with its source named. Weather ONLY if a tool result- in this turn explicitly names the user's home city: then one clause from- search_web ("weather <city> today": current conditions, high and low).- Never choose a city yourself, never take one from a headline or a mail; if- no home city came back from a tool, say nothing about the weather at all.--Then write the briefing: 5 to 8 short sentences, most important first, plain-prose for speech — no bullets, no headings, no emojis, no markdown, no URLs.-Close with one sentence on what matters most today. Do not describe your-process and do not say that you searched. Write in the configured output-language.-"""+#: SHA-256 of each shipped v2 prompt (BUG-212: the tool-grounded briefing, and+#: its revision that stopped guessing a weather city).+_SHIPPED_MORNING_BRIEFING_PROMPTS: frozenset[str] = frozenset({+ "780f3e1405af25fe00b7683b68ae65c773b39624cc4c2b01648edb4e86b44a54",+ "c000ce3b8f2a2f6febd3efcfb1fb78f2deb5c632edd0bb76acb20839ece54fdf",+})def _code_review() -> WorkflowDef:@@ -323,7 +248,6 @@ def _git_standup_telegram() -> WorkflowDef:SEED_WORKFLOWS: tuple[WorkflowDef, ...] = (- _morning_briefing(),_code_review(),_url_summary(),_email_digest_telegram(),@@ -343,12 +267,7 @@ async def ensure_seed_workflows(store: WorkflowStore) -> int:for wf in SEED_WORKFLOWS:existing = await store.get_workflow(str(wf.id))if existing is not None:- legacy = (- (wf.id == _WF_CODE_REVIEW and _is_legacy_code_review(existing))- or (wf.id == _WF_MORNING_BRIEFING- and _is_legacy_morning_briefing(existing))- )- if legacy:+ if wf.id == _WF_CODE_REVIEW and _is_legacy_code_review(existing):await store.upsert_workflow(wf)# The user's on/off choice outlives a seed upgrade: an upsert# writes the seed's ``enabled``, so restore the row's own.@@ -361,21 +280,55 @@ async def ensure_seed_workflows(store: WorkflowStore) -> int:log.info("Seed workflows written: %d new", added)if migrated:log.info("Legacy unavailable seed workflows migrated: %d", migrated)+ await _retire_morning_briefing(store)return added-def _is_legacy_morning_briefing(row: dict[str, object]) -> bool:- """Identify only the shipped v1 greeting seed, never a user's own edit."""+async def _retire_morning_briefing(store: WorkflowStore) -> bool:+ """Remove the seeded Morning Briefing while it is still exactly what shipped.++ Removed rather than switched off: it no longer ships, a seed cannot be+ deleted from the desktop, and a switched-off row would be re-disabled on+ every boot the moment its owner turned it back on. A row the user edited+ (name, schedule, steps or prompt) is theirs and stays untouched.+ """+ wid = str(_WF_MORNING_BRIEFING)+ row = await store.get_workflow(wid)+ if row is None or not _is_shipped_morning_briefing(row):+ return False+ removed = await store.delete_workflow(wid)+ if removed:+ log.info(+ "Retired the shipped Morning Briefing seed (unedited, was %s)",+ "on" if row.get("enabled") else "off",+ )+ return removed+++def _is_shipped_morning_briefing(row: dict[str, object]) -> bool:+ """True only for the seeded briefing as it shipped, never a user's edit."""if row.get("created_by") != "seed":return Falsetry:definition = WorkflowDef.model_validate_json(str(row.get("def_json") or ""))except Exception: # noqa: BLE001 - malformed legacy data stays user-ownedreturn False- return any(- isinstance(step, BrainPromptStep)- and _LEGACY_MORNING_BRIEFING_MARKER in step.prompt- for step in definition.steps+ trigger = definition.trigger+ if (+ definition.name != _MORNING_BRIEFING_NAME+ or not isinstance(trigger, CronTrigger)+ or trigger.expression != _MORNING_BRIEFING_CRON+ or len(definition.steps) != 2+ ):+ return False+ prompt_step, speak_step = definition.steps+ if not isinstance(prompt_step, BrainPromptStep) or not isinstance(speak_step, SpeakStep):+ return False+ prompt = prompt_step.prompt+ return (+ _LEGACY_MORNING_BRIEFING_MARKER in prompt+ or hashlib.sha256(prompt.encode("utf-8")).hexdigest()+ in _SHIPPED_MORNING_BRIEFING_PROMPTS)diff --git a/tests/unit/workflows/test_seed_scheduled.py b/tests/unit/workflows/test_seed_scheduled.pyindex 388bd7f889..c7932a7bdb 100644--- a/tests/unit/workflows/test_seed_scheduled.py+++ b/tests/unit/workflows/test_seed_scheduled.py@@ -1,90 +1,60 @@-"""A fresh install must actually do something on a schedule.+"""Nothing the app ships runs on a schedule by itself.-Audit AU-02: all three cron seeds shipped ``enabled=False`` and the only-enabled ones were ManualTrigger, so the WorkflowScheduler polled an empty list-every 60 seconds forever. Jarvis had a scheduler and nothing to schedule.--Exactly one cron seed is now on — the Morning Briefing, because it is the only-one that needs nothing a fresh install does not have. The other two need a-configured Telegram bot (and an authenticated ``gws`` CLI), so enabling them-would just manufacture failing runs on somebody else's machine.+The Morning Briefing used to be the one cron seed that shipped switched on: a+full agent turn at 07:30 every day on every install, spoken aloud. The+maintainer retired it (2026-09-30) — routines are the user's own to make. New+installs no longer get it, and an existing install's seeded row is removed+while it is still exactly what shipped; a row the user edited stays theirs."""from __future__ import annotations+import hashlibfrom pathlib import Pathimport pytest+from jarvis.workflows import seed as seed_modulefrom jarvis.workflows.schema import (BrainPromptStep,CronTrigger,ManualTrigger,SpeakStep,+ TelegramSendStep,WorkflowDef,)-from jarvis.workflows.seed import (- MORNING_BRIEFING_TOOLS,- SEED_WORKFLOWS,- ensure_seed_workflows,-)+from jarvis.workflows.seed import SEED_WORKFLOWS, ensure_seed_workflowsfrom jarvis.workflows.store import WorkflowStore-_CREDENTIAL_FREE_STEPS = (BrainPromptStep, SpeakStep)+_BRIEFING_ID = seed_module._WF_MORNING_BRIEFING++#: Stand-in for a shipped v2 prompt; the fixture registers its hash as shipped.+_SHIPPED_V2_PROMPT = "You are Jarvis, compiling the user's daily briefing.\n"-def _seed(name: str):+def _seed(name: str) -> WorkflowDef:return next(wf for wf in SEED_WORKFLOWS if wf.name == name)-def test_a_fresh_install_has_something_on_the_clock() -> None:+def test_no_seed_runs_on_a_schedule_by_default() -> None:scheduled = [- wf+ wf.namefor wf in SEED_WORKFLOWSif isinstance(wf.trigger, CronTrigger) and wf.enabled]- assert scheduled, "no enabled cron seed — the scheduler polls an empty list"-+ assert scheduled == [], f"shipped switched on: {scheduled}"-def test_the_morning_briefing_is_the_one_that_ships_on() -> None:- briefing = _seed("Morning Briefing")- assert briefing.enabled- assert isinstance(briefing.trigger, CronTrigger)- others = [- wf.name- for wf in SEED_WORKFLOWS- if isinstance(wf.trigger, CronTrigger) and wf.enabled- ]- assert others == ["Morning Briefing"]---def test_the_morning_briefing_needs_no_credentials() -> None:- """Only brain + speak. Nothing that reaches an external account, a shell,- or a tool — so nothing that can stall on an approval nobody is there to- give during an unattended 07:30 run."""- briefing = _seed("Morning Briefing")- assert briefing.steps- for step in briefing.steps:- assert isinstance(step, _CREDENTIAL_FREE_STEPS), (- f"{step.kind} step needs something a fresh install may not have"- )---def test_the_morning_briefing_pins_no_language() -> None:- """The one resolver decides the output language, not the seed- (AGENTS.md §1). This seed used to hardcode German for every downloader."""- briefing = _seed("Morning Briefing")- speak = next(s for s in briefing.steps if isinstance(s, SpeakStep))- assert speak.language == "auto"- prompts = " ".join(- s.prompt for s in briefing.steps if isinstance(s, BrainPromptStep)- )- assert "in German" not in prompts+def test_the_morning_briefing_is_no_longer_seeded() -> None:+ assert all(wf.id != _BRIEFING_ID for wf in SEED_WORKFLOWS)+ assert all(wf.name != "Morning Briefing" for wf in SEED_WORKFLOWS)def test_the_telegram_seeds_stay_off_until_telegram_is_configured() -> None:for name in ("Email Digest via Telegram", "Git Standup via Telegram"):- assert not _seed(name).enabled, f"{name} needs credentials to work"+ wf = _seed(name)+ assert isinstance(wf.trigger, CronTrigger)+ assert not wf.enabled, f"{name} needs credentials to work"+ assert any(isinstance(step, TelegramSendStep) for step in wf.steps)def test_the_manual_seeds_are_untouched() -> None:@@ -95,95 +65,104 @@ def test_the_manual_seeds_are_untouched() -> None:# -----------------------------------------------------------------------# BUG-212 — version 2: a briefing, not a greeting+# Existing installs: the seeded Morning Briefing row is retired# -----------------------------------------------------------------------#: Every grant is a read-side tool: nothing here can send, write or delete,-#: so an unattended run never waits on an approval nobody is there to give.-_READ_ONLY_GRANTS = frozenset({"google_calendar", "gmail", "wiki-recall", "search_web"})---def test_the_briefing_step_is_an_isolated_turn_with_read_only_tools() -> None:- briefing = _seed("Morning Briefing")- brain = next(s for s in briefing.steps if isinstance(s, BrainPromptStep))- assert brain.tools == MORNING_BRIEFING_TOOLS- assert set(brain.tools) <= _READ_ONLY_GRANTS- assert brain.model_tier in ("auto", "fast", "deep")---def test_the_briefing_prompt_grounds_itself_and_greets_by_time_of_day() -> None:- briefing = _seed("Morning Briefing")- prompt = next(s.prompt for s in briefing.steps if isinstance(s, BrainPromptStep))- assert "tool output" in prompt- assert "Never invent" in prompt- assert "time of day" in prompt- assert "not connected" in prompt, "a disconnected area is skipped, not faked"- # Live dev run 2026-09-02 11:43: with "if the user's city is known from- # memory" the model reported San Francisco weather to a user in Germany.- assert "Never choose a city yourself" in prompt- assert "Compose a short, friendly morning announcement" not in prompt-@pytest.fixture-async def store(tmp_path: Path) -> WorkflowStore:+async def store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> WorkflowStore:+ monkeypatch.setattr(+ seed_module,+ "_SHIPPED_MORNING_BRIEFING_PROMPTS",+ frozenset({hashlib.sha256(_SHIPPED_V2_PROMPT.encode("utf-8")).hexdigest()}),+ )s = WorkflowStore(tmp_path / "wf.sqlite")await s.init()yield sawait s.close()-def _v1_morning_briefing(*, enabled: bool) -> WorkflowDef:- """The shipped v1 row, the shape an installed box carries in its DB."""- v2 = _seed("Morning Briefing")- return v2.model_copy(update={- "enabled": enabled,- "steps": (- BrainPromptStep(- label="Generate daily summary",- prompt=(- "You are Jarvis. It's currently morning. Compose a short, "- "friendly morning announcement (max 3 sentences) in the "- "configured output language."- ),- max_output_chars=500,- ),- SpeakStep(label="Play announcement", text="{{prev.output}}", language="auto"),+def _briefing_row(+ *,+ enabled: bool = True,+ prompt: str = _SHIPPED_V2_PROMPT,+ cron: str = "30 7 * * *",+ name: str = "Morning Briefing",+ created_by: str = "seed",+) -> WorkflowDef:+ """The row an installed box carries, shaped like the seed that shipped."""+ return WorkflowDef(+ id=_BRIEFING_ID,+ name=name,+ description="Daily 07:30 spoken briefing.",+ trigger=CronTrigger(expression=cron),+ steps=(+ BrainPromptStep(label="Compile the briefing", prompt=prompt),+ SpeakStep(label="Speak the briefing", text="{{prev.output}}", language="auto"),),- })+ enabled=enabled,+ created_by=created_by,+ )-async def test_the_shipped_v1_row_is_migrated_and_keeps_its_switch(- store: WorkflowStore,-) -> None:- """An installed box has the greeting seed in its DB; it must become the- briefing without flipping the user's on/off choice."""- await store.upsert_workflow(_v1_morning_briefing(enabled=False))+async def test_the_shipped_briefing_row_is_removed(store: WorkflowStore) -> None:+ await store.upsert_workflow(_briefing_row(enabled=True))added = await ensure_seed_workflows(store)- assert added == len(SEED_WORKFLOWS) - 1- row = await store.get_workflow(str(_seed("Morning Briefing").id))- assert row is not None- assert row["enabled"] == 0, "the user had it off — still off"- definition = WorkflowDef.model_validate_json(row["def_json"])- brain = next(s for s in definition.steps if isinstance(s, BrainPromptStep))- assert brain.tools == MORNING_BRIEFING_TOOLS+ assert added == len(SEED_WORKFLOWS)+ assert await store.get_workflow(str(_BRIEFING_ID)) is None+++async def test_a_switched_off_shipped_row_is_removed_too(store: WorkflowStore) -> None:+ """It no longer ships and a seed cannot be deleted from the desktop."""+ await store.upsert_workflow(_briefing_row(enabled=False))++ await ensure_seed_workflows(store)+ assert await store.get_workflow(str(_BRIEFING_ID)) is None+++async def test_the_shipped_v1_greeting_row_is_removed(store: WorkflowStore) -> None:+ v1_prompt = (+ "You are Jarvis. It's currently morning. Compose a short, friendly "+ "morning announcement (max 3 sentences) in the configured output language."+ )+ await store.upsert_workflow(_briefing_row(prompt=v1_prompt))++ await ensure_seed_workflows(store)-async def test_a_users_own_edit_of_the_briefing_is_left_alone(- store: WorkflowStore,+ assert await store.get_workflow(str(_BRIEFING_ID)) is None+++ "edit",+ [+ {"prompt": "Read me my own notes file and nothing else."},+ {"cron": "0 6 * * 1-5"},+ {"name": "My mornings"},+ {"created_by": "user"},+ ],+ ids=["own-prompt", "own-schedule", "renamed", "user-created"],+)+async def test_a_briefing_the_user_made_their_own_stays(+ store: WorkflowStore, edit: dict[str, str]) -> None:- edited = _seed("Morning Briefing").model_copy(update={- "steps": (- BrainPromptStep(prompt="Read me my own notes file and nothing else."),- SpeakStep(text="{{prev.output}}", language="auto"),- ),- })- await store.upsert_workflow(edited)+ await store.upsert_workflow(_briefing_row(**edit))await ensure_seed_workflows(store)- row = await store.get_workflow(str(edited.id))+ row = await store.get_workflow(str(_BRIEFING_ID))assert row is not None- definition = WorkflowDef.model_validate_json(row["def_json"])- assert definition.steps[0].prompt == "Read me my own notes file and nothing else."+ assert row["enabled"] == 1, "the user's switch is not touched either"+++async def test_retirement_is_idempotent(store: WorkflowStore) -> None:+ await store.upsert_workflow(_briefing_row())++ await ensure_seed_workflows(store)+ added_again = await ensure_seed_workflows(store)++ assert added_again == 0+ assert await store.get_workflow(str(_BRIEFING_ID)) is None+ assert len(await store.list_workflows()) == len(SEED_WORKFLOWS)