taskplane 0.22.5 → 0.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2555,7 +2555,22 @@ export default function (pi: ExtensionAPI) {
2555
2555
  reviewContent, statusPath, num, reviewType, stepNum, state.reviewCounter,
2556
2556
  );
2557
2557
 
2558
- // Set reviewer to idle (NOT clear persistent session stays alive)
2558
+ // After code review: kill the persistent reviewer to free context.
2559
+ // The reviewer persists through a plan+code pair for one step,
2560
+ // then gets a fresh session for the next step.
2561
+ if (reviewType === "code") {
2562
+ console.error(`[task-runner] code review complete for step ${stepNum} — killing reviewer for fresh context on next step`);
2563
+ logExecution(statusPath, `Reviewer R${num}`,
2564
+ `code review complete — killing persistent reviewer (step ${stepNum} cycle done)`);
2565
+ if (state.persistentReviewerKill) {
2566
+ try { state.persistentReviewerKill(); } catch {}
2567
+ }
2568
+ state.persistentReviewerSession = null;
2569
+ state.persistentReviewerKill = null;
2570
+ state.persistentReviewerSignalNum = 0;
2571
+ state.reviewerRespawnCount = 0;
2572
+ }
2573
+
2559
2574
  state.reviewerStatus = "idle";
2560
2575
  state.reviewerType = "";
2561
2576
  state.reviewerStep = 0;
@@ -2643,6 +2658,9 @@ export default function (pi: ExtensionAPI) {
2643
2658
  fallbackContent, statusPath, num, reviewType, stepNum, state.reviewCounter, "fallback",
2644
2659
  );
2645
2660
 
2661
+ // Reset respawn counter on successful fallback review
2662
+ state.reviewerRespawnCount = 0;
2663
+
2646
2664
  clearReviewerState();
2647
2665
  writeLaneState(state);
2648
2666
  updateWidgets();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskplane",
3
- "version": "0.22.5",
3
+ "version": "0.22.6",
4
4
  "description": "AI agent orchestration for pi — parallel task execution with checkpoint discipline",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -289,33 +289,35 @@ checkpoints protect against regressions even when intermediate steps use targete
289
289
  2. The merge agent (before merging to the orchestrator branch)
290
290
  3. CI (before merging to main)
291
291
 
292
- ## File Reading Strategy (Context Budget)
292
+ ## File Reading Strategy (Context Budget) — CRITICAL
293
293
 
294
- Your context window is finite. Reading large files whole wastes budget and risks
295
- triggering the context-pressure safety net (85% wrap-up, 95% → kill).
296
- Use targeted reads instead:
294
+ Your context window is finite. **Reading large files without offset/limit is the
295
+ #1 cause of context exhaustion** one full read of a 3000-line file consumes
296
+ ~5% of a 1M context window. Three such reads = 15% gone before you've done
297
+ anything.
298
+
299
+ ### HARD RULES
300
+
301
+ 1. **NEVER read a file > 500 lines without offset/limit.** Always grep first.
302
+ 2. **NEVER read the same file twice in full.** Re-read only the changed region.
303
+ 3. **ALWAYS check file size before reading:** `wc -l <file>` or `ls -la <file>`
297
304
 
298
305
  ### Pattern: grep-first, read-with-offset
299
306
 
300
- 1. **Locate** the relevant section with `grep` or `find`:
301
- ```
302
- grep -n "function buildPrompt" extensions/task-runner.ts
303
- ```
304
- 2. **Read** just that region with `offset` and `limit`:
305
- ```
306
- read extensions/task-runner.ts (offset: 1773, limit: 50)
307
- ```
308
- 3. **Edit** surgically with exact `oldText → newText`
307
+ 1. **Check size:** `wc -l extensions/task-runner.ts` 4100 lines (DO NOT read fully)
308
+ 2. **Locate** the relevant section: `grep -n "function buildPrompt" extensions/task-runner.ts`
309
+ 3. **Read** just that region: `read extensions/task-runner.ts (offset: 1773, limit: 50)`
310
+ 4. **Edit** surgically with exact `oldText → newText`
309
311
 
310
312
  ### When to read a full file
311
313
 
312
314
  - Files under ~500 lines — read the whole thing, it's fine
313
- - Config files, test files, templates — usually small enough to read fully
315
+ - Config files, small test files, templates — usually small enough
314
316
  - New files you're creating — read after writing to verify
315
317
 
316
318
  ### When NOT to read a full file
317
319
 
318
- - Source files over ~1000 lines — grep first, read the relevant region
320
+ - Source files over ~500 lines — grep first, read with offset/limit
319
321
  - Generated files, lock files, large data files — almost never need full reads
320
322
  - Files you've already read this session — re-read only the changed region
321
323