fix: news-translate workflow timeout — add batch limiting and time guards#1293
fix: news-translate workflow timeout — add batch limiting and time guards#1293
Conversation
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: size-xs Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
… news-translate workflow - Increase timeout-minutes from 45 to 60 to prevent premature timeout - Add batch limiting: max 2 article types per run when scanning all - Add time guard: skip parity check if 40+ min elapsed - Simplify enhancement step (3c) to only fix critical issues - Update error handling table with batch limit guidance - Recompile lock.yml with gh-aw v0.62.0 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…med time guard constant Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
Updates the agentic news-translate workflow prompt and compiled lock workflow to reduce scheduled-run timeouts when many untranslated article types exist, aiming to ensure the workflow reaches validation + PR creation reliably.
Changes:
- Increased workflow timeout from 45 to 60 minutes (prompt + compiled lock).
- Added batch limiting guidance (process max 2 untranslated types per run) and introduced time-guard guidance to prioritize creating a partial PR over timing out.
- Simplified the translation “enhancement” step into a time-conscious “Quick Parity Check”.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/news-translate.md | Adjusts timeout/time budget guidance and adds batch limiting + time guards in the agent prompt. |
| .github/workflows/news-translate.lock.yml | Recompiled lock workflow to apply the 60-minute timeout in the executed job and env. |
| .github/aw/actions-lock.json | Adds the github/gh-aw-actions/setup@v0.62.0 lock entry consistent with the updated compiler version. |
| ELAPSED=$(( $(date +%s) - START_TIME )) | ||
| if [ "$ELAPSED" -gt "$TIME_GUARD_SECONDS" ]; then | ||
| echo "⏰ 40+ minutes elapsed — skipping remaining article types to avoid timeout" | ||
| echo " Remaining types will be handled by the next scheduled run." |
| echo "⚠️ BATCH LIMIT: Processing only first 2 types (sorted): $BATCH_TYPES" | ||
| echo " Deferred to next run: $REMAINING" | ||
| UNTRANSLATED_TYPES="$BATCH_TYPES" | ||
| fi |
|
|
||
| If no untranslated articles are found, call `safeoutputs___noop` with message: "All articles are fully translated. No translation work needed." | ||
|
|
||
| **IMPORTANT**: When batch limiting is applied, the agent MUST only process the `BATCH_TYPES` (first 2 article types). Do NOT attempt to translate deferred types — they will be handled by the next scheduled run. |
| # Re-derive variables (each code block runs in its own shell session) | ||
| source /tmp/gh-aw/agent/timing.env 2>/dev/null || START_TIME=$(date +%s) | ||
| TIME_GUARD_SECONDS=2400 # 40 minutes | ||
| ELAPSED=$(( $(date +%s) - START_TIME )) | ||
| echo "⏰ Elapsed time: $((ELAPSED / 60)) minutes" | ||
| if [ "$ELAPSED" -gt "$TIME_GUARD_SECONDS" ]; then | ||
| echo "⚠️ 40+ minutes elapsed — skipping parity check to avoid timeout" |
The
news-translatescheduled workflow timed out at 45 minutes when 3+ EN article types needed translation into 12 languages (36 files). The agent spent its entire budget on translation work without ever reaching PR creation.Changes
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.