A
Admin

Run #3437

Cron: Stale Runs Cleanup · agent infra-hub-nextjs

Status
success
Tokens
419 / 254
Cost
$0.000000
Duration
8.1s
Validation
{
  "ok": true,
  "failed": [],
  "hallucinated": [],
  "context_errors": []
}
Params
{}
Prompt resolved
Tu generes une migration SQL pour marquer comme stale les agent_task_runs en status running depuis >30 minutes.\n\nLessons pertinentes:\nLESSONS APPRISES PERTINENTES :
- L485-INFO: voice_broadcast_audit: retention 7j via cron daily 3h (pg_cron indisponible)
- L572-WIN: Contabo cleanup dispatch EXECUTED — 23 orphan memory_files DELETE 23/23 OK
- L559-CONT: IMPL R1 — dlq-reaper dry-run installé (cron */5min user-space, read-only)
- L550-WIN: MEMORY.md drift cleanup S163/S165/S169 supprimes
- L548-CONT: DESIGN R0 — Pattern O reaper job (drain dead_letters_unified pending→retry→resolved, cron */5min, backoff 2^n)\n\nSchema:\nTABLE agencecom.agent_task_runs :
  id bigint NOT NULL DEFAULT nextval('agencecom.agent_task_runs_id_seq'::regclass)
  dispatch_id bigint NOT NULL
  template_id bigint NOT NULL
  worker_index integer NOT NULL DEFAULT 0
  agent_id character varying
  session_id bigint
  params jsonb NOT NULL DEFAULT '{}'::jsonb
  prompt_resolved text
  llm_response text
  llm_tokens_in integer
  llm_tokens_out integer
  cost_usd numeric
  validation_result jsonb
  status character varying NOT NULL DEFAULT 'queued'::character varying
  retry_count integer DEFAULT 0
  parent_run_id bigint
  output_artifact_path text
  error_message text
  started_at timestamp with time zone
  completed_at timestamp with time zone\n\nProduit UNIQUEMENT le SQL UPDATE avec WHERE clause appropriee. Pas de transaction wrapper. Pas de commentaires.
LLM Response
```sql
UPDATE agencecom.agent_task_runs
SET status = 'stale'
WHERE status = 'running'
  AND started_at < NOW() - INTERVAL '30 minutes';
```