Skip to content

fix(aw): prevent safeoutputs session timeout in news-committee-reports#1895

Merged
pethers merged 3 commits intomainfrom
copilot/aw-fix-committee-reports-failure
Apr 21, 2026
Merged

fix(aw): prevent safeoutputs session timeout in news-committee-reports#1895
pethers merged 3 commits intomainfrom
copilot/aw-fix-committee-reports-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

Fix: News: Committee Reports — "No Safe Outputs Generated" session timeout

Root cause

Run 24709578961 produced zero safe outputs: the agent spent ~37 min doing forbidden python3 HTML post-edits, then every safeoutputs___* call failed with Error POSTing to endpoint: session not found (Streamable-HTTP idle timeout ~30–35 min). The documented Heartbeat PR was never called.

Changes (.github/workflows/news-committee-reports.md)

  • Added prominent 🫀 MANDATORY EARLY HEARTBEAT PR GATE callout at top of prompt
  • Moved heartbeat from minute 22-25 → minute 13-15; split Pass 1 into Part A (pre-) + Part B (post-heartbeat)
  • Inline anti-pattern reminder on generator line: no python3/heredoc/sed post-editing
  • Rewrote Hard Deadline: heartbeat PR is the output if final PR fails with session error
  • Addressed reviewer feedback — made internal allocations self-consistent:
    • Pass 1 Part A = 7 min + Part B = 8 min → total 15 min (meets deep depth tier minimum)
    • Pass 2 = 7 min (matches footer and depth tier)
    • Replaced "risk-assessment.md stub" with "initial risk-assessment.md draft to be completed in Part B and deepened in Pass 2 — no AI_MUST_REPLACE markers or template stubs may remain by the final PR", eliminating conflict with the "all stubs must be replaced" rule
    • Rebalanced downstream phases so total = 45 min: setup(3) + download(3) + Pass1A(7) + heartbeat(2) + Pass1B(8) + Pass2(7) + gates(2) + articles(6) + improve(4) + finalPR(2) + deadline(1) = 45

Validation

  • gh aw compile news-committee-reports → ✓ 0 errors, 0 warnings
  • Lock file unchanged in this commit (body-only prompt text change, not captured in .lock.yml)
  • parallel_validation on prior commit: Code Review 0 comments, CodeQL 0 alerts

Copilot AI linked an issue Apr 21, 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 21, 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

@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 21, 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 committee reports fix(aw): prevent safeoutputs session timeout in news-committee-reports Apr 21, 2026
Copilot AI requested a review from pethers April 21, 2026 08:35
@pethers pethers marked this pull request as ready for review April 21, 2026 08:44
Copilot AI review requested due to automatic review settings April 21, 2026 08:44
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-committee-reports agentic workflow instructions to avoid safeoutputs Streamable-HTTP session expiry by forcing an earlier “heartbeat” PR, ensuring partial work is preserved even if later safeoutputs calls fail.

Changes:

  • Added a prominent mandatory early Heartbeat PR gate near the top of the workflow instructions.
  • Moved the heartbeat window earlier (to ~minute 13–15) and adjusted the time budget steps accordingly, including explicit “no manual post-editing” guidance.
  • Regenerated the lock file, picking up a compiler-emitted aw_context_workflows/aw_context schema field for dispatch.

Reviewed changes

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

File Description
.github/workflows/news-committee-reports.md Adds early-heartbeat guidance and updates the run timeline to prevent safeoutputs session timeout.
.github/workflows/news-committee-reports.lock.yml Compiler-emitted lockfile update adding aw_context_workflows and an aw_context input in the dispatch schema.

