Skip to content

feat: add Pi-native context compaction - #12

Draft
sambitcreate wants to merge 1 commit into
features-jul30from
feature-compaction
Draft

feat: add Pi-native context compaction#12
sambitcreate wants to merge 1 commit into
features-jul30from
feature-compaction

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

Summary

  • adopt Pi 0.80.10 native semantic compaction for primary chats and child agents
  • persist private append-only Pi JSONL journals and reconstruct context from native checkpoints plus retained tails
  • compact proactively near the model limit and compact/retry exactly once after context overflow
  • keep the existing deterministic context transform as the emergency payload-safety layer
  • expose bounded compaction activity, disclose local compaction history during onboarding, and delete journals with chats

Pi parity

The implementation delegates cut points, structured summary prompting, repeated-summary updates, split-turn handling, tool-pair safety, token estimates, and retained-tail reconstruction to the pinned Pi core package. Both Agent paths install Pi's harness message converter so native compactionSummary checkpoints reach subsequent provider requests.

Verification

  • npm test — 1,185 JavaScript tests, 33 native worktree-remover tests, and 41 Rust broker tests passed
  • npm run type-check
  • npm run lint
  • npm run build
  • focused compaction, child-agent continuation, timeline, onboarding, and message-rehydration suites
  • git diff --check

Base

This is intentionally stacked on features-jul30; that branch contains the current subagent runtime that receives the matching child-agent compaction path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant