Artifact cb7fa3b4edd8c6ab2cbdc03bb09ec1d3bc9dfaea69e7c169fa122ecfe4dd63c5:
- File
src/compact.c
-
2026-11-19 02:30:01
— part of check-in
[5453014491]
on branch compaction
— Compact long conversations with Pi's algorithm, for any model
Before each reply pic estimates the context as Pi does (the last reply's usage plus chars/4 for what followed) and past the model's window minus 16384 tokens it summarizes the history beyond the newest 20000 tokens, cutting only where a call is not separated from its result and handling a split turn as Pi does. The summary requests use Pi's prompts and serialization, are journaled as generations of their own and retried like replies; the summary, read and modified files, the first kept entry and the tokens before commit together. Requests then send the summary, the kept entries (rebuilt without thinking when older than the compaction) and what followed. Instruction updates that were summarized go out again. A context overflow compacts once and retries; pic compact asks for one before the next request; --context-window overrides the window. Schema 6. (user: dmestas, size: 18814) [annotate] [blame] [check-ins using]
- 2026-11-19 02:45:17 — part of check-in [ce00efcddd] on branch trunk — CI green on 54530144915b; Fil-C pass (user: dmestas, size: 18814) [annotate] [blame] [check-ins using]
-
2026-11-19 02:30:01
— part of check-in
[5453014491]
on branch compaction
— Compact long conversations with Pi's algorithm, for any model