From a0cf26b3a38d0b5742462309c8c7361f31bcdc91 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 18:43:51 +0000 Subject: [PATCH 1/2] Initial plan From a7b4377cb9239efc5379934512acc60fdb92d803 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 18:46:48 +0000 Subject: [PATCH 2/2] fix: remove push-wiki batching instructions that cause silent page drops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `push-wiki` safe-output is hard-capped at 1 invocation per run. The previous instructions told the agent to split pages into batches of ≤4 and call `push-wiki` once per batch, causing all batches after the first to be silently rejected with "Too many items of type 'push_wiki'. Maximum allowed: 1." Replace both batching passages (Step 3d constraints and Step 3f procedure) with a single-call pattern: build one JSON object with every page including `_Sidebar.md` and call `push-wiki` exactly once. Fixes #351 Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com> --- workflows/agentic-wiki-writer.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/workflows/agentic-wiki-writer.md b/workflows/agentic-wiki-writer.md index f5d959ce..376b3d54 100644 --- a/workflows/agentic-wiki-writer.md +++ b/workflows/agentic-wiki-writer.md @@ -291,11 +291,8 @@ 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. - **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. For each page that needs regeneration: @@ -315,26 +312,17 @@ 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 JSON objects. **Call `push-wiki` exactly once with all pages in a single `files` object** (including `_Sidebar.md`). Multiple `push-wiki` calls are not allowed — the safe-output is capped at 1 invocation per run, and any additional calls will be rejected, silently dropping all pages in those calls. -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 object. +3. Pass the entire object to `push-wiki` in one call. -A single-batch JSON object looks like: +A complete 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..." }