fix: prevent orphaned tool_use/tool_result after compression with passthrough roles

Backward and forward expansion now skip PI-internal passthrough roles
(compaction, branch_summary, custom_message) when scanning for paired
assistant↔toolResult messages, ensuring atomic removal. Added a
post-compression repair safety net and deep-cloning to prevent content
mutation across context events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Greg Harvell
2026-04-09 20:03:27 -04:00
parent 24cf4e5b80
commit 8681bd833b
5 changed files with 409 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@complexthings/pi-dynamic-context-pruning",
"version": "1.0.5",
"version": "1.0.6",
"description": "PI coding agent extension — Dynamic Context Pruning (DCP)",
"keywords": [
"pi-package",