Skip to content

Commit 94e8943

Browse files
committed
fix: rename 'created' → 'stored' for cache creation tokens
'created' was misleading — these are tokens written to populate the cache on the first cache-controlled request. 'stored' is clearer.
1 parent e973040 commit 94e8943

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

cmd/odek/ui/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ <h3>Delete session?</h3>
14001400
if (event.contextTokens != null) parts.push(formatNum(event.contextTokens) + ' in');
14011401
if (event.outputTokens != null) parts.push(formatNum(event.outputTokens) + ' out');
14021402
// Cache metrics — show only when non-zero
1403-
if (event.cacheCreationTokens > 0) parts.push(formatNum(event.cacheCreationTokens) + ' created');
1403+
if (event.cacheCreationTokens > 0) parts.push(formatNum(event.cacheCreationTokens) + ' stored');
14041404
if (event.cacheReadTokens > 0) parts.push(formatNum(event.cacheReadTokens) + ' read');
14051405
if (event.cachedTokens > 0) parts.push(formatNum(event.cachedTokens) + ' cached');
14061406
stats.textContent = parts.join(' · ');

internal/render/render.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (r *Renderer) Summary(inTokens, outTokens, cacheCreate, cacheRead, cached i
220220
fmt.Sprintf("%d out", outTokens),
221221
}
222222
if cacheCreate > 0 {
223-
parts = append(parts, fmt.Sprintf("%d created", cacheCreate))
223+
parts = append(parts, fmt.Sprintf("%d stored", cacheCreate))
224224
}
225225
if cacheRead > 0 {
226226
parts = append(parts, fmt.Sprintf("%d read", cacheRead))

internal/render/render_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ func TestRenderer_Summary_TokensOnly(t *testing.T) {
428428
t.Errorf("missing output tokens: %q", out)
429429
}
430430
// No cache metrics
431-
if strings.Contains(out, "created") {
432-
t.Errorf("should not show cache creation: %q", out)
431+
if strings.Contains(out, "stored") {
432+
t.Errorf("should not show 'stored' when cache creation is 0: %q", out)
433433
}
434434
if strings.Contains(out, "read") {
435435
t.Errorf("should not show cache read: %q", out)
@@ -452,7 +452,7 @@ func TestRenderer_Summary_AnthropicCache(t *testing.T) {
452452
if !strings.Contains(out, "500 out") {
453453
t.Errorf("missing output tokens: %q", out)
454454
}
455-
if !strings.Contains(out, "100 created") {
455+
if !strings.Contains(out, "100 stored") {
456456
t.Errorf("missing cache creation: %q", out)
457457
}
458458
if !strings.Contains(out, "200 read") {
@@ -479,8 +479,8 @@ func TestRenderer_Summary_OpenAICache(t *testing.T) {
479479
if !strings.Contains(out, "75 cached") {
480480
t.Errorf("missing cached tokens: %q", out)
481481
}
482-
if strings.Contains(out, "created") {
483-
t.Errorf("should not show cache creation: %q", out)
482+
if strings.Contains(out, "stored") {
483+
t.Errorf("should not show 'stored' when cache creation is 0: %q", out)
484484
}
485485
if strings.Contains(out, "read") {
486486
t.Errorf("should not show cache read: %q", out)
@@ -521,7 +521,7 @@ func TestRenderer_Summary_NoColor(t *testing.T) {
521521
if !strings.Contains(out, "100 in") {
522522
t.Errorf("missing input tokens: %q", out)
523523
}
524-
if !strings.Contains(out, "10 created") {
524+
if !strings.Contains(out, "10 stored") {
525525
t.Errorf("missing cache creation: %q", out)
526526
}
527527
if !strings.Contains(out, "5 read") {

0 commit comments

Comments
 (0)