31 Commits
Author SHA1 Message Date
Mario Zechner 466db0fecd feat: add canonical session context boundaries
Make SessionManager projections authoritative for provider requests, add append-only context edits and actionable turn boundaries, and preserve existing queue scheduling during continuation and recovery.
2026-09-21 16:59:20 +02:00
Vegard Stikbakke 46bde88a1c feat(coding-agent): support per-model compaction token budgets
Closes #8133
2026-09-10 08:37:20 +02:00
Ramiz Wachtler aa23e784c6 fix(coding-agent): update repository links to "earendil-works/pi" (#9278)
- update repository links in prompts, docs, and code to use `earendil-works/pi` instead of `earendil-works/pi-mono`
2026-09-07 14:09:39 +02:00
David Brailovsky 56700d42ed fix(coding-agent): compact before post-tool model requests (#8782)
Run next-turn preparation only when the agent loop continues, allowing threshold compaction before the next provider request. Restore interactive progress when the same run resumes.

Closes #6879

Important to notice:
this changes when prepareNextTurn & prepareNextTurnWithContext are invoked:
the now run only when a next turn actually happens, and after shouldStopAfterTurn.
2026-08-28 13:40:59 +02:00
Vegard Stikbakke 8dab70281b Revert "feat(coding-agent): add cache-friendly compaction primitives"
This reverts commit cff1cf52c6.
2026-08-19 09:52:26 +02:00
Vegard Stikbakke cff1cf52c6 feat(coding-agent): add cache-friendly compaction primitives
Add provider-context prefix preparation and optional summary request settings needed by cache-friendly compaction. Existing AgentSession callers continue to pass undefined, so standalone summarization remains the default until the feature is wired in.
2026-08-18 14:52:06 +02:00
Cristina Poncela Cubeiro a6b1dbceb1 fix(extensions): emit compaction failed for extensions (#8241)
* fix(extensions): emit compaction failed

* changelog yeet
2026-08-17 13:10:08 +02:00
Vegard Stikbakke 6d520c58d0 chore(docs): fix ascii alignment in compaction docs 2026-08-12 14:56:26 +02:00
Vegard Stikbakke 31b513e316 chore(docs): change a bullet point in compaction docs 2026-08-10 08:27:35 +02:00
Vegard Stikbakke 4761021709 chore(docs): change 'reloads' phrasing in compaction docs 2026-08-10 08:03:46 +02:00
Vegard Stikbakke 368e013dec chore(docs): fix ascii alignment in compaction docs 2026-08-08 12:22:47 +02:00
xu0o0 786c76cb76 docs(coding-agent): fix branch summary diagram (#7526) 2026-08-03 13:41:03 +02:00
Thomas MustierandArmin Ronacher 241431c69b fix(agent,ai): don't cache write compaction or branch summaries (#6618)
avoid cache writes for compaction and branch summaries

Co-authored-by: Armin Ronacher <armin.ronacher@active-4.com>
2026-07-23 23:03:23 +02:00
Mario Zechner f8b74a4507 fix: complete extension usage accounting
closes #6509
2026-07-20 17:06:22 +02:00
Enrico 5b9b70d29c feat(coding-agent): add compaction reason and willRetry to extension compact events (#5962)
session_before_compact and session_compact now carry
reason ("manual" | "threshold" | "overflow") and willRetry, matching
what the RPC protocol already exposes via auto_compaction_start/end.
Extensions can now distinguish manual /compact from threshold
auto-compaction and overflow recovery through the public API instead
of monkeypatching AgentSession internals.
2026-06-22 10:36:16 +02:00
Mario Zechner 3e5ad67e0f chore: migrate pi packages to earendil works scope 2026-05-07 15:59:42 +02:00
warren e6a302b935 docs(coding-agent): clarify repeated compaction boundary behavior (#2662) 2026-03-29 17:03:56 +02:00
Mario Zechner bcfd5169a2 docs(coding-agent): document tool result truncation in compaction serialization 2026-03-06 16:58:16 +01:00
Mario Zechner 28ab25b07e docs(coding-agent): improve README structure and update session/compaction docs
- README-NEW.md: add Quick Start, Interactive Mode, Sessions sections
- session.md: add Message Types section, complete SessionManager API, fix source links to GitHub URLs
- compaction.md: rename hooks to extensions, fix source links to GitHub URLs
- keybindings.md: new file documenting all keyboard shortcuts
2026-01-26 01:25:15 +01:00
Mario Zechner 027d39aa33 Update custom-compaction example to use serializeConversation
Also fix docs to show convertToLlm is needed first.
2025-12-31 13:24:23 +01:00
Mario Zechner 75269add96 Export serializeConversation and document in compaction.md
Shows how to convert messages to text for custom summarization.
2025-12-31 13:21:55 +01:00
Mario Zechner 57b066f135 Add source file references to compaction.md and clarify session_before_tree behavior 2025-12-31 12:41:53 +01:00
Mario Zechner d103af4ca2 Fix: cumulative file tracking applies to both compaction and branch summarization 2025-12-31 12:38:25 +01:00
Mario Zechner 67af9d707f Clarify that compaction/branch details are hook-customizable 2025-12-31 12:36:28 +01:00
Mario Zechner dfc63a7bac Note settings.json for compaction settings in compaction.md 2025-12-31 12:35:45 +01:00
Mario Zechner 679343de55 Add compaction.md and rewrite hooks.md
- New compaction.md covers auto-compaction and branch summarization
- Explains cut points, split turns, data model, file tracking
- Documents session_before_compact and session_before_tree hooks

- Rewritten hooks.md matches actual API (separate event names)
- Correct ctx.ui.custom() signature (returns handle, not callback)
- Documents all session events including tree events
- Adds sessionManager and modelRegistry usage
- Updates all examples to use correct API
2025-12-31 12:33:13 +01:00
Mario Zechner 3424550d21 Improve documentation: README settings table, philosophy section, custom-tools intro, rpc hook_error event, hooks import aliases 2025-12-17 22:04:28 +01:00
Mario Zechner 989af79752 fix: normalize OpenAI token counting, add branch source tracking
pi-ai:
- Fixed usage.input to exclude cached tokens for OpenAI providers
- Previously input included cached tokens, causing double-counting
- Now input + output + cacheRead + cacheWrite correctly gives total context

coding-agent:
- Session header now includes branchedFrom field for branched sessions
- Updated compaction.md with refined implementation plan
- Updated session.md with branchedFrom documentation
2025-12-03 17:11:22 +01:00
Mario Zechner 1c18b8006f Add auto-compaction trigger flow and maxTokens calculation 2025-12-02 16:17:05 +01:00
Mario Zechner 50b334f88a Add compaction examples and /branch interaction 2025-12-02 16:09:46 +01:00
Mario Zechner 5daef11b4c Add compaction research and implementation plan 2025-12-02 16:00:52 +01:00