fix(trace): separate Pi cache token accounting and update generated hook configs
Closed
MI
25m ago+446+446+012345678901234567890123456789-34-34-01234567890123456789
Summary
- Separate Pi cache accounting: cache reads and writes are preserved as their own evidence categories, and
total_tokensis recomputed as base input + output, excluding both cache categories. Cost stays authoritative from the session. Invalid or overflowing counters are ignored with deterministic warnings. - Keep the Pi evidence
schema_versionatv1and stop gating the cache-accounting checks on the schema version. - Regenerate the Claude Code and Cursor hook configurations after the missing-CLI guard, so hooks no-op when the chainloop CLI is not on PATH.
- Add the managed Pi extension (
.pi/extensions/chainloop-trace.ts) and teach the OpenCode plugin the OpenCode 2.x tool-result shape.
Refs #3704 (Pi provider support).
Assisted-by: Claude Code