Skip to content

Commit a7b4377

Browse files
Copilotdsyme
andauthored
fix: remove push-wiki batching instructions that cause silent page drops
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>
1 parent a0cf26b commit a7b4377

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

workflows/agentic-wiki-writer.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,8 @@ If there is no `source-map.json` (first run), regenerate all pages.
291291

292292
**MANDATORY CONSTRAINTS — read carefully before generating any content:**
293293

294-
- **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.
295294
- **Never spawn a sub-agent or background agent to generate pages.** Generate all pages directly in the main conversation loop.
296295
- **Each page must be kept under 3 KB of markdown.** Keep pages focused and concise.
297-
- **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.
298-
- **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.
299296

300297
For each page that needs regeneration:
301298

@@ -315,26 +312,17 @@ Before finalizing each page, review your generated content against the **Self-Re
315312

316313
**Do NOT use sub-agents or background agents for page generation.** Generate all pages directly in the main conversation loop.
317314

318-
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:
315+
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.
319316

320-
1. Divide the full list of pages into batches of up to 4 pages each.
321-
2. For each batch, build a JSON object mapping filenames to markdown content.
322-
3. Include `_Sidebar.md` (generated following the **Sidebar Generation** rules below) **only in the final batch**.
323-
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.
324-
5. Call `push-wiki` once per batch. Proceed to the next batch only after the current call succeeds.
325-
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.
317+
1. Build a single JSON object mapping every filename to its markdown content.
318+
2. Include `_Sidebar.md` (generated following the **Sidebar Generation** rules below) in the same object.
319+
3. Pass the entire object to `push-wiki` in one call.
326320

327-
A single-batch JSON object looks like:
321+
A complete JSON object looks like:
328322
```json
329323
{
330324
"Home.md": "Welcome to the project...\n\n## Overview\n...",
331-
"Architecture.md": "## System Design\n..."
332-
}
333-
```
334-
335-
The final batch must add the sidebar:
336-
```json
337-
{
325+
"Architecture.md": "## System Design\n...",
338326
"Getting-Started.md": "## Prerequisites\n...",
339327
"_Sidebar.md": "- [[Home|Home]]\n- [[Architecture|Architecture]]\n..."
340328
}

0 commit comments

Comments
 (0)