fix: blank dashboard — model filter fallback + empty-string model normalisation#109
Open
HaydenHaines wants to merge 8 commits into
Open
fix: blank dashboard — model filter fallback + empty-string model normalisation#109HaydenHaines wants to merge 8 commits into
HaydenHaines wants to merge 8 commits into
Conversation
Parse customTitle / agentName from JSONL records (emitted by Claude Code's /rename command) and store per-session as session_name. The dashboard now shows "name (id...)" when a name is set, falling back to the truncated ID otherwise. CSV export now includes both columns. customTitle is preferred over agentName; the last non-empty value per session wins, with empty strings ignored so a later blank record can't clobber an earlier rename. Incremental scans preserve the stored name when the appended slice contains no rename records (COALESCE NULLIF). Schema: new sessions.session_name column, migrated via ALTER TABLE on init_db for existing DBs. Dashboard query falls back to NULL if the migration hasn't run yet. Tests: 17 new cases covering resolver precedence, parsing, incremental scan preservation/update, migration, and dashboard API/HTML output.
self.path includes the query string, so /?range=all and /api/data?cachebust=1 were falling through to the 404 branch. Parse with urllib.parse.urlparse and match on the path component only. Add three HTTP regression tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Anthropic removed the peak-hours throttle for Pro/Max accounts (May 2026), making the red bars, ⚡ labels, and "Peak — Anthropic US hours" tooltip misleading. Drops PEAK_HOURS_UTC, isPeakHour, displayHourToUTC, the peak-legend CSS, and all related chart rendering. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dashboard showed 0 across all ranges when a user's model names didn't contain 'opus'/'sonnet'/'haiku'. Root cause: readURLModels filtered to billable models only, producing an empty set that silently filtered out all data. Fix 1 (JS): readURLModels now falls back to selecting ALL models when no billable models are found, so non-standard or unrecognised model names no longer result in a blank dashboard. Fix 2 (SQL): COALESCE(NULLIF(model, ''), 'unknown') replaces COALESCE(model, 'unknown') in all three query sites so that empty- string model values (not just NULL) are normalised to 'unknown'. Tests added for both regression paths. Fixes phuryn#76, phuryn#106 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two root causes of the blank dashboard that users have been reporting in issues #76, #88, #90, #93, #99, #106.
Root cause 1 —
readURLModelsreturns empty set (JS)When a user's model names in the DB don't contain
'opus','sonnet', or'haiku',readURLModelsfiltered to zero billable models and returned an emptyselectedModelsset. Every row was then filtered out, producing a blank dashboard across all date ranges — including "All".Fix: if no billable models are found, fall back to selecting ALL models.
Root cause 2 — empty-string
modelnot normalised to'unknown'(SQL)Turns can have
model = ''(empty string, not NULL).COALESCE(model, 'unknown')only catches NULL — empty strings pass through as'', creating an invisible bucket that the model filter never selects. Fixed withCOALESCE(NULLIF(model, ''), 'unknown')in all three query sites.This PR also includes 7 previously accumulated fixes that were committed locally but not yet pushed upstream (session names display, concurrent HTTP server, pricing refactor, Cowork audit tracking, bookmarkable URL fix, range filter bounds fix, peak-hour highlighting removal).
Test plan
python3 -m pytest --tb=short -q— all 130 tests passTestEmptyStringModelregression tests cover theCOALESCE(NULLIF(...))fixtest_read_url_models_falls_back_to_all_when_no_billablecovers the JS fallbackFixes #76, #106 (and partially resolves #88, #90, #93, #99)
🤖 Generated with Claude Code