910028a75c
Read a bounded newest-first page of eight assistants (4 MiB, no cursor traversal), selecting context and completed generation rate independently from the latest valid measurement matching Session.Info.model provider/id. Require assistant model identity; never pair an old model's measurements with the selected model's window. Context remains unknown across a newer compaction until a subsequent prompt reports usage; the last completed matching rate may survive compaction. Unknown model metadata is cached for 15 seconds instead of five minutes, while known capacities retain their five-minute cache. Provenance remains canonical V2 Model.Ref, TokenUsage and request-created/streamed/completed fields cited in chat_usage.go. No live endpoint access, inference or service changes. Isolated HTTP regressions cover in-flight/null/empty newest tokens with prior known metrics, post-compaction boundaries, independent prompt/rate selection, switched/missing model identity, duplicate known-zero measurements, over-limit page rejection and metadata recovery. Checked full internal/opencode suite, focused usage race suite, go vet ./internal/opencode and git diff --check.