ZCode stores the AI SDK's counts: input includes cache reads and
writes. The session summary already took the cache out, but ocCall
passed ZCode's calls to the ledger as they were, so the Requests page,
which adds the cache to input for its hit rate, counted it twice
(the reporter's 275 calls: 49.2% instead of 96.9%).
ocCall subtracts cache read and write from input for agent "zcode";
callCacheVersion goes to calls-v12 so cached calls are parsed again.
Test: TestZCodeCallInputLeavesOutCache, with the reporter's rows; it
checks each call's tokens, the 96.9% rate, and that the session's
input equals its calls'. Fails on the old code. Ran: go test -tags
nogui ./internal/sessions/ (ok), go vet darwin/linux/windows, gofmt -l.
OpenCode rows read from its own data (opencode.db or storage/) had 请求模型 and 推理强度 as —. OpenCode keeps both on each reply (packages/schema/src/v1/session.ts, AssistantMessage): variant, the effort picked in its model menu for the prompt (high, max, low, xhigh, none, thinking … as the provider's variants name them; prompt.ts copies lastUser.model.variant onto every reply), and modelID, the model the reply was sent to. OpenCode 2 (session_message) keeps the variant in model.variant (Model.Ref). It records no model the response named, so modelID is what was asked for, as a Codex rollout's model is.
Now a call's Effort is the reply's variant ("default" or none is no effort picked); a compaction in OpenCode 2 takes the effort last replied with, as it takes the model. In the ledger an OpenCode call is told as a Codex one: requested = its model, served left empty rather than claimed. The call cache moves to calls-v5 so calls read before carry the effort.
TestOpenCodeCallsJSON/DB/V2 (fixtures with variant high, default, xhigh and none) and TestOpenCodeSessionCallIsWhatItAskedFor fail on the old code and pass. go vet ./internal/..., builds (nogui, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried against a real OpenCode database with variants (this machine's OpenCode data predates them).