Skip to content

v1.1.2

Choose a tag to compare

@AlexJoaquimPereira AlexJoaquimPereira released this 14 Oct 17:01
· 119 commits to master since this release

OpenCode Cache Engine v1.1.2

This release completes P2-T3: it proves — offline, on the serialized provider request — that the experimental date-line relocation (stabilizeDate, added in v1.1.1) actually reaches the wire, and it ships the harness tooling and evidence to keep that verifiable. It is a verification/tooling release: no runtime behavior changes and stabilizeDate remains off by default.

Changes

• New offline wire verifier (verify-date-relocation.mjs) that compares an off/on capture pair on the serialized system content.
• New harness option OC_CAPTURE_ENGINE_CONFIG (inject an inline CacheEngine config into the sandbox) and a hermetic date-relocation suite wired into npm run test:harness.
• New research finding RF-OC-036: a V2 context-hook mutation of a system text part reaches the serialized request (closing the hook→wire gap flagged for system).

Wire evidence (gate G3) — offline, no provider calls

Harness run per model: baseline (transform off) vs candidate (stabilizeDate: true), then compared with verify-date-relocation.mjs. Lengths/offsets are on the temp-root-normalized text.

model off → on date offset (open–close) Δlen
GLM-5.3 7534 → 7535 6891 → 7267 6996–7289 → 6967–7260 +1
MiMo-V2.6 7538 → 7539 6895 → 7271 7000–7293 → 6971–7264 +1
neutral (control) 7526 → 7526 6883 → 6883 unchanged 0

Checks that must all hold: exactly one anchored date line and one pair; the off date is before , the on date is after ; the date value is unchanged; and — order-sensitively — the text with only the date line's bytes removed is identical apart from at most one separator newline. The date line genuinely moves past the block in the serialized request for GLM/MiMo, while a neutral model is unchanged.

Detailed Changes

• Harness (test/harness/capture/): OC_CAPTURE_ENGINE_CONFIG= writes an inline CacheEngine config to the sandbox ~/.config/opencode/cache-engine.json (invalid JSON is a blocker; it warns if set under a debug path). The verifier reports the compared req-*.json, byte lengths, and date/ offsets.
• Tests: date-relocation.test.sh (hermetic; exit-contract checks for correct relocation, no-relocation, changed value, duplicate date, capture/ subdir layout, multi-file selection, and the temp-root-normalized control) joins npm run test:harness.
• Docs: AGENTS.md documents npm run test:harness and current Phase-2 status; README.md lists the new coverage; the implementation plan's status reflects Phase 2 progress; RF-OC-036 recorded.

Compatibility

• No runtime change: exports are unchanged and the stabilizeDate policy is still default off; enabling it changes only the date-line position for GLM-5.3 / MiMo-V2.6.

Testing

• npm test 368/0; npm run test:harness — all four suites pass (exit-contract, retention, port-parity, date-relocation). package-lock.json untouched.

Limitations / evidence boundary

• G3 is structural (serialized-request) evidence for the tested shim route; provider cache benefit remains unmeasured. Neutral/transform-off is unchanged. Matched sessions and provider-reported metrics are future work (P2-T4, which needs provider-access authorization; P2-T5 then decides promote / keep experimental / reject).

Full Changelog: v1.1.1...v1.1.2


Thank you to everyone for using the plugin and helping make this project successful!


Provider-aware prompt-cache optimization and observability for OpenCode.

opencode-cache-engine is an OpenCode npm plugin that exposes three targets required by OpenCode's installed plugin model:

  • ./server — the V1 CacheEngine runtime, hooks, provider policies, and telemetry (verified on OpenCode 1.x).
  • ./tui — plugin-manager registration and enable/disable integration; it
    has no CacheEngine-specific UI.
  • ./v2 — the OpenCode V2 adapter (preview): implemented and offline-tested; isolated shim-based loading, setup, and hook registration/dispatch are verified in an isolated OpenCode 2.0.26 runtime, but managed-config discovery/registration remain unverified.

CacheEngine is an OpenCode plugin designed for long-running agent sessions where prompt-cache efficiency affects both latency and cost. It keeps the harness conservative for providers whose cache behavior is already automatic, while applying provider-specific optimizations where the provider exposes useful cache controls or where prompt structure can be safely improved.

The plugin currently has eleven cache-policy families: DeepSeek, GPT-5.6+, GLM-5.3+, MiMo V2.6+, Kimi, Claude, Gemini, Qwen, Grok, Muse, MiniMax

Initial models were personally chosen for their performance in max programming task completed per dollar. More models can be added based on newer releases or updates.

Future releases will be based on newer versions of models from the above providers, as well as any model that performs optimally over the Pareto distribution on OpenRouter as well as on personal discretion. Since cache stability policy doesn't change much for the providers, there's no need for a code rebase.

Installation

V1 (stable):

opencode plugin opencode-cache-engine          # TUI/CLI installer

or set config:

"plugin": ["opencode-cache-engine"]

V2 (preview):

opencode plugin add opencode-cache-engine      # TUI/CLI installer

or set config:

"plugins": ["opencode-cache-engine"]

Both install the package by name, and each runtime selects the interface it supports from the package's ./server export (V1 → server, V2 → setup). Do not pass opencode-cache-engine/v2 as the package specifier; use the bare name.

Best complemented with agents for the particular models configured at AlexJoaquimPereira/opencode-agent-config