Skip to content

Add Safe Output Guarantee to news-interpellations workflow#1646

Merged
pethers merged 2 commits intomainfrom
copilot/debug-agentic-workflow-failure
Apr 10, 2026
Merged

Add Safe Output Guarantee to news-interpellations workflow#1646
pethers merged 2 commits intomainfrom
copilot/debug-agentic-workflow-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

Agent ran 20 minutes, produced 13 bytes of output, zero safe output calls. The prompt lacked the three sections that force the agent to always call safeoutputs___create_pull_request or safeoutputs___noop before session end. These sections were already present in news-propositions.md but missing from news-interpellations.md.

Changes to .github/workflows/news-interpellations.md:

  • Safe Output Guarantee section (top of prompt, before dispatch params) — establishes the absolute rule + 35-minute time guard
  • HARD DEADLINE in Time Budget — Minutes 43–45 forces immediate noop if no output yet
  • FINAL REMINDER at end of file — last thing the agent reads before finishing

Lock file uses {{#runtime-import}}, so no recompilation needed.

Copilot AI linked an issue Apr 10, 2026 that may be closed by this pull request
@github-actions github-actions bot added the size-xs Extra small change (< 10 lines) label Apr 10, 2026
@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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

…news-interpellations workflow

Fixes #1642 - The agent was running for 20 minutes but never calling a safe
output tool (content length: 13 bytes, zero safe outputs). Added three critical
prompt sections that were present in working news-propositions.md but missing
from news-interpellations.md:

1. MANDATORY: Safe Output Guarantee section (top of prompt)
2. HARD DEADLINE time guard (minutes 43-45 in time budget)
3. FINAL REMINDER section (end of prompt)

Since the lock file uses runtime-import, these changes take effect immediately
without recompilation.

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/8a789742-79b9-493a-8642-f042a09da4ef

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 news News articles and content generation agentic-workflow Agentic workflow changes size-s Small change (10-50 lines) labels Apr 10, 2026
@github-actions
Copy link
Copy Markdown
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] Fix workflow failure for News: Interpellation Debates Add Safe Output Guarantee to news-interpellations workflow Apr 10, 2026
Copilot AI requested a review from pethers April 10, 2026 07:36
@pethers pethers marked this pull request as ready for review April 10, 2026 07:37
Copilot AI review requested due to automatic review settings April 10, 2026 07:37
@pethers pethers merged commit 350b9f0 into main Apr 10, 2026
13 checks passed
@pethers pethers deleted the copilot/debug-agentic-workflow-failure branch April 10, 2026 07:38
Copy link
Copy Markdown
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

Updates the news-interpellations agentic workflow prompt to prevent “zero safe output” failures by adding the same guardrails already used in other news workflows.

Changes:

  • Adds a top-of-prompt “Safe Output Guarantee” section with a 35-minute time guard.
  • Adds a hard deadline step in the time budget to force a safe output before timeout.
  • Adds a final end-of-prompt reminder requiring exactly one safe output call.

- **Minutes 25–33**: Generate articles for core languages (EN, SV) using `npx tsx scripts/generate-news-enhanced.ts`
- **Minutes 33–38**: Validate and fix any quality issues
- **Minutes 38–43**: Commit analysis artifacts + articles, create PR with `safeoutputs___create_pull_request`
- **Minutes 43–45**: 🚨 **HARD DEADLINE** — If no safe output has been called yet, IMMEDIATELY call `safeoutputs___noop` with reason "Time limit reached before completion"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The HARD DEADLINE instruction unconditionally tells the agent to call safeoutputs___noop if no safe output has been called yet. This conflicts with the Safe Output Guarantee rule above (#1/#3), where the correct action near timeout is to create a PR if any artifacts exist. As written, the agent could generate/commit artifacts and then still be instructed to noop, dropping the work. Consider making the deadline conditional: create PR if there are any committed changes/artifacts; only noop when none exist (or MCP unreachable).

Suggested change
- **Minutes 43–45**: 🚨 **HARD DEADLINE** — If no safe output has been called yet, IMMEDIATELY call `safeoutputs___noop` with reason "Time limit reached before completion"
- **Minutes 43–45**: 🚨 **HARD DEADLINE** — If no safe output has been called yet, first check whether any analysis artifacts, generated articles, or committed changes exist. If any work exists, IMMEDIATELY call `safeoutputs___create_pull_request` to preserve it. Only call `safeoutputs___noop` with reason "Time limit reached before completion" when no artifacts or committed changes were produced, or when safe output/MCP is unavailable.

Copilot uses AI. Check for mistakes.
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-s Small change (10-50 lines) size-xs Extra small change (< 10 lines) workflow GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] News: Interpellation Debates failed

3 participants