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
Copy file name to clipboardExpand all lines: workflows/agentic-wiki-writer.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,7 @@ safe-outputs:
47
47
protected-files: fallback-to-issue
48
48
jobs:
49
49
push-wiki:
50
+
max: 5
50
51
description: >
51
52
Push generated wiki pages to the repository wiki.
52
53
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.
240
241
241
242
**MANDATORY CONSTRAINTS — read carefully before generating any content:**
242
243
243
-
-**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.
244
+
-**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.
244
245
-**Never spawn a sub-agent or background agent to generate pages.** Generate all pages directly in the main conversation loop.
245
246
-**Each page must be kept under 3 KB of markdown.** Keep pages focused and concise.
246
-
-**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.
247
-
-**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.
247
+
-**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.
248
+
-**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.
248
249
249
250
For each page that needs regeneration:
250
251
@@ -264,19 +265,26 @@ Before finalizing each page, review your generated content against the **Self-Re
264
265
265
266
**Do NOT use sub-agents or background agents for page generation.** Generate all pages directly in the main conversation loop.
266
267
267
-
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.
268
+
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:
268
269
269
-
1. Build a single JSON object mapping every filename to its markdown content.
270
-
2. Include `_Sidebar.md` (generated following the **Sidebar Generation** rules below) in the same JSON object.
271
-
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.
272
-
4. Call `push-wiki` exactly once with the complete JSON object.
273
-
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.
270
+
1. Divide the full list of pages into batches of up to 4 pages each.
271
+
2. For each batch, build a JSON object mapping filenames to markdown content.
272
+
3. Include `_Sidebar.md` (generated following the **Sidebar Generation** rules below) **only in the final batch**.
273
+
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.
274
+
5. Call `push-wiki` once per batch. Proceed to the next batch only after the current call succeeds.
275
+
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.
274
276
275
-
The JSON object looks like:
277
+
A single-batch JSON object looks like:
276
278
```json
277
279
{
278
280
"Home.md": "Welcome to the project...\n\n## Overview\n...",
0 commit comments