Lane 10: a test's AI usage counts, marked as a test (D227, #736) #917
Loading…
Reference in a new issue
No description provided.
Delete branch "build/lane10-d227-test-usage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #736 (lane 10). D227: a "Test the bot" run transcribes and summarises with the campaign's own models, so it counts in usage like any other run, marked as a test.
Migration
10e5f6a7b8c9on8c9d0e1f2a3b(#909's)session_usage.session_idbecomes nullable.recording_test_id: a foreign key torecording_tests,ON DELETE SET NULL, indexed;purpose(sessionortest, with a CHECK). Existing rows backfill tosession.sessionrow has asession_id, and atestrow has none.testrows before restoring NOT NULL.The writer
recording_test_servicemeters ASR and the LLM exactly asprocess_audiodoes. It writes apurpose='test'row on success and on every failure path, replacing the old log-only usage.Every reader checked
usage_service._load_rows(Admin → AI usage & speed, and its per-campaign view) already outer-joinsSession, so a NULLsession_idgives a null title and still counts. Tested.measure_realtime_factorandmeasure_llm_tokens_per_run) andadmin_overview_servicedon't joinSession, so test rows count automatically.SessionUsagereader (the credits live at the payment provider). CAMP-13 and HOME-7 don't read usage today.testchip.Checks
changelog.d/fragment.🤖 Generated with Claude Code