Skip to content

Fix news workflow agent timeouts: prohibit manual article generation#1288

Merged
pethers merged 3 commits intomainfrom
copilot/aw-news-debug-workflow-failure
Mar 19, 2026
Merged

Fix news workflow agent timeouts: prohibit manual article generation#1288
pethers merged 3 commits intomainfrom
copilot/aw-news-debug-workflow-failure

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

  • Investigate failed workflow run #23284115048
  • Identify root cause: agent timed out (45min) trying to manually build HTML with python3 (build-en-article.py) instead of using npx tsx scripts/generate-news-enhanced.ts
  • Fix news-interpellations.md prompt to prohibit manual article generation (python3, heredoc)
  • Fix misleading time budget ("all 14 languages" → "core languages EN, SV") across all 4 dedicated news workflows
  • Add explicit fallback instruction: if script fails, use safeoutputs___noop instead of manually building HTML
  • Apply same fixes to news-propositions.md, news-motions.md, news-committee-reports.md for consistency
  • Add 3 new tests in tests/workflow-architecture.test.ts enforcing script-based generation safety
  • Use dispatch-derived $LANG_ARG in safety section examples instead of hardcoded "en,sv"
  • All 54 tests pass (51 existing + 3 new)
  • Code review and CodeQL — no issues
Original prompt

This section details on the original issue you should resolve

<issue_title>[aw] News: Interpellation Debates failed</issue_title>
<issue_description>### Workflow Failure

Workflow: News: Interpellation Debates
Branch: main
Run: https://github.com/Hack23/riksdagsmonitor/actions/runs/23284115048

Action Required

Option 1: Debug using any coding agent

Use this prompt with any coding agent (GitHub Copilot, Claude, Gemini, etc.):

Debug the agentic workflow failure using https://raw.githubusercontent.com/github/gh-aw/main/debug.md

The failed workflow run is at https://github.com/Hack23/riksdagsmonitor/actions/runs/23284115048

Option 2: Assign this issue to Copilot

Assign this issue to Copilot using the agentic-workflows sub-agent to automatically debug and fix the workflow failure.

Option 3: Manually invoke the agent

Debug this workflow failure using your favorite Agent CLI and the agentic-workflows prompt.

[!TIP]
To stop a workflow from creating failure issues, set report-failure-as-issue: false in its frontmatter:

safe-outputs:
  report-failure-as-issue: false

Generated from News: Interpellation Debates ·

  • expires on Mar 26, 2026, 8:05 AM UTC

Comments on the Issue (you are @copilot in this section)

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

@github-actions github-actions bot added the size-xs Extra small change (< 10 lines) label Mar 19, 2026
@github-actions
Copy link
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: size-xs

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

…ime budgets

- Add "Article Generation Safety" section to interpellations, propositions,
  motions, and committee-reports workflow prompts prohibiting python3/heredoc
  manual HTML generation that causes agent timeouts
- Fix misleading time budgets ("all 14 languages" → "core languages EN, SV")
- Add fallback instruction: use safeoutputs___noop if script fails
- Add 3 new tests enforcing script-based generation safety rules

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions bot added documentation Documentation updates workflow GitHub Actions workflows ci-cd CI/CD pipeline changes testing Test coverage news News articles and content generation agentic-workflow Agentic workflow changes size-m Medium change (50-250 lines) labels Mar 19, 2026
@github-actions
Copy link
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copilot AI changed the title [WIP] [aw] Debug workflow failure in news interpellation debates Fix news workflow agent timeouts: prohibit manual article generation Mar 19, 2026
Copilot AI requested a review from pethers March 19, 2026 09:02
@pethers pethers marked this pull request as ready for review March 19, 2026 09:11
Copilot AI review requested due to automatic review settings March 19, 2026 09:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the gh-aw news workflow prompts to prevent agent timeouts by disallowing manual article construction and enforcing the existing TypeScript-based generation pipeline, with accompanying architecture tests to keep the constraint in place.

Changes:

  • Add an “Article Generation Safety” section to four dedicated news workflows, prohibiting python/manual HTML/heredoc generation and directing agents to npx tsx scripts/generate-news-enhanced.ts.
  • Update workflow time budgets to focus on core language generation (EN/SV) and then dispatch news-translate.
  • Add a Vitest suite enforcing the new “script-based generation” safety constraints across the four workflows.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/workflow-architecture.test.ts Adds tests to enforce python/manual-HTML prohibitions and require generate-news-enhanced.ts usage for script-based workflows.
.github/workflows/news-interpellations.md Updates time budget and adds “Article Generation Safety” guidance directing generation via generate-news-enhanced.ts.
.github/workflows/news-propositions.md Updates time budget and adds “Article Generation Safety” guidance directing generation via generate-news-enhanced.ts.
.github/workflows/news-motions.md Updates time budget and adds “Article Generation Safety” guidance directing generation via generate-news-enhanced.ts.
.github/workflows/news-committee-reports.md Updates time budget and adds “Article Generation Safety” guidance directing generation via generate-news-enhanced.ts.

Comment on lines +147 to +149
The repository provides a complete article generation pipeline. You MUST use it:
```bash
source scripts/mcp-setup.sh && npx tsx scripts/generate-news-enhanced.ts --types=interpellations --languages="en,sv" --skip-existing

The repository provides a complete article generation pipeline. You MUST use it:
```bash
source scripts/mcp-setup.sh && npx tsx scripts/generate-news-enhanced.ts --types=propositions --languages="en,sv" --skip-existing

The repository provides a complete article generation pipeline. You MUST use it:
```bash
source scripts/mcp-setup.sh && npx tsx scripts/generate-news-enhanced.ts --types=motions --languages="en,sv" --skip-existing
Comment on lines +151 to +153
The repository provides a complete article generation pipeline. You MUST use it:
```bash
source scripts/mcp-setup.sh && npx tsx scripts/generate-news-enhanced.ts --types=committee-reports --languages="en,sv" --skip-existing
@pethers
Copy link
Member

pethers commented Mar 19, 2026

@copilot apply changes based on the comments in this thread

Replace hardcoded --languages="en,sv" with --languages="$LANG_ARG" in the
safety section of all 4 news workflow prompts, referencing the Generation
Steps section where LANG_ARG is derived from the dispatch languages input.

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 19, 2026

@copilot apply changes based on the comments in this thread

Updated in 379343e — replaced hardcoded --languages="en,sv" with --languages="$LANG_ARG" in the Article Generation Safety section of all 4 workflows, with a note pointing to the Generation Steps section where LANG_ARG is derived from the languages dispatch input.

@github-actions
Copy link
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers pethers merged commit 23ddd14 into main Mar 19, 2026
15 checks passed
@pethers pethers deleted the copilot/aw-news-debug-workflow-failure branch March 19, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentic-workflow Agentic workflow changes ci-cd CI/CD pipeline changes documentation Documentation updates news News articles and content generation size-m Medium change (50-250 lines) size-xs Extra small change (< 10 lines) testing Test coverage workflow GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] News: Interpellation Debates failed

3 participants