feat(cron): guest jobs start on Sonnet; the local ones move to it once #23

Open
gabrielvidal wants to merge 1 commits from guest-jobs-sonnet into main
pull from: guest-jobs-sonnet
Owner

Summary

Guests' scheduled jobs now start on Sonnet. Until now they used the EVOX2's local model, Inkling 2 Mini, which kept running the same command until someone stopped the run (Arthur's « Veille pharma santé », 1fec9543). The local model is still a choice, with its Sonnet fallback. Every guest job still on it is moved to Sonnet once, at the first start after deploy. Companion PR: homelab mail-secretary-sonnet, which moves the mail secretary cron off Inkling for the same reason.

Key changes

  • backend/cron/guests.py:
    • DEFAULT_MODEL = "sonnet".
    • New move_local_jobs_to_sonnet(deps), called from start(). It moves every guest job on qwen (or with no model, the old default) to sonnet, and switches a saved qwen "new jobs start on" policy to sonnet. It runs once: it then writes guest-jobs-on-sonnet.done next to the cron store, listing the ids it moved.
  • backend/users/store.py, schemas/users.py, schemas/cron.py: cronLimits.defaultModel defaults to sonnet. An unknown value now falls back to sonnet.
  • Frontend:
    • Sonnet is listed first, and is the value used when the model is missing or unknown, in: the guest job editor (JobEditor), their list chip (MyJobs), Guest defaults, the owner's guest-job list (GuestJobs) and the owner's form (CronJobs).
    • The mock gains a read-only /api/me/cron.
  • cli/ai_agent.py cron --model help and cli/skills/scheduled-jobs/SKILL.md: Sonnet is the default.
  • frontend/openapi.json and src/generated/model/guestCronLimitsOut.ts are re-dumped. Only the default changes.

Key decisions

  • Sonnet, not Haiku. The first ask was Haiku, but Gabriel picked Sonnet in the form (mail-agents-on-haiku_g9606q) for every job here.
  • Existing jobs are moved, not only new ones. He chose "Move existing to sonnet and make sonnet the new default". Today that means Cel's « Récap campagne Meta » and Arthur's « Veille pharma santé » (paused). Their runs now count toward each guest's budget.
  • A one-shot move with a marker file, not a rule in the store's load path. A guest or the owner can still pick the local model afterwards, and it stays picked.
  • The qwen key and the Inkling choice stay. The EVOX2 fallback for a local job stays Sonnet, as decided in the form.
  • No loop guard (stopping a run that repeats one command). That is a follow-up, per the form.

Changelog

  • Changed: Guests' scheduled jobs start on Sonnet by default; Inkling 2 Mini (local, free) stays a choice.
  • Changed: Guest scheduled jobs that were on Inkling 2 Mini are moved to Sonnet once, after Inkling runs got stuck repeating a command.

Test notes

  • Backend, each module run in a bwrap sandbox with a throwaway /data, all passing:
    • test_guest_cron.py: 25 passed, including the new test_a_new_job_runs_on_sonnet_with_no_fallback and test_the_local_jobs_move_to_sonnet_once (moves qwen and model-less jobs and the saved policy; never runs twice).
    • test_guests.py, test_guest_computers.py, test_guest_cli.py, test_authz*.py, test_cron_lean.py, test_autoarchive.py, test_batch1_platform.py, test_plugin_catalog.py, test_usage_budget.py, test_worker_routing.py.
  • CLI cli/test_ai_agent.py: 55 passed.
  • Frontend: tsc --noEmit is clean, and vitest on business/{jobs,users,settings} gives 114 passed.
  • Screenshots below are from the mock build on the EVOX2: the guest job editor (Dom, French) and Settings → Users → Every guest → Scheduled jobs.
  • Deploy from the Homelab after review (ai-agent-deploy), not from the EVOX2. After the deploy, the hub log shows guest jobs moved from the local model to Sonnet: …, and Settings → Cron → Guests shows both jobs on Sonnet.

🤖 Generated with Claude Code

Screenshots

guest-job-editor.png
guest-defaults-cron.png

## Summary Guests' scheduled jobs now start on **Sonnet**. Until now they used the EVOX2's local model, Inkling 2 Mini, which kept running the same command until someone stopped the run (Arthur's « Veille pharma santé », `1fec9543`). The local model is still a choice, with its Sonnet fallback. Every guest job still on it is moved to Sonnet once, at the first start after deploy. Companion PR: homelab `mail-secretary-sonnet`, which moves the mail secretary cron off Inkling for the same reason. ## Key changes - `backend/cron/guests.py`: - `DEFAULT_MODEL = "sonnet"`. - New `move_local_jobs_to_sonnet(deps)`, called from `start()`. It moves every guest job on `qwen` (or with no `model`, the old default) to `sonnet`, and switches a saved `qwen` "new jobs start on" policy to `sonnet`. It runs once: it then writes `guest-jobs-on-sonnet.done` next to the cron store, listing the ids it moved. - `backend/users/store.py`, `schemas/users.py`, `schemas/cron.py`: `cronLimits.defaultModel` defaults to `sonnet`. An unknown value now falls back to `sonnet`. - Frontend: - Sonnet is listed first, and is the value used when the model is missing or unknown, in: the guest job editor (`JobEditor`), their list chip (`MyJobs`), Guest defaults, the owner's guest-job list (`GuestJobs`) and the owner's form (`CronJobs`). - The mock gains a read-only `/api/me/cron`. - `cli/ai_agent.py` `cron --model` help and `cli/skills/scheduled-jobs/SKILL.md`: Sonnet is the default. - `frontend/openapi.json` and `src/generated/model/guestCronLimitsOut.ts` are re-dumped. Only the default changes. ## Key decisions - **Sonnet, not Haiku.** The first ask was Haiku, but Gabriel picked Sonnet in the form (`mail-agents-on-haiku_g9606q`) for every job here. - **Existing jobs are moved, not only new ones.** He chose "Move existing to sonnet and make sonnet the new default". Today that means Cel's « Récap campagne Meta » and Arthur's « Veille pharma santé » (paused). Their runs now count toward each guest's budget. - **A one-shot move with a marker file, not a rule in the store's load path.** A guest or the owner can still pick the local model afterwards, and it stays picked. - The `qwen` key and the Inkling choice stay. The EVOX2 fallback for a local job stays Sonnet, as decided in the form. - No loop guard (stopping a run that repeats one command). That is a follow-up, per the form. ## Changelog - Changed: Guests' scheduled jobs start on Sonnet by default; Inkling 2 Mini (local, free) stays a choice. - Changed: Guest scheduled jobs that were on Inkling 2 Mini are moved to Sonnet once, after Inkling runs got stuck repeating a command. ## Test notes - Backend, each module run in a bwrap sandbox with a throwaway `/data`, all passing: - `test_guest_cron.py`: 25 passed, including the new `test_a_new_job_runs_on_sonnet_with_no_fallback` and `test_the_local_jobs_move_to_sonnet_once` (moves `qwen` and model-less jobs and the saved policy; never runs twice). - `test_guests.py`, `test_guest_computers.py`, `test_guest_cli.py`, `test_authz*.py`, `test_cron_lean.py`, `test_autoarchive.py`, `test_batch1_platform.py`, `test_plugin_catalog.py`, `test_usage_budget.py`, `test_worker_routing.py`. - CLI `cli/test_ai_agent.py`: 55 passed. - Frontend: `tsc --noEmit` is clean, and vitest on `business/{jobs,users,settings}` gives 114 passed. - Screenshots below are from the mock build on the EVOX2: the guest job editor (Dom, French) and Settings → Users → Every guest → Scheduled jobs. - **Deploy from the Homelab** after review (`ai-agent-deploy`), not from the EVOX2. After the deploy, the hub log shows `guest jobs moved from the local model to Sonnet: …`, and Settings → Cron → Guests shows both jobs on Sonnet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Screenshots ![guest-job-editor.png](https://git.gabvdl.xyz/attachments/9d6d0099-4858-4283-a63a-6ba5c080fdbe) ![guest-defaults-cron.png](https://git.gabvdl.xyz/attachments/192ca6ac-dc6e-4aff-b6a3-9c5ce3ab675c)
gabrielvidal self-assigned this 2026-11-27 10:58:08 +01:00
gabrielvidal added 1 commit 2026-11-27 10:58:08 +01:00
Inkling 2 Mini runs looped on the same command until they were stopped
(Arthur's veille pharma 1fec9543, the mail secretary d5aa1be7/c2a4e62c).
Gabriel chose Sonnet as the default for guests' scheduled jobs:

- cron/guests.py: DEFAULT_MODEL sonnet; move_local_jobs_to_sonnet() runs
  once at startup (marker next to the cron store) and moves every guest
  job still on qwen (or with no model) and a saved 'qwen' policy to Sonnet.
  The local model stays a choice, with its Sonnet fallback.
- users/store.py + schemas: cronLimits.defaultModel defaults to sonnet.
- UI: Sonnet first and the fallback value in the guest job editor, their
  list, Guest defaults and the owner's guest-job form; mock /api/me/cron.
- CLI help + scheduled-jobs skill; openapi + generated types re-dumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This pull request has changes conflicting with the target branch.
  • backend/cron/guest_routes.py
  • backend/runs/guestjob.py
  • backend/schemas/cron.py
  • backend/schemas/users.py
  • backend/test_guest_jobs.py
  • backend/users/store.py
  • cli/ai_agent.py
  • cli/skills/scheduled-jobs/SKILL.md
  • frontend/openapi.json
  • frontend/src/business/jobs/components/JobEditor.tsx
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin guest-jobs-sonnet:guest-jobs-sonnet
git checkout guest-jobs-sonnet
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gabrielvidal/ai-agent#23