# Cron job model routing: pinned vs unpinned, AGY-first with Claude fallback ## Why a cron job "cannot fall back" A job that stores its own `provider`, `model` or `base_url` is PINNED. A pinned job never borrows the profile's `fallback_providers` chain (scheduler `_job_route_pinned` / `_job_fallback_chain`), so one quota or auth error on that provider fails the whole run. The failure notice says so ("pinned to its own provider ... `--unpin`"). Read the job first: ```bash python3 -c "import json;[print({k:j.get(k) for k in ('id','name','provider','model','last_status','last_error')}) for j in json.load(open('/cron/jobs.json'))['jobs']]" ``` ## Unpin a job `hermes -p cron edit --provider "" --model "" --unpin`, then re-read `jobs.json`: `provider`, `model` and `pinned` must be empty and `enabled` true. Back up `cron/jobs.json` first. Do not fire the job to test it if it delivers to a person's chat; the next scheduled tick is the real test, so name its time and check `cron/output//` afterwards. ## Choose the cron-wide order (AGY first, Claude behind it) Unpinned jobs resolve the provider as: per-job pin > `cron.model_provider` / `cron.model` > the profile's main model. To put a different primary on cron jobs only, without touching the profile's chat model: ```bash hermes -p config set cron.model_provider antigravity-subscription-directsdk hermes -p config set cron.model gemini-4-neon ``` The profile's `fallback_providers` chain then catches failures; check that the primary is not repeated in it. Read `config.yaml` back (`cron:` block) and back it up first. Ask before applying the same change to other profiles: it reverses the Claude-first order for scheduled work. ## `fallback_providers` is profile-wide, not cron-wide The chain serves chat AND cron in that profile; only `cron.model_provider` / `cron.model` are cron-only. When the user says "cron", change only the `cron:` keys and leave the chain alone; if the order must change (AGY steps before the Claude API entry), say that chat is affected too and get a yes first. When a profile must follow another profile's model flow (e.g. a side profile mirroring `default`), make four things identical and diff them in code: `model.default/provider`, the whole `fallback_providers` list (including `key_env` on the Claude API entry), `plugins.enabled`, and the plugin directory itself (copy the provider plugin directory into the profile if it uses one). Then prove the route resolves from that profile with `hermes -p

chat --provider antigravity-2 -m --oneshot -Q -q '...'`; a listed chain entry whose plugin is not enabled in that profile is dead. ## Proving a cron really used the intended model `hermes -p

cron run ` runs synchronously and delivers to the person's chat, so ask first. Afterwards check `last_status`/`last_error` in `jobs.json` AND `grep 'API call #' /logs/agent.log` (the line names `model=` and `provider=`), plus the `delivered to telegram` line. A green run on the primary proves nothing about the fallback walk; say so, and wait for a real primary failure to see it. Per-account, per-model quota probe without touching cron: `agy --model -p 'Sadece tamam yaz.' --print-timeout 45s` (run it under the account you are checking); an `invalid model selection` reply means that account lacks the id, not that its quota is full. ## Telling which AGY login is dead `agy models` is the cheap probe: a model list means signed in; `Please sign in to view available models` means signed out (cron error text: `Antigravity CLI is not authenticated`). If you use more than one account, check first that the provider's terms allow it; probe each with its own signed-in session. macOS has no `timeout` binary: wrap the call in `subprocess.run(..., timeout=30, stdin=DEVNULL)` so a sign-in screen cannot hang the probe. Different accounts can expose different model sets (the primary-model id may not exist on the second), so a request for a missing id fails instead of falling back. A signed-out account is fixed by the user running `agy` in their own terminal; never run the login for them. `Individual quota reached ... Resets in Nh` is a quota block on that model, not a sign-in problem; probe a sibling model of the same account before calling the account dead.