Files
ai-agent/runner/package.json
Gabriel VidalandClaude Opus 5.5 53a3d1c5a5 feat(runner): pi 1.6.0 — compact inside a run, show it, continue a cut-off reply
A long local run (Inkling, 01a20cee) grew to 127k of 131k tokens and
stopped: pi 0.80.6 checks auto-compaction only once a run is over, so one
prompt with hundreds of tool calls never compacted. Near the full window
pi capped the reply at 1 token, it stopped at 'length' (not an overflow
error, so no compact-and-retry), pi compacted after the run and ended.

- pi 0.80.6 -> 1.6.0: it checks the threshold (contextWindow -
  compaction.reserveTokens, 75 % here) before every request in a run.
- Each compaction is mirrored as Claude Code's compact_boundary +
  isCompactSummary records: the viewer's auto-compacted divider.
- Safety net: a run whose last reply stopped at 'length' and was then
  compacted is resumed with a continue prompt (RUNNER_AUTO_CONTINUES,
  default 2); turn_end only after the last pi settles.
- Tests: runner/test/cli.test.mjs (fake pi), backend/test_pi_compaction.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:28:16 +01:00

12 lines
383 B
JSON

{
"name": "ai-agent-pi-runner",
"version": "0.1.0",
"private": true,
"type": "module",
"description": "pi-harness session runner for the ai-agent viewer: wraps `pi --mode json` and writes a Claude-Code-schema transcript the viewer already knows how to parse.",
"bin": { "pi-runner": "./cli.mjs" },
"dependencies": {
"@earendil-works/pi-coding-agent": "1.6.0"
}
}