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 |
…tputs session idle timeout Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/f6b0a915-3add-46af-85c2-dd74cd7f0051 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…udget Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/f6b0a915-3add-46af-85c2-dd74cd7f0051 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 News: Government Propositions agentic workflow prompt to avoid Safe Outputs “session not found” failures by moving the safeoutputs___create_pull_request intent-recording call earlier in the run, aligning the time budget with the observed Streamable-HTTP idle timeout.
Changes:
- Added a prominent safeoutputs idle-timeout callout and clarified that the PR intent must be recorded early.
- Compressed Run 1 (analysis) and Run 2 (articles) time budgets so the PR call happens well before the observed cutoff.
- Added an early-exit rule to stage/commit and open an
[early-pr]PR if staging hasn’t started by minute 25.
| **Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts): | ||
| > 🔴 **CRITICAL — safeoutputs MCP idle timeout (~30 min)**: The `safeoutputs` MCP server runs a Streamable-HTTP session that expires after **~30–35 minutes of idle time** (confirmed in run [24820030825](https://github.com/Hack23/riksdagsmonitor/actions/runs/24820030825) where all `create_pull_request` calls at minute ~32 failed with `session not found`, losing 37 files of completed analysis work). `sandbox.mcp.keepalive-interval: 300` keeps TCP connections alive but does **NOT** refresh the server-side session. **Your first and only `safeoutputs___*` call MUST happen before minute 28 of agent time.** This is a harder deadline than the ~60-minute Copilot-API token window described in `00-base-contract.md §Session keepalive requirement` and overrides the generic 48-min deadline in `07-commit-and-pr.md §Deadline enforcement` for this workflow. | ||
| > | ||
| > **AI-FIRST within the compressed budget**: Pass 2 is still mandatory (AI FIRST principle, §"5. 🔴 AI FIRST Quality Principle" in repo custom instructions). Under the tightened ~28-min Run 1 budget, prefer **scope compression over iteration skipping** — reduce the number of per-document analyses if needed, but always perform a full read-back-and-improve Pass 2 on whatever artifacts exist. For scheduled runs treat `analysis_depth` as `standard` in practice even if the input defaults to `deep`; reserve `deep`/`comprehensive` for manual `workflow_dispatch` backfills where a human can monitor for a longer-session environment. A partial analysis with genuine iteration is always strictly better than a broader analysis that never reaches GitHub. |
There was a problem hiding this comment.
The guidance to “reduce the number of per-document analyses if needed” conflicts with the Analysis Gate’s per-document coverage requirement (one document analysis per dok_id in data-download-manifest.md, see 05-analysis-gate.md check 2). As written, following this advice will predictably fail the gate. Consider reframing scope compression as reducing the download/manifest scope (e.g., fewer dok_id entries) while still maintaining 1:1 per-document coverage for whatever remains in the manifest.
| > **AI-FIRST within the compressed budget**: Pass 2 is still mandatory (AI FIRST principle, §"5. 🔴 AI FIRST Quality Principle" in repo custom instructions). Under the tightened ~28-min Run 1 budget, prefer **scope compression over iteration skipping** — reduce the number of per-document analyses if needed, but always perform a full read-back-and-improve Pass 2 on whatever artifacts exist. For scheduled runs treat `analysis_depth` as `standard` in practice even if the input defaults to `deep`; reserve `deep`/`comprehensive` for manual `workflow_dispatch` backfills where a human can monitor for a longer-session environment. A partial analysis with genuine iteration is always strictly better than a broader analysis that never reaches GitHub. | |
| > **AI-FIRST within the compressed budget**: Pass 2 is still mandatory (AI FIRST principle, §"5. 🔴 AI FIRST Quality Principle" in repo custom instructions). Under the tightened ~28-min Run 1 budget, prefer **scope compression over iteration skipping** — reduce the **download/manifest scope** if needed (for example, fewer `dok_id` entries in `data-download-manifest.md`), but maintain **1:1 per-document coverage** for every `dok_id` that remains in the manifest and always perform a full read-back-and-improve Pass 2 on whatever artifacts exist. For scheduled runs treat `analysis_depth` as `standard` in practice even if the input defaults to `deep`; reserve `deep`/`comprehensive` for manual `workflow_dispatch` backfills where a human can monitor for a longer-session environment. A smaller manifest with complete per-document coverage and genuine iteration is always strictly better than a broader manifest that cannot clear the Analysis Gate or never reaches GitHub. |
| | 2–6 | Read all 23 analysis artifacts into context (Families A+B+C+D) | 06 | | ||
| | 6–18 | Article Pass 1 + Pass 2 (EN, SV) | 06 | | ||
| | 18–22 | Visual + link validation | 06 | | ||
| | 22–26 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` — **HARD DEADLINE minute 28** | 07 | |
There was a problem hiding this comment.
Run 2’s staging/PR row is 22–26 but labels a “HARD DEADLINE minute 28”. If minute 28 is the real cutoff (per the safeoutputs session constraint), consider extending the row to 22–28 or changing the hard-deadline label to minute 26 so the table is internally consistent.
| | 22–26 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` — **HARD DEADLINE minute 28** | 07 | | |
| | 22–28 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` — **HARD DEADLINE minute 28** | 07 | |
| | 22–26 | Stage articles, commit, **ONE** `safeoutputs___create_pull_request` — **HARD DEADLINE minute 28** | 07 | | ||
|
|
||
| Trim scope before quality. Never open a second PR within a run — there is no second PR. | ||
| Trim scope before quality. Never open a second PR within a run — there is no second PR. **If you reach minute 25 without staging, stop all remaining analysis/article work, commit whatever exists on disk (include `[early-pr]` in the commit message), and call `create_pull_request` immediately** — a partial-but-delivered PR is infinitely better than losing all work to a `session not found` error. |
There was a problem hiding this comment.
This paragraph instructs to call create_pull_request immediately, but elsewhere the workflow is explicit about safeoutputs___create_pull_request. Using the unqualified name risks the agent calling a non-existent/incorrect tool name. Consider changing this to safeoutputs___create_pull_request for consistency and to prevent tool-selection mistakes under time pressure.
| Trim scope before quality. Never open a second PR within a run — there is no second PR. **If you reach minute 25 without staging, stop all remaining analysis/article work, commit whatever exists on disk (include `[early-pr]` in the commit message), and call `create_pull_request` immediately** — a partial-but-delivered PR is infinitely better than losing all work to a `session not found` error. | |
| Trim scope before quality. Never open a second PR within a run — there is no second PR. **If you reach minute 25 without staging, stop all remaining analysis/article work, commit whatever exists on disk (include `[early-pr]` in the commit message), and call `safeoutputs___create_pull_request` immediately** — a partial-but-delivered PR is infinitely better than losing all work to a `session not found` error. |
| ## Time budget | ||
|
|
||
| **Run 1 — Analysis mode** (no prior analysis found, ~50 min — produces all 23 artifacts): | ||
| > 🔴 **CRITICAL — safeoutputs MCP idle timeout (~30 min)**: The `safeoutputs` MCP server runs a Streamable-HTTP session that expires after **~30–35 minutes of idle time** (confirmed in run [24820030825](https://github.com/Hack23/riksdagsmonitor/actions/runs/24820030825) where all `create_pull_request` calls at minute ~32 failed with `session not found`, losing 37 files of completed analysis work). `sandbox.mcp.keepalive-interval: 300` keeps TCP connections alive but does **NOT** refresh the server-side session. **Your first and only `safeoutputs___*` call MUST happen before minute 28 of agent time.** This is a harder deadline than the ~60-minute Copilot-API token window described in `00-base-contract.md §Session keepalive requirement` and overrides the generic 48-min deadline in `07-commit-and-pr.md §Deadline enforcement` for this workflow. |
There was a problem hiding this comment.
The callout says the first/only safeoutputs___* call MUST happen before minute 28, but the Run 1 schedule allocates 25–28 for staging + PR, which can imply calling at minute 28. To avoid conflicting guidance, either tighten the window (e.g. end at 27) or reword the callout to “by minute 28 at the latest / no later than minute 28”.
| > 🔴 **CRITICAL — safeoutputs MCP idle timeout (~30 min)**: The `safeoutputs` MCP server runs a Streamable-HTTP session that expires after **~30–35 minutes of idle time** (confirmed in run [24820030825](https://github.com/Hack23/riksdagsmonitor/actions/runs/24820030825) where all `create_pull_request` calls at minute ~32 failed with `session not found`, losing 37 files of completed analysis work). `sandbox.mcp.keepalive-interval: 300` keeps TCP connections alive but does **NOT** refresh the server-side session. **Your first and only `safeoutputs___*` call MUST happen before minute 28 of agent time.** This is a harder deadline than the ~60-minute Copilot-API token window described in `00-base-contract.md §Session keepalive requirement` and overrides the generic 48-min deadline in `07-commit-and-pr.md §Deadline enforcement` for this workflow. | |
| > 🔴 **CRITICAL — safeoutputs MCP idle timeout (~30 min)**: The `safeoutputs` MCP server runs a Streamable-HTTP session that expires after **~30–35 minutes of idle time** (confirmed in run [24820030825](https://github.com/Hack23/riksdagsmonitor/actions/runs/24820030825) where all `create_pull_request` calls at minute ~32 failed with `session not found`, losing 37 files of completed analysis work). `sandbox.mcp.keepalive-interval: 300` keeps TCP connections alive but does **NOT** refresh the server-side session. **Your first and only `safeoutputs___*` call MUST happen by minute 28 at the latest.** This is a harder deadline than the ~60-minute Copilot-API token window described in `00-base-contract.md §Session keepalive requirement` and overrides the generic 48-min deadline in `07-commit-and-pr.md §Deadline enforcement` for this workflow. |
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/1637228f-c40b-4690-a6ea-62aaa9b990fe Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Applied all four reviewer suggestions in 5e49385:
|
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
News: Government Propositions(run 24820030825) produced no safe outputs: the agent completed 37 analysis files and committed locally at min 31, then allsafeoutputs___create_pull_requestcalls at min 32 failed withStreamable HTTP error: session not found.Root cause
The safeoutputs MCP uses a Streamable-HTTP session with a ~30–35 min idle timeout (prior PR #1895).
sandbox.mcp.keepalive-interval: 300keeps the TCP connection alive but does not refresh server-side session state. The workflow's Time budget directed the single PR call to min 47–50 — always past the cutoff.Changes (
.github/workflows/news-propositions.mdbody only)safeoutputs___*call MUST happen by minute 28 at the latest, and explicitly overriding the 48-min deadline in07-commit-and-pr.md §Deadline enforcementfor this workflow.[early-pr]tag and call the fully-qualifiedsafeoutputs___create_pull_requestimmediately.dok_identries indata-download-manifest.md) over iteration skipping, while maintaining 1:1 per-document coverage for everydok_idthat remains in the manifest so05-analysis-gate.mdcheck 2 still passes; Pass 2 remains mandatory; scheduled runs behave asanalysis_depth: standardin practice; reservedeep/comprehensivefor manualworkflow_dispatchbackfills.Notes for reviewers
{{#runtime-import .github/workflows/news-propositions.md}}; the lock tracksfrontmatter_hashonly.07-commit-and-pr.md §Core ruleforbids heartbeat/keep-alive PRs post-fix: call safeoutputs___create_pull_request ASAP, never noop when work exists #1768 (create-pull-request.max: 1). This aligns the per-workflow budget with00-base-contract.md §Session keepalive requirement("well before the session approaches expiry") rather than reviving the fix(aw): prevent safeoutputs session timeout in news-committee-reports #1895 pattern.tests/workflow-architecture.test.ts(80 tests) passes; no tests assert on time-budget text.