Comment on lines +309 to +312
- **Minutes 6–13**: 🚨 **AI Analysis Pass 1 (Part A — 7 min)**: Start per-file analysis for the highest-significance documents first (synthesis-summary.md + top 3 dok_ids' analyses + risk-assessment.md stub) so the Heartbeat PR at minute 15 has real content, not empty stubs.
- **Minutes 13–15**: 🫀 **MANDATORY EARLY Heartbeat PR** — `git add` whatever analysis artifacts exist in `analysis/daily/$ARTICLE_DATE/committeeReports/` (even partial), `git commit -m "wip: committee-reports heartbeat {date}"`, then **`safeoutputs___create_pull_request`** with title `🫀 Heartbeat - Committee Reports - {date}` and **`draft: true`**. Run `git checkout main` after the call so subsequent commits don't stack onto the frozen patch. This **resets the safeoutputs session idle timer** (~30–35 min window) AND preserves work if later phases fail. **NON-NEGOTIABLE: if you reach minute 18 without a successful heartbeat PR, stop all other work and call it immediately.**
- **Minutes 15–22**: 🚨 **AI Analysis Pass 1 (Part B — 7 min)**: Complete per-file analysis for EVERY remaining document with Mermaid diagrams, evidence tables, SWOT entries (total Pass 1 ≥ 14 min).
- **Minutes 22–28**: 🚨 **AI Analysis Pass 2 (6 min)**: Read ALL analysis artifacts back, improve every section, replace ALL script stubs with AI analysis. Run enrichment verification gate.
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The updated time budget conflicts with the workflow’s own minimum-pass requirements: the intro section defines Analysis Pass 1 = 15 min and Pass 2 = 7 min, but the schedule now allocates Pass 1 as 7+7 (=14) and Pass 2 as 6. Also calling out a "risk-assessment.md stub" clashes with later rules that all stubs must be replaced. Suggest either (a) adjust the minute allocations to meet 15/7 (and the deep-depth 15 min minimum), or (b) update the stated minimums/wording so the document is internally consistent, and avoid encouraging “stub” files unless they’re explicitly completed before the final PR.

Copilot uses AI. Check for mistakes.
- **Minutes 40–43**: Validate, commit, create **FINAL (non-draft)** PR with `safeoutputs___create_pull_request`. This is your second and last PR call (`max: 2`).
- **Minutes 43–45**: 🚨 **HARD DEADLINE** — If the final PR call fails with `session not found`, the heartbeat PR from minute 15 already preserves partial work. Do NOT call `safeoutputs___noop` in that case — the heartbeat PR is your output.

> ⚠️ **Analysis phase is 22 minutes minimum (Pass 1: 15 min + Pass 2: 7 min)** — every analysis file must contain color-coded Mermaid diagrams, structured evidence tables with dok_id citations, and follow template structure exactly. ALL script-generated stubs MUST be replaced with AI-enriched analysis. Run the ENFORCED gates from SHARED_PROMPT_PATTERNS.md before proceeding to article generation.
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

This note still states "Pass 1: 15 min + Pass 2: 7 min", but the revised schedule above is Pass 1 ≥ 14 min and Pass 2 = 6 min. Please update this line (or the schedule) so readers don’t get contradictory instructions about required analysis time.

Suggested change
> ⚠️ **Analysis phase is 22 minutes minimum (Pass 1: 15 min + Pass 2: 7 min)** — every analysis file must contain color-coded Mermaid diagrams, structured evidence tables with dok_id citations, and follow template structure exactly. ALL script-generated stubs MUST be replaced with AI-enriched analysis. Run the ENFORCED gates from SHARED_PROMPT_PATTERNS.md before proceeding to article generation.
> ⚠️ **Analysis phase is 22 minutes minimum (Pass 1: ≥14 min + Pass 2: 6 min)** — every analysis file must contain color-coded Mermaid diagrams, structured evidence tables with dok_id citations, and follow template structure exactly. ALL script-generated stubs MUST be replaced with AI-enriched analysis. Run the ENFORCED gates from SHARED_PROMPT_PATTERNS.md before proceeding to article generation.

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 21, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 21, 2026

@copilot apply changes based on the comments in this thread

Addressed both reviewer threads in 4d346ee. Rebalanced the time budget to Pass 1 = 15 min (7 Part A + 8 Part B) and Pass 2 = 7 min so it matches the deep depth tier and the footer line is no longer contradictory. Also replaced the "risk-assessment.md stub" wording with "initial draft to be completed in Part B and deepened in Pass 2 — no AI_MUST_REPLACE markers or template stubs may remain by the final PR" to remove the conflict with the all-stubs-must-be-replaced rule. Total still sums to 45 min.

@github-actions github-actions Bot added the size-m Medium change (50-250 lines) label Apr 21, 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

@pethers pethers merged commit b042272 into main Apr 21, 2026
13 checks passed
@pethers pethers deleted the copilot/aw-fix-committee-reports-failure branch April 21, 2026 09:36
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-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: Committee Reports failed

3 participants