Skip to content

Proposal: differentiate as the local / small-context / unreliable-endpoint auto-compactor #3

Description

@lkraider

Summary

capyup and aashishd/pi-auto-compact-plugin currently overlap heavily, and aashishd has taken the "clean, native-only, heavily-tested, pinned-to-pi" lane. Rather than converge on feature parity, capyup could own the lane aashishd deliberately does not serve — which is exactly where #2 (Qwen3-122b / LM Studio) and #1 (flaky endpoint) live.

Thesis

Be the auto-compactor for small-window, local, and unreliable models, where pi's native overflow recovery is insufficient and a smarter emergency path is genuinely needed.

Concrete direction

  1. Compaction that can't overflow itself. The core fix for Inconsistent and errors frequently #2 / Error: Compaction failed: Turn prefix summarization failed: Connection error. #1: hierarchical / chunked summarization so the summarization request is guaranteed to fit the window even when the live context has already blown past it. This is the biggest differentiator — native-only compactors assume the summarization call fits; on a 32–40K local window it often doesn't.

  2. Provider-agnostic, calibrated token accounting. Don't trust a single chars/4 estimate. Prefer model-reported usage when present; fall back to a per-provider calibrated estimator. Small models and non-OpenAI endpoints are exactly where one estimate drifts and overflows.

  3. Endpoint resilience. Retry / backoff + circuit-breaker on the summarization call (Error: Compaction failed: Turn prefix summarization failed: Connection error. #1 was a connection error). Add a last-resort lossless local truncation that keeps tool-call / tool-result pairs intact when the summarizer is unreachable, so the run survives.

  4. Keep aggressive multi-point triggering (pre-turn / mid-turn / emergency) — it's the right instinct for tiny windows that overflow fast — but make the emergency path non-destructive-by-default and pair-safe.

  5. Adopt deliverAs: "followUp" for the post-compaction resume and retire the setImmediate + isIdle() race heuristic.

Positioning

"aashishd for frontier / subscription models with large windows; capyup for local / self-hosted / small-window / unreliable setups." That's a defensible niche with an underserved user base (LM Studio / Ollama / vLLM) rather than a feature-parity race.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions