-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Gateway sessions have NULL model in DB #987
Copy link
Copy link
Closed
Description
Sessions created via the gateway (telegram, whatsapp, etc) end up with `model = NULL` in the sessions table. The model isn't known when `get_or_create_session()` runs because the AIAgent hasn't been constructed yet. After the agent finishes, `update_session()` writes token counts but never backfills the model.
This means `/insights` and any dashboard queries show "unknown" for most gateway sessions, even though the model is available on the agent after the first API call.
Probably a one-liner in `_handle_message()` — pass the model to `update_session()` after the agent runs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels