Add Safe Output Guarantee to news-interpellations workflow#1646
Add Safe Output Guarantee to news-interpellations workflow#1646
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-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>
🔍 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 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" |
There was a problem hiding this comment.
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).
| - **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. |
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_requestorsafeoutputs___noopbefore session end. These sections were already present innews-propositions.mdbut missing fromnews-interpellations.md.Changes to
.github/workflows/news-interpellations.md:Minutes 43–45forces immediatenoopif no output yetLock file uses
{{#runtime-import}}, so no recompilation needed.