fix(insights): harden per-route usage attribution

Preserve deletability, route identity, stored costs, aggregate reconciliation,
and zero-usage Codex route accounting on top of the salvaged per-model usage
work.
This commit is contained in:
teknium1 2026-07-11 04:30:08 -07:00 committed by Teknium
parent d14006ead2
commit 0d63c23f36
5 changed files with 245 additions and 49 deletions

View file

@ -120,6 +120,9 @@ def _record_codex_app_server_usage(agent, turn) -> dict[str, Any]:
agent._session_db.update_token_counts(
agent.session_id,
model=agent.model,
billing_provider=agent.provider,
billing_base_url=agent.base_url,
billing_mode="subscription_included",
api_call_count=1,
)
except Exception as exc: