* fix: sync message_count to state.db for /insights (#163) sync_session_usage() didn't write message_count to state.db, so /insights showed 0 messages for all WebUI sessions even with sync_to_insights enabled. Added message_count parameter to sync_session_usage() and pass len(s.messages) from both the streaming and non-streaming chat paths. Fixes #163 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use callable pattern for _execute_write in sync_session_usage --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1094,6 +1094,7 @@ def _handle_chat_sync(handler, body):
|
||||
estimated_cost=s.estimated_cost,
|
||||
model=s.model,
|
||||
title=s.title,
|
||||
message_count=len(s.messages),
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user