Repository navigation
v0.1.1
Two plugins for opencode: a server-side pruner that replaces lossy compaction with per-call decisions, and a TUI sidebar widget reporting tokens saved.
Strategy adapted from fast-jev-compaction (MIT) — see NOTICE.
Highlights
- Asks Jev, per tool call, whether the call and whether its full output still need to be in context, then keeps, truncates, or drops. Everything else stays verbatim.
- Runs before every model request and stays dormant below
JEV_COMPACTION_THRESHOLD. - Never throws. A missing key, timeout, or malformed answer leaves the messages untouched.
- Hard daily request ceiling (default 200/day).
- Every decision is auditable:
JEV_DEBUG=1logs each score and action.
Fixed since the first cut
- Small tool results are now shown to Jev in full instead of as
ok, N chars (omitted). Hiding them meant Jev judged the value of content it could not see, and reasonably guessed "cheap to re-read" even for a short file of hard constraints. Replaying the same case through the plugin, a needed call scored 0.43 and was deleted; with the content visible it scores 0.72 and is kept. A stale build log stays low (0.25) either way. - Default keep threshold lowered from 0.5 to 0.35. A call below it is deleted outright, and 0.4–0.5 calls are ambiguous, so keeping and truncating is the safer side of that line.
- Parts are held by reference when applying decisions, so dropping one can no longer shift another in the same message.
- The daily ceiling is reserved before requests are fired, so concurrent batches cannot overshoot it.
JEV_PRESERVE_RECENTis clamped to a minimum of 1.
Install
opencode plugin opencode-jev-compaction --globalRequires a TypeSafe API key via TYPESAFE_API_KEY, or JEV_KEYCHAIN_SERVICE / JEV_KEYCHAIN_ACCOUNT to read it from the macOS Keychain.
Note on installing from GitHub
Installing via a github: spec works for the server half but not the TUI half: those installs land in a directory whose name contains a colon (github:owner/repo), and the TUI's module loading fails silently on that path. Use the npm package for both, or add the TUI widget as a local file.