Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/backend/claude-sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ export async function handleMessage(
// The remaining currentBlockText is the final response text
allResponseText += currentBlockText;

const totalPrompt = inputTokens + cacheRead + cacheWrite;
const cacheTotal = inputTokens + cacheRead;
const cacheHitPct =
totalPrompt > 0 ? Math.round((cacheRead / totalPrompt) * 100) : 0;
cacheTotal > 0 ? Math.round((cacheRead / cacheTotal) * 100) : 0;

log(
"agent",
Expand Down
5 changes: 2 additions & 3 deletions src/frontend/telegram/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,9 @@ export function registerCommands(bot: Bot, config: TalonConfig): void {
"\u2588".repeat(filled) + "\u2591".repeat(barLen - filled);
const contextWarn = contextPct >= 80 ? " \u26A0\uFE0F consider /reset" : "";

const totalPrompt =
u.totalInputTokens + u.totalCacheRead + u.totalCacheWrite;
const cacheTotal = u.totalInputTokens + u.totalCacheRead;
const cacheHitPct =
totalPrompt > 0 ? Math.round((u.totalCacheRead / totalPrompt) * 100) : 0;
cacheTotal > 0 ? Math.round((u.totalCacheRead / cacheTotal) * 100) : 0;
Comment thread
dylanneve1 marked this conversation as resolved.

const avgResponseMs =
info.turns > 0 && u.totalResponseMs
Expand Down
Loading