mcode session usage import: model stays unknown, latency stays 0, and pricing fails
Quick fix
No confirmed user-side fix is available; update the importer to backfill model and latency from telemetry or session data.
Symptom
Section titled “Symptom”本机实测:ccs 库 520 条 `mcode_session` 记录全部 `model='unknown'`、`latency_ms=0`、`total_cost_usd='0'`。Local test: all 520 `mcode_session` records in the ccs database have `model='unknown'`, `latency_ms=0`, and `total_cost_usd='0'`.
In MiniMax Code's source database `local_runtime_token_usage` projection table, the upstream does not write the `model` column. The issue observed that all 539/539 rows were NULL; the `raw` JSON contained only tokens and cost, and `cost_usd` was always 0. The current sync SQL reads values only through `COALESCE(model, 'unknown')`, so every imported record becomes `unknown`.
When the model is `unknown`, `find_model_pricing` cannot find a match, so the cost is shown as unpriced and 0. The importer also hardcodes `latency_ms` to 0 instead of writing `first_token_ms` or `duration_ms`. This issue remains open, and the proposed fix has not yet been confirmed.
Wait for or implement an importer fix: keep the token_usage data source and idempotency key unchanged; fall back in this order: model on the row → telemetry for the same turn → session effectiveModel → unknown. Backfill latency from turn-level `usage.request_duration_ms` and `thinking_duration_ms`. Idempotently backfill existing `unknown` records within the sync transaction, then recalculate cost when pricing matches.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.