fix: mcp-client json resilience, monthly-review step docs, month-ahead REQUIRED_TOOLS conditional annotation#443
Merged
pethers merged 2 commits intonews-generation/weekly-review-2026-02-22-25732d3df5a3d00ffrom Feb 22, 2026
Conversation
…ahead REQUIRED_TOOLS comment + regen indexes Co-authored-by: pethers <[email protected]>
Copilot
AI
changed the title
[WIP] Automate weekly review for parliamentary activity
fix: mcp-client json resilience, monthly-review step docs, month-ahead REQUIRED_TOOLS conditional annotation
Feb 22, 2026
b98f709
into
news-generation/weekly-review-2026-02-22-25732d3df5a3d00f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three code-quality issues from review thread 3838367404 plus stale generated files from a concurrent article merge.
Code fixes
mcp-client.ts—performPost().json()non-JSON resilienceJSON.parse(responseBody)was called unconditionally on non-2xx responses. If the server returns HTML/plain-text (e.g. rate-limit page), callers got an opaqueSyntaxError. Now wrapped in try/catch with a structured error including status code and body snippet:monthly-review.ts— fix JSDoc step orderHeader comment described the 5-step pipeline with steps 2 (
get_dokument_innehall) and 3 (search_anforanden) swapped relative to the implementation. Updated to match actual execution: Step 2 = typed metadata fetchers, Step 3 =get_dokument_innehall, Step 4 =search_anforanden.month-ahead.ts— documentsearch_dokumentas conditional inREQUIRED_TOOLSREQUIRED_TOOLSlistedsearch_dokumentunconditionally, but it is only invoked whenget_calendar_eventsreturns empty. Added inline comment and JSDoc note to prevent false validation failures on calendar-populated runs.Generated file sync
Regenerated
data/news-articles.json, all 14news/index*.htmlfiles, andsitemap.xmlto reflect articles on this branch after a concurrent article merge to the base affected those files.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.