reproduce-pi-threshold-compaction-stall

Reproduce Pi threshold-compaction idle stall

Metadata

Statusdone
Agent identity02e879681e52e0a384106169be043416c4d946e850ab26b2269c57681b52a6e7
Created2026-08-05T20:52:42.199180862+00:00
Started2026-08-06T05:24:25.293352780+00:00
Completed2026-08-06T06:13:00.165144711+00:00
Tagspi, compaction, regression, research
Tokens16463075 in / 32153 out

Description

Objective

Produce a falsifiable, credential-free reproducer for the specific Pi behavior reported as upstream issue earendil-works/pi#6424: a long agentic turn reaches threshold auto-compaction, compaction succeeds, the compacted context still records unfinished work, no steering/follow-up is queued, and Pi emits agent_settled/exits without taking another concrete turn.

Use the installed @earendil-works/pi-coding-agent version and its real JSON event/session semantics. Distinguish this from overflow compaction (willRetry=true), compaction failure, manual /compact, and the independent bug where an extension queues a follow-up during agent_end. Record exact event ordering and session entries. Prefer a deterministic fake provider or upstream-compatible fixture; no paid credential may be required. Do not implement the fix.

Write docs/research/pi-threshold-compaction-stall-reproducer.md with commands, fixture design, expected/actual event trace, installed version, and the exact red assertion the implementation task should inherit. Any fixture files must live under a uniquely named tests/fixtures/fake-pi-compaction-stall/ path.

Validation

  • A scripted invocation exercises Pi JSON mode and produces compaction_start(reason=threshold), successful compaction_end(willRetry=false), then idle/settled without a subsequent recovery turn.
  • The compacted summary/session evidence contains an explicit unfinished next step, so the test does not infer incompletion from prose such as “continue”.
  • Control cases prove overflow retry continues automatically and manual/failed compaction is not the same condition.
  • The reproducer fails only on the missing post-threshold continuation behavior and requires no network credential.
  • git diff --check passes and all commands/output needed to rerun the reproducer are captured in the report.

Depends on

Required by

Messages 4 messages (4 unread)

  1. #1user2026-08-05T20:53:16.713331553+00:00delivered
    Initial evidence: upstream issue https://github.com/earendil-works/pi/issues/6424 gives the exact threshold-compaction idle case and a local workaround. Installed Pi is 0.83.0. Installed dist/core/agent-session.js lines ~1583-1585 triggers threshold compaction; ~1698 emits compaction_end; ~1707-1709 continues only when agent.hasQueuedMessages(). Capture this exact empty-queue path and distinguish willRetry overflow.
  2. #2reproduce-pi-threshold-compaction-stall2026-08-06T05:51:40.664152570+00:00read
    Done — initial evidence incorporated and the credential-free Pi 0.83.0 reproducer/report are in commit 1f8cea28.
  3. #3reproduce-pi-threshold-compaction-stall2026-08-06T06:06:23.735373318+00:00read
    Completion is reviewed and landed at main 1b2ca643, but my first premature wg done (before submission) cached a deterministic 'missing completion candidate' response for this attempt; later wg done replays it even though graph now has accepted FLIP+eval receipts. Operator repair/retry of the DoneHandoff request is needed.
  4. #4reproduce-pi-threshold-compaction-stall2026-08-06T06:07:52.897282887+00:00sent
    Final delivered state is commit 1b2ca643 on main (reviewed candidate b3:0ee0e70c... accepted and landed).  is still replaying cached request intent:4e5820... from the pre-candidate attempt; no code/review issue remains.

Log