Skip to content

v0.2.1: keep prompts whose first assistant has a NULL model

Choose a tag to compare

@muckybuzzwoo muckybuzzwoo released this 15 Jun 12:55
· 49 commits to main since this release

Fix

expensive_prompts dropped a prompt entirely when the first assistant message in its window was an API-error / synthetic row with model = NULL (the scanner stores model = NULL whenever a transcript record carries no message.model). The model-pick subquery had no model IS NOT NULL guard, so together with the outer WHERE model IS NOT NULL filter the whole prompt - including the billable tokens of the real response that followed - disappeared from the Prompts tab.

The displayed model is now taken from the first assistant in the window that actually has a model; the token sums still span the full turn (incl. the tool loop).

Tests

  • test_expensive_prompts_skips_null_model_first_assistant - a NULL-model-first ordering no longer drops the prompt
  • test_expensive_prompts_sums_multiple_assistants_in_window - multi-assistant (tool-loop) summing

Pure query change - no schema migration or re-scan needed.

Full changelog: v0.2.0...v0.2.1