feat(core): record title and compaction usage in session totals (#37441)

This commit is contained in:
Aiden Cline 2026-07-17 00:10:30 -05:00 committed by GitHub
commit 73567f3570
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 234 additions and 74 deletions

View file

@ -42,6 +42,7 @@ import { SessionRunCoordinator } from "@opencode-ai/core/session/run-coordinator
import { SessionRunner } from "@opencode-ai/core/session/runner"
import * as SessionRunnerLLM from "@opencode-ai/core/session/runner/llm"
import { SessionRunnerModel } from "@opencode-ai/core/session/runner/model"
import { SessionUsage } from "@opencode-ai/core/session/usage"
import { ToolRegistry } from "@opencode-ai/core/tool/registry"
import { PluginSupervisor } from "@opencode-ai/core/plugin/supervisor"
import { PluginHooks } from "@opencode-ai/core/plugin/hooks"
@ -165,7 +166,7 @@ const recoveryModel = Model.make({
test("calculates step cost using the matching context tier", () => {
expect(
SessionRunnerLLM.calculateCost(
SessionUsage.calculateCost(
[
{
input: Money.USDPerMillionTokens.make(1),
@ -192,7 +193,7 @@ test("calculates step cost using the matching context tier", () => {
test("does not apply an ineligible tier without base pricing", () => {
expect(
SessionRunnerLLM.calculateCost(
SessionUsage.calculateCost(
[
{
tier: { type: "context", size: 100 },