iconsulting/packages
hailin ae99b78579 fix(conversation): track token usage and message count in conversation entity
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>
2026-01-25 17:08:23 -08:00
..
admin-client feat(admin): add conversation management with device tracking display 2026-01-25 10:04:17 -08:00
services fix(conversation): track token usage and message count in conversation entity 2026-01-25 17:08:23 -08:00
shared Initial commit: iConsulting 香港移民咨询智能客服系统 2026-01-09 00:01:12 -08:00
web-client fix(chat): align input area elements vertically centered 2026-01-10 06:49:20 -08:00