# agy headless pitfalls (agy 1.4.0, verified Oct 2026) - Model names change between versions. A hardcoded name like `gemini-3.1-pro-high` fails with `invalid model selection` and JSON `status: ERROR`. List current ids with `agy models` (e.g. `gemini-4-argon-high`, `claude-opus-5-5-high`) and fix scripts when a cron job silently fails. - `--print-timeout` needs a unit: `600s`, not `600`. - With `--output-format json`, success is `status == "SUCCESS"` and a non-empty `response`; failures can still exit 0 or be parseable JSON, so check `status` and `error`. - For web research, `--sandbox` can return an empty response (the research tool shells out and headless mode cannot approve it; see SKILL.md). Do not use a permission-bypass flag to get around this: add a narrow allow rule with the user's approval, or let the coordinator fetch the web content itself, and have the coordinator save `response` to disk. - `agy -p` reads its task file once at start. A note appended to `GOREV.md` while the run is going is usually never seen; relaunch (or start the next run) with "read the EK section at the end of GOREV.md" and check the output against the new rule. - Image generation (`generate_image`) has its own quota on the image model, separate from the text model you passed with `--model`, and it resets on a short window (about an hour or two), not with the text pool. Probe it with one tiny generation before a batch. When it is full, do not park the job behind a `sleep` timer (the user reads waiting as stalling): launch the run now with the non-generation prep listed first (prompts, palette extraction, cleanup/composite script tested end to end on an existing image) and a "429: wait 10 min, retry" rule for the generation step. - Check `generate_image`'s parameters before planning a reference-guided run: if it only takes a prompt and aspect ratio, reference images and layout sketches cannot be fed in. Generate separate assets on a plain flat background (e.g. magenta) and composite them in code instead of asking for a whole scene. - A very short sprite prompt can be refused as a policy violation ("prompt contains sensitive words"); rewrite it as a full descriptive sentence in English before concluding image generation is blocked. - Debug by running the exact command from the script manually before touching cron. - A multi-profile survey script whose analysis step is agy: collecting many profiles can take several minutes; hardcoded profile lists in such scripts go stale, so derive the list at run time.