You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: workflows/agentic-wiki-writer.md
+6-18Lines changed: 6 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,11 +291,8 @@ If there is no `source-map.json` (first run), regenerate all pages.
291
291
292
292
**MANDATORY CONSTRAINTS — read carefully before generating any content:**
293
293
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.
295
294
-**Never spawn a sub-agent or background agent to generate pages.** Generate all pages directly in the main conversation loop.
296
295
-**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.
299
296
300
297
For each page that needs regeneration:
301
298
@@ -315,26 +312,17 @@ Before finalizing each page, review your generated content against the **Self-Re
315
312
316
313
**Do NOT use sub-agents or background agents for page generation.** Generate all pages directly in the main conversation loop.
317
314
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.
319
316
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.
326
320
327
-
A single-batch JSON object looks like:
321
+
A complete JSON object looks like:
328
322
```json
329
323
{
330
324
"Home.md": "Welcome to the project...\n\n## Overview\n...",
0 commit comments