From d78caf248dd6a8e29c28eedb8f42c81a2162ed7b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:03:23 +0000 Subject: [PATCH 1/5] Initial plan From fd85305cb807b05ce5f01d875a02a6a0662b29e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:06:35 +0000 Subject: [PATCH 2/5] Fix agentic-wiki-writer: single push-wiki call and bare pipe in wiki links Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com> --- workflows/agentic-wiki-writer.md | 33 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/workflows/agentic-wiki-writer.md b/workflows/agentic-wiki-writer.md index e84ce74..2d6a92e 100644 --- a/workflows/agentic-wiki-writer.md +++ b/workflows/agentic-wiki-writer.md @@ -240,11 +240,11 @@ If there is no `source-map.json` (first run), regenerate all pages. **MANDATORY CONSTRAINTS — read carefully before generating any content:** -- **Never generate more than 4 pages per `push-wiki` call.** If there are more than 4 pages to generate, process them in sequential batches of up to 4, calling `push-wiki` once per batch. +- **Send all wiki pages in a single `push-wiki` call.** Do NOT batch across multiple calls — only one `push-wiki` output is allowed per run. - **Never spawn a sub-agent or background agent to generate pages.** Generate all pages directly in the main conversation loop. - **Each page must be kept under 3 KB of markdown.** Keep pages focused and concise. -- **Each `push-wiki` JSON payload must stay under 30 KB total.** If a batch would exceed 30 KB (including the sidebar), split it into a smaller batch. -- **If a `push-wiki` call fails with an API error**, it is likely a timeout caused by a large payload. Retry up to 2 times with progressively smaller batches (halving the batch size each retry, minimum 1 page per call). If a single-page call also fails, the error is unrecoverable — report it and stop. +- **The total `push-wiki` JSON payload must stay under 90 KB.** If the payload would exceed this limit, reduce page content (shorten pages, remove examples) until it fits. +- **If a `push-wiki` call fails with an API error**, it is likely a timeout caused by a large payload. Reduce page content (shorten the longest pages) and retry up to 2 times. If it still fails, the error is unrecoverable — report it and stop. For each page that needs regeneration: @@ -264,26 +264,19 @@ Before finalizing each page, review your generated content against the **Self-Re **Do NOT use sub-agents or background agents for page generation.** Generate all pages directly in the main conversation loop. -Construct wiki page content as strings and pass them to the `push-wiki` safe-output as JSON objects. **Push in batches of at most 4 pages per call** to avoid API timeouts: +Construct wiki page content as strings and pass them to the `push-wiki` safe-output as a **single JSON call containing all pages** (including `_Sidebar.md`). Only one `push-wiki` output is allowed per run — do NOT call `push-wiki` more than once. -1. Divide the full list of pages into batches of up to 4 pages each. -2. For each batch, build a JSON object mapping filenames to markdown content. -3. Include `_Sidebar.md` (generated following the **Sidebar Generation** rules below) **only in the final batch**. -4. Before calling `push-wiki`, estimate the total JSON payload size. **If the payload exceeds 30 KB, reduce the batch size** (use 2 pages per call or fewer) until it fits. -5. Call `push-wiki` once per batch. Proceed to the next batch only after the current call succeeds. -6. **If a `push-wiki` call fails with an API or timeout error**, halve the current batch size (minimum 1 page per call) and retry up to 2 times. API errors during generation are most often caused by large response payloads, not transient network issues. If a single-page call still fails, the error is unrecoverable — report it and stop. +1. Build a single JSON object mapping every filename to its markdown content. +2. Include `_Sidebar.md` (generated following the **Sidebar Generation** rules below) in the same JSON object. +3. Before calling `push-wiki`, estimate the total JSON payload size. **If the payload would exceed 90 KB**, shorten the longest pages (trim examples, reduce prose) until it fits. +4. Call `push-wiki` exactly once with the complete JSON object. +5. **If the `push-wiki` call fails with an API or timeout error**, reduce page content (shorten the longest pages) and retry up to 2 times. If it still fails, the error is unrecoverable — report it and stop. -A single-batch JSON object looks like: +The JSON object looks like: ```json { "Home.md": "Welcome to the project...\n\n## Overview\n...", - "Architecture.md": "## System Design\n..." -} -``` - -The final batch must add the sidebar: -```json -{ + "Architecture.md": "## System Design\n...", "Getting-Started.md": "## Prerequisites\n...", "_Sidebar.md": "- [[Home|Home]]\n- [[Architecture|Architecture]]\n..." } @@ -578,6 +571,8 @@ Determine the correct `OWNER/REPO` and default branch by reading `.git/config` w **Wiki cross-references** — Use wiki link syntax: `[[Page Name]]` or `[[Display Text|Page-Slug#section-slug]]`. +The `|` separator between display text and slug must be a bare pipe — do NOT backslash-escape it (`[[Control Plane\|Control-Plane]]` is wrong; `[[Control Plane|Control-Plane]]` is correct). + Only link to pages and sections that exist in the PAGES.md template. Use plain text for anything else. NEVER use `[[display|https://...]]` — that is NOT valid wiki syntax. Use `[display](https://...)` for external URLs. @@ -600,7 +595,7 @@ Before finalizing each page, check for these issues and fix them: 3. **Heading levels** — No page should start with `#` (H1). Start with content or `##` (H2). -4. **Link format** — Source code links use full GitHub URLs `[text](https://...)`. Wiki cross-references use `[[Page Name]]`. No bare relative paths. No `[[text|https://...]]` syntax. +4. **Link format** — Source code links use full GitHub URLs `[text](https://...)`. Wiki cross-references use `[[Page Name]]` or `[[Display Text|Page-Slug]]` with a bare `|` (never backslash-escaped). No bare relative paths. No `[[text|https://...]]` syntax. 5. **Accuracy** — Content matches what the source code actually does. No fabricated features or APIs. From ed2f6c7623d02c3fe5764e8d25bfd6aa17191f9e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:31:59 +0000 Subject: [PATCH 3/5] Keep batched push-wiki from PR #279, add max:5 config, fix backslash pipe Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com> --- workflows/agentic-wiki-writer.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/workflows/agentic-wiki-writer.md b/workflows/agentic-wiki-writer.md index 2d6a92e..f3cb102 100644 --- a/workflows/agentic-wiki-writer.md +++ b/workflows/agentic-wiki-writer.md @@ -47,6 +47,7 @@ safe-outputs: protected-files: fallback-to-issue jobs: push-wiki: + max: 5 description: > Push generated wiki pages to the repository wiki. Pass a JSON object mapping filenames to markdown content. @@ -240,11 +241,11 @@ If there is no `source-map.json` (first run), regenerate all pages. **MANDATORY CONSTRAINTS — read carefully before generating any content:** -- **Send all wiki pages in a single `push-wiki` call.** Do NOT batch across multiple calls — only one `push-wiki` output is allowed per run. +- **Never generate more than 4 pages per `push-wiki` call.** If there are more than 4 pages to generate, process them in sequential batches of up to 4, calling `push-wiki` once per batch. - **Never spawn a sub-agent or background agent to generate pages.** Generate all pages directly in the main conversation loop. - **Each page must be kept under 3 KB of markdown.** Keep pages focused and concise. -- **The total `push-wiki` JSON payload must stay under 90 KB.** If the payload would exceed this limit, reduce page content (shorten pages, remove examples) until it fits. -- **If a `push-wiki` call fails with an API error**, it is likely a timeout caused by a large payload. Reduce page content (shorten the longest pages) and retry up to 2 times. If it still fails, the error is unrecoverable — report it and stop. +- **Each `push-wiki` JSON payload must stay under 30 KB total.** If a batch would exceed 30 KB (including the sidebar), split it into a smaller batch. +- **If a `push-wiki` call fails with an API error**, it is likely a timeout caused by a large payload. Retry up to 2 times with progressively smaller batches (halving the batch size each retry, minimum 1 page per call). If a single-page call also fails, the error is unrecoverable — report it and stop. For each page that needs regeneration: @@ -264,19 +265,26 @@ Before finalizing each page, review your generated content against the **Self-Re **Do NOT use sub-agents or background agents for page generation.** Generate all pages directly in the main conversation loop. -Construct wiki page content as strings and pass them to the `push-wiki` safe-output as a **single JSON call containing all pages** (including `_Sidebar.md`). Only one `push-wiki` output is allowed per run — do NOT call `push-wiki` more than once. +Construct wiki page content as strings and pass them to the `push-wiki` safe-output as JSON objects. **Push in batches of at most 4 pages per call** to avoid API timeouts: -1. Build a single JSON object mapping every filename to its markdown content. -2. Include `_Sidebar.md` (generated following the **Sidebar Generation** rules below) in the same JSON object. -3. Before calling `push-wiki`, estimate the total JSON payload size. **If the payload would exceed 90 KB**, shorten the longest pages (trim examples, reduce prose) until it fits. -4. Call `push-wiki` exactly once with the complete JSON object. -5. **If the `push-wiki` call fails with an API or timeout error**, reduce page content (shorten the longest pages) and retry up to 2 times. If it still fails, the error is unrecoverable — report it and stop. +1. Divide the full list of pages into batches of up to 4 pages each. +2. For each batch, build a JSON object mapping filenames to markdown content. +3. Include `_Sidebar.md` (generated following the **Sidebar Generation** rules below) **only in the final batch**. +4. Before calling `push-wiki`, estimate the total JSON payload size. **If the payload exceeds 30 KB, reduce the batch size** (use 2 pages per call or fewer) until it fits. +5. Call `push-wiki` once per batch. Proceed to the next batch only after the current call succeeds. +6. **If a `push-wiki` call fails with an API or timeout error**, halve the current batch size (minimum 1 page per call) and retry up to 2 times. API errors during generation are most often caused by large response payloads, not transient network issues. If a single-page call still fails, the error is unrecoverable — report it and stop. -The JSON object looks like: +A single-batch JSON object looks like: ```json { "Home.md": "Welcome to the project...\n\n## Overview\n...", - "Architecture.md": "## System Design\n...", + "Architecture.md": "## System Design\n..." +} +``` + +The final batch must add the sidebar: +```json +{ "Getting-Started.md": "## Prerequisites\n...", "_Sidebar.md": "- [[Home|Home]]\n- [[Architecture|Architecture]]\n..." } From 14fe29a8b16a76f66856bc1c4f2b503483aff214 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:07:23 +0000 Subject: [PATCH 4/5] Increase push-wiki max from 5 to 10 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com> --- workflows/agentic-wiki-writer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/agentic-wiki-writer.md b/workflows/agentic-wiki-writer.md index f3cb102..7496760 100644 --- a/workflows/agentic-wiki-writer.md +++ b/workflows/agentic-wiki-writer.md @@ -47,7 +47,7 @@ safe-outputs: protected-files: fallback-to-issue jobs: push-wiki: - max: 5 + max: 10 description: > Push generated wiki pages to the repository wiki. Pass a JSON object mapping filenames to markdown content. From 55c0787717f0162376cda6a654a8e6cf47d08db6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:15:50 +0000 Subject: [PATCH 5/5] Fix CI: remove invalid max property from custom push-wiki job Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com> --- workflows/agentic-wiki-writer.md | 1 - 1 file changed, 1 deletion(-) diff --git a/workflows/agentic-wiki-writer.md b/workflows/agentic-wiki-writer.md index 7496760..2cd132d 100644 --- a/workflows/agentic-wiki-writer.md +++ b/workflows/agentic-wiki-writer.md @@ -47,7 +47,6 @@ safe-outputs: protected-files: fallback-to-issue jobs: push-wiki: - max: 10 description: > Push generated wiki pages to the repository wiki. Pass a JSON object mapping filenames to markdown content.