diff --git a/docs/notes/chat-usage-metrics.md b/docs/notes/chat-usage-metrics.md new file mode 100644 index 00000000..ce0d6484 --- /dev/null +++ b/docs/notes/chat-usage-metrics.md @@ -0,0 +1,30 @@ +# Reported chat metrics — 2026-10-21 + +The chat header displays output tokens/sec, reported token totals, last measured +prompt/context usage and model context limit, and harness-reported USD cost. +Missing data remains unavailable; reported zeros remain zero. No text-length +tokenizer, default context limit, subscription-price guess, or local billing +estimate is used. Session snapshots replace previous values and never admit or +complete queued work or create transcript messages. + +OpenCode V2 counters use mutually exclusive native input/output/reasoning/cache +components. Context and rate come from a bounded recent matching-model assistant +read, so an in-flight message with no usage does not erase the latest known +measurement. A compaction boundary prevents reviving pre-compaction prompt usage. +Request-to-stream timing includes request latency and excludes tool settlement. +Codex's native totals/context snapshots are used directly without double-counting +cached-input or reasoning-output subsets; rate and cost remain unknown where the +native protocol provides no compatible measurements. + +Full Go race/build/vet checks and web regressions passed. Browser fixtures cover +390/420/1100px and a short viewport, known/partial/unknown/zero values, duplicate +snapshots, and preserved draft, focus, selection and transcript DOM. Existing +compaction, tool-summary and composer browser checks also passed. + +Clean runtime code `0b8595f16e6352baec8ccc8e389a8783d3af4f52` was deployed with a +SQLite/binary rollback backup after checking pipeline work and both native chat +backends. Only the Pipelines server restarted; other services were untouched. +An authenticated live browser received and formatted all four OpenCode metrics +for this existing owned chat, with shell cache v12. Verification initiated no new +model turn, session, pipeline run, or provider generation. Private numeric usage +and credentials are not copied into this note. diff --git a/web/PARITY.md b/web/PARITY.md index 164ea161..54a0fdd3 100644 --- a/web/PARITY.md +++ b/web/PARITY.md @@ -35,6 +35,11 @@ non-reasoning output and native request-to-stream timing (including request latency, excluding tool execution). Codex reports token/context snapshots but provides no compatible generation-rate or USD billing data, so those values remain unavailable. Shell cache v12 refreshes the changed modules on reload. +After deployment, an authenticated live browser received all four metrics for +the existing owned OpenCode chat and formatted them through the shipped module. +No provider turn/session was created for that check; private usage figures are +not included in the committed evidence. Native requests and credentialed access +remain server-side. ### Context compaction activity (2026-10-20)