- Introduced provider-neutral schemas for local agent session sources in `agent_sessions.py`.
- Implemented source discovery helpers for local agent session providers in `agent_session_sources.py`.
- Created a reader for local Codex CLI session history in `codex_session_reader.py`, including parsing and redaction of sensitive information.
- Added tests for Codex session parsing and API endpoints to ensure functionality and data integrity.
- Add _get_explicit_cost() with priority chain: usage.cost.total > usage.cost flat > cost/cost_usd
- aggregate_per_model() and _top_sessions() now use _get_explicit_cost()
- Fix message limit prediction to use elapsed time instead of total window
- Add 224 lines of test coverage for typed limits, explicit cost priority,
pricing override shapes, and prediction logic
- Add source and confidence fields to RuntimeUsageWindow, ModelUsageEntry,
TopSession, RuntimeUsageCurrent, and ProviderUsageScrapeResult schemas
- _build_window() assigns source based on data origin:
provider_native > provider_api_rate_limit > local_jsonl_estimate
- _build_current() tags token_limit_source and cost_limit_source
- Frontend relabels 'Current session'/'All models' to 'API rate limit'
- Shows source label and confidence in usage strip
- Changes 'did not return active usage windows' to 'did not return
API rate-limit windows for percent + reset diagnostics'
The column was NOT NULL but the ORM create path doesn't populate it
until ensure_main_agent() runs after INSERT. Make it nullable so the
initial create succeeds.