fix: bound engine calls with a per-call timeout in run-engine.sh - #102
Merged
Conversation
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.
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descripción
.github/agent/run-engine.shinvocabaopencode run/cursor-agent -psin ningún timeout propio, dependiendo enteramente deltimeout-minutes: 90del job como único backstop.En el run
32749623046(issue #85, 2026-08-24) el paso Review invocócursor-agent -p --force --model composer-2.5y se quedó colgado 84 minutos sin producir ni una línea de output. GitHub Actions tuvo que matar un proceso huérfanocursor-agenten el cleanup del job al llegar al timeout de 90 min. El resultado fue unconclusion: cancelledsin 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.shcontimeout -k 30 ${ENGINE_TIMEOUT_SECONDS:-900}:-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).Checklist
bash -n .github/agent/run-engine.sh— sintaxis válidaNo CI job cubre
.github/agent/*.sh; verificado localmente conbash -n.