mirror of
https://github.com/EKKOLearnAI/hermes-web-ui.git
synced 2026-05-26 22:10:15 +00:00
feat(chat-run-socket): record usage from Hermes session in syncFromHermes
Call updateUsage() in syncFromHermes to record token usage data from Hermes ephemeral session to local DB. This ensures accurate usage tracking including: - input_tokens - output_tokens - cache_read_tokens - cache_write_tokens - reasoning_tokens - model The usage data comes from the Hermes session detail which contains accurate token counts from the upstream LLM provider. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -772,6 +772,16 @@ export class ChatRunSocket {
|
||||
|
||||
updateSessionStats(localSessionId)
|
||||
|
||||
// Record usage from Hermes session
|
||||
updateUsage(localSessionId, {
|
||||
inputTokens: detail.input_tokens,
|
||||
outputTokens: detail.output_tokens,
|
||||
cacheReadTokens: detail.cache_read_tokens,
|
||||
cacheWriteTokens: detail.cache_write_tokens,
|
||||
reasoningTokens: detail.reasoning_tokens,
|
||||
model: detail.model,
|
||||
})
|
||||
|
||||
// Calculate usage from DB now that data is complete
|
||||
// Use inputTokens already set by compression path if available
|
||||
const state = this.sessionMap.get(localSessionId)
|
||||
|
||||
Reference in New Issue
Block a user