Skip to content

fix: bound engine calls with a per-call timeout in run-engine.sh - #102

Merged
Santisoutoo merged 1 commit into
mainfrom
fix/engine-call-timeout
Aug 24, 2026
Merged

fix: bound engine calls with a per-call timeout in run-engine.sh#102
Santisoutoo merged 1 commit into
mainfrom
fix/engine-call-timeout

Conversation

@Santisoutoo

Copy link
Copy Markdown
Owner

Descripción

.github/agent/run-engine.sh invocaba opencode run / cursor-agent -p sin ningún timeout propio, dependiendo enteramente del timeout-minutes: 90 del job como único backstop.

En el run 32749623046 (issue #85, 2026-08-24) el paso Review invocó cursor-agent -p --force --model composer-2.5 y se quedó colgado 84 minutos sin producir ni una línea de output. GitHub Actions tuvo que matar un proceso huérfano cursor-agent en el cleanup del job al llegar al timeout de 90 min. El resultado fue un conclusion: cancelled sin PR, sin verdict, y quemando el presupuesto del job entero.

Con la cascada de modelos añadida en #101 (cursor gpt-5.3-codex → cursor gpt-5.6-sol → opencode-go/kimi-k3), un colgado en el primer intento nunca llegaba a los fallbacks — se quedaba parado ahí para siempre.

Cambio

Envuelve ambas invocaciones de motor en run-engine.sh con timeout -k 30 ${ENGINE_TIMEOUT_SECONDS:-900}:

  • 900s (15 min) por defecto, muy por encima de la duración real observada del Implement (~6 min), pero muy por debajo de los 90 min del job.
  • -k 30: si el proceso ignora SIGTERM, se envía SIGKILL 30s después (evita el mismo huérfano que tuvo que limpiar GitHub Actions).
  • Con la cascada de la review, ahora un colgado en el primer modelo falla rápido y cae al siguiente en vez de comerse el job entero.

Checklist

  • bash -n .github/agent/run-engine.sh — sintaxis válida
  • Sin cambios de comportamiento cuando el engine responde con normalidad (el timeout solo actúa si el proceso no termina)
  • No añade secretos ni cambia superficie de permisos

No CI job cubre .github/agent/*.sh; verificado localmente con bash -n.

cursor-agent hung with zero output for 84 minutes during the review step
of run 32749623046 (issue #85), and was only reaped when the job's
90-minute cap killed the entire run. Neither engine had a call-level
timeout, so one hung call burned the whole job budget instead of failing
fast into the caller's infra-failure / model-fallback handling.

Wrap both engine invocations with `timeout -k 30 ${ENGINE_TIMEOUT_SECONDS:-900}`
so a hung call dies well inside the job cap and the review step's
cursor->cursor->opencode cascade can actually reach its fallback models.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant