Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.1] - 2026-07-16

### Fixed

- Corrected fresh-input accounting so both cache reads and cache writes are excluded from fresh tokens, including alternate OpenTelemetry cache attribute names emitted by Copilot CLI.
- Corrected the dashboard pricing table to use the bundled `cached_input` field and expanded per-call details to show fresh input, cache reads, and cache writes separately.

## [0.3.0] - 2026-05-21

### Changed
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "copilot-cost",
"version": "0.3.0",
"version": "0.3.1",
"description": "Local-only GitHub Copilot CLI statusline + dashboard for real-time token cost tracking. Reads OpenTelemetry traces, never sends data anywhere.",
"keywords": [
"github",
Expand Down
3 changes: 2 additions & 1 deletion tests-ts/otel-aggregations.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { randomUUID } from "node:crypto";
import { describe, expect, it } from "vitest";
import { exportCsv, models, sessions, sessionDetail, summary, timeseries } from "../src/otel/aggregations.js";
import { type NormalizedCall } from "../src/otel/parser.js";

function call(partial: Partial<NormalizedCall>): NormalizedCall {
return { dedup_key: partial.dedup_key ?? crypto.randomUUID(), session_id: Object.hasOwn(partial, "session_id") ? partial.session_id! : "s1", ts: partial.ts ?? "2026-05-13T12:00:00.000Z", model: partial.model ?? "m1", input_tokens: partial.input_tokens ?? 0, output_tokens: partial.output_tokens ?? 0, cache_read: partial.cache_read ?? 0, cache_creation: partial.cache_creation ?? 0, reasoning: partial.reasoning ?? 0, usd_cost: partial.usd_cost ?? 0, duration_ms: partial.duration_ms ?? 0, source: partial.source ?? "cli-span" };
return { dedup_key: partial.dedup_key ?? randomUUID(), session_id: Object.hasOwn(partial, "session_id") ? partial.session_id! : "s1", ts: partial.ts ?? "2026-05-13T12:00:00.000Z", model: partial.model ?? "m1", input_tokens: partial.input_tokens ?? 0, output_tokens: partial.output_tokens ?? 0, cache_read: partial.cache_read ?? 0, cache_creation: partial.cache_creation ?? 0, reasoning: partial.reasoning ?? 0, usd_cost: partial.usd_cost ?? 0, duration_ms: partial.duration_ms ?? 0, source: partial.source ?? "cli-span" };
}

describe("OTel aggregations", () => {
Expand Down
Loading