You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCode runtime drops reasoning tokens from output and cached tokens from context size #4824
_accumulate_usage in docker/base-image/agent_server/services/opencode_runtime.py assumes tokens.reasoning is a subset of tokens.output and tokens.cache.read a subset of tokens.input. In the pinned OpenCode 1.18.32, getUsage (packages/opencode/src/session/session.ts) emits disjoint buckets: input is the input count minus cache reads and writes, and output is the output count minus reasoning.
So thinking-model turns record fewer output tokens than they used, and a turn served mostly from the prompt cache reports a much smaller context than it occupies. For example, a step with input: 0, cache: {read: 900, write: 150} does not update the context size at all. Native cost is not affected.
This was found by reading the OpenCode and runtime code, not from a live run.
Activity