Community · E2 · artifact verified

Prune stale coding-agent tool history

A Pi extension uses Jev to decide which old tool calls and results still matter while keeping conversation text verbatim.

01 · Role in the system

What Jev does here

For each eligible tool call, Jev estimates whether the call and its result should remain in context. Code turns those probabilities into monotonic keep, truncate-result, or drop-call decisions, pins recent messages, records an append-only ledger, and falls back to Pi's built-in summary compaction when pruning is insufficient.

Context management as reversible, judgment-guided filtering

Long agent sessions drown in their own tool output, and the usual fix — asking a model to summarize the history — replaces verbatim facts with a lossy narrative. This extension takes the opposite path: conversation text is never touched, and Jev only estimates, per old tool call, whether the call and its result still belong in context. Code converts those probabilities into monotonic decisions: keep, truncate the result, or drop the call.

Monotonicity is the load-bearing property. A judgment can only move a message further out, never back in, so the context window evolves predictably and the append-only ledger records every pruning decision. If pruning is not enough, the extension falls back to the host framework's own summary compaction — the lossy path exists, but it is the last resort, not the default.

The honest edges of a plumbing layer

The limitations are refreshingly concrete. Pairing depends on stable host identifiers, so framework changes can break it; truncated results can orphan attached images; and a keep-probability is an estimate, not a semantic proof that the content will never be needed. None of these are hidden behind an interface — they are the actual risks of running judgment-guided context eviction in production.

What the record demonstrates for the broader index is a third category of agent memory work: not writing summaries, not building durable memory, but deciding what may be forgotten. That is a classification task with a small, checkable output space — the shape Jev judgments fit best.

02 · Control boundary

Where Jev sits

Compact tool-history state to paired Noul judgments; code preserves order and applies reversible context filtering.

Code owns the loop, permissions, thresholds, validation, and side effects. Jev owns only the bounded judgments described above.

03 · Known limits

What this evidence does not prove

  • Tool-call pairing depends on stable Pi identifiers and truncated results can lose attached images.
  • Model judgments are not semantic proofs, and the extension does not create summaries or durable memory.

04 · Attribution

Public sources

This is a Community record: the project was published by a third-party community author.