Resolves#27 (part of #26). Findings from opencode.ai/docs (fetched
2026-09-03) plus a fresh clone of anomalyco/opencode @ b578b72
(v1.18.27):
- No percentage-threshold config key exists; compaction.{auto,prune,
reserved,tail_turns,preserve_recent_tokens} is the full global
config surface (opencode.json top-level, not per-provider/model).
- Trigger is usedTokens >= context - reservedBuffer, not a hardcoded
75%/95% cutoff — contradicts an unverified claim in a closed
GitHub feature request (#11314).
- Reasoning tokens (Qwen3's reasoning_content) are counted via the
provider's usage.total_tokens in the normal path, but excluded
from the fallback sum if a provider ever omits total_tokens.
- No per-model/per-agent threshold override exists (confirmed by
several closed-not-planned feature requests); the only per-model
lever is each model's own limit.context/limit.output.
- Mechanism is provider-agnostic: applies identically to a hand-
declared @ai-sdk/openai-compatible provider (this repo's llamacpp
setup) as to hosted providers, provided limit.context is set.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FCAUsjGNSoJTtK8hyLKg5m