Problem: - Token usage was recorded to token_usage table but not to conversation entity - Message count was not being incremented - Dashboard showed 0 tokens for all conversations Solution: - Add inputTokens/outputTokens fields to StreamChunk interface - Return token usage in 'end' chunk from ClaudeAgentServiceV2 - Capture token usage in conversation.service.ts sendMessage - Call conversation.addTokens() and incrementMessageCount() after each exchange - Consolidate conversation updates into single repo.update() call Files changed: - claude-agent-v2.service.ts: Add token fields to StreamChunk, return in 'end' - conversation.service.ts: Track tokens and message counts properly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| admin-client | ||
| services | ||
| shared | ||
| web-client | ||