A cron-triggered generation can run right after a deploy, before any admin_init migration pass — inserts carrying the new agent_role / prompt_version columns would fail silently on the old schema and lose the cost row. Two-sided heal: (1) log_api_call/log_image_generation retry the insert without the v0.18.0 columns when it fails; (2) the db-version check now also runs on cron requests (init + wp_doing_cron), so the schema migrates on the first cron hit, not the first admin visit. Agent-Session: pipeline-v2-phase1-engineer-20260612
11 KiB
11 KiB