codeburn icon indicating copy to clipboard operation
codeburn copied to clipboard

Why, summarizing GPT to major version

Open bmcdonough opened this issue 5 months ago • 7 comments

Previously I have used codeburn to track my claude code usage. This reported each minor version correctly.

codeburn --day 2026-05-30 --format json | egrep -i "opus|haiku"
      "name": "Opus 4.7",
      "name": "Opus 4.6",
      "name": "Opus 4.8",
      "name": "Haiku 4.5",

Recently I started using codeburn to track my devin cli usage.

codeburn --day 2026-06-12 --format json | egrep -i "gpt"   
      "name": "GPT-5",

However, I know I used more than one GPT model today. So I grepped through the devin transcripts.

grep -hE '^[[:space:]]*"model_name"' ~/.local/share/devin/cli/transcripts/*.json | sed 's/^[[:space:]]*//' | sort -u
"model_name": "Claude Haiku 4.5",
"model_name": "Claude Sonnet 4.5",
"model_name": "Gemini 3 Flash",
"model_name": "GPT-5.3-Codex",
"model_name": "GPT-5.5",
"model_name": "Kimi K2.6",

Processing my entire history of claude and devin, the model reporting is inconsistent:

codeburn --format json | egrep -i "gpt|claude|haiku|sonnet|opus|gemini|flash|codex|kimi|private|swe"
      "name": "Opus 4.8",
      "name": "Opus 4.7",
      "name": "Haiku 4.5",
      "name": "GPT-5",
      "name": "MODEL_GOOGLE_GEMINI_3_0_FLASH_MINIMAL",
      "name": "swe-1-6",
      "name": "Kimi K2",
      "name": "MODEL_PRIVATE_11",

In conclusion, why is GPT summarized to major version instead of reporting the sub-version?

bmcdonough avatar Jun 12 '26 22:06 bmcdonough

ironically, using devin to attempt to find a solution... I am not 100% convinced this is the best way to resolve the issue, because it modifies the parser.ts, so might impact other provider model output.

before changes:

codeburn --day 2026-06-12 --provider devin --format json | jq '.models[].name'                           
"MODEL_GOOGLE_GEMINI_3_0_FLASH_MINIMAL"
"GPT-5"
"swe-1-6"
"Kimi K2"
"MODEL_PRIVATE_11"

after changes:

npx tsx src/cli.ts --day 2026-06-12 --provider devin --format json | jq '.models[].name'                   
"MODEL_GOOGLE_GEMINI_3_0_FLASH_MINIMAL"
"gpt-5-5-medium"
"swe-1-6"
"gpt-5-4-low"
"kimi-k2-6"
"MODEL_PRIVATE_11"
"gpt-5-3-codex-xhigh"

bmcdonough avatar Jun 13 '26 13:06 bmcdonough

https://github.com/getagentseal/codeburn/pull/489

bmcdonough avatar Jun 13 '26 14:06 bmcdonough

Likely root cause: the devin provider's getModelName (src/providers/devin.ts ~L187) prefers step.metadata.generation_model first, then step.model_name. If devin records a coarse family value in generation_model (e.g. gpt-5) while the precise model lives in model_name (GPT-5.5, GPT-5.3-Codex), the coarse one wins and you get GPT-5. (getShortModelName itself maps GPT-5.5/GPT-5.3-Codex correctly, so it's the field-preference, not the short-name table.) The raw MODEL_PRIVATE_11 / MODEL_GOOGLE_GEMINI_3_0_FLASH_MINIMAL are devin-internal ids with no public friendly mapping.

To fix the field preference correctly, a redacted sample of one devin transcript step showing BOTH generation_model and model_name for a known GPT-5.5 session would pin it down. Happy to put up a PR that prefers the precise model_name when generation_model is only a coarse family id — and to add MODEL_* label mappings if you can share what they should map to.

ozymandiashh avatar Jun 21 '26 13:06 ozymandiashh

@ozymandiashh I appreciate those details. I was not expecting to find the generation_model and model_name sometimes differ in version number:

% egrep -i "generation_model|model_name" ~/.local/share/devin/cli/transcripts/funny-buzzard.json | head -5
    "model_name": "GPT-5.4",
      "model_name": "GPT-5.4",
        "generation_model": "gpt-5-3-codex-xhigh",
      "model_name": "GPT-5.4",
        "generation_model": "gpt-5-3-codex-xhigh",

Attached are some redacted transcripts. I appreciate your assistance.

galvanized-barn_redacted.json

early-gray_redacted.json

funny-buzzard_redacted.json

desert-trail_redacted.json

aback-heliotrope_redacted.json

surf-agreement_redacted.json

bmcdonough avatar Jun 30 '26 17:06 bmcdonough

Thanks for the redacted transcripts, they pin it down. I leaned on the two large multi-step ones; the small single-generation samples pair model_name and generation_model from different families (e.g. Claude Haiku 4.5 with gpt-5-5-medium), which reads like a redaction artifact rather than real routing.

The root cause is a dash-vs-dot mismatch, not the field preference I first guessed. Devin's generation_model uses dash-delimited ids with an effort suffix (gpt-5-3-codex-xhigh, gpt-5-4-low, gpt-5-5-medium), while codeburn's short-name table is keyed in dot form (gpt-5.3-codex, gpt-5.4, gpt-5.5). In getShortModelName, the version-boundary check canonical.startsWith('gpt-5' + '-') matches the dash ids against the base gpt-5 entry and returns GPT-5. Running the real ids through it:

gpt-5-3-codex-xhigh  -> GPT-5        gpt-5.3-codex -> GPT-5.3 Codex
gpt-5-4-low          -> GPT-5        gpt-5.4       -> GPT-5.4
gpt-5-5-medium       -> GPT-5        gpt-5.5       -> GPT-5.5

So the dot forms map fine and only Devin's dash ids collapse. That is also why Claude and Gemini rows already look right (their model_name values are friendly), and only the GPT generation ids fold into GPT-5.

A few related notes from the transcripts:

  • The two fields mean different things. model_name is Devin's headline session label (equal to agent.model_name); generation_model is the actual routed engine plus effort tier. In funny-buzzard the session is labeled GPT-5.4 but every step ran gpt-5-3-codex-xhigh.
  • MODEL_PRIVATE_11 and MODEL_GOOGLE_GEMINI_3_0_FLASH_MINIMAL have no friendly form in generation_model; only model_name ("Gemini 3 Flash") names them. A raw-id approach would surface those tokens verbatim in the report.
  • getModelName reads step.metadata.generation_model but not step.extra.generation_model, so on ATIF v1.7 transcripts (where the field moved to extra) it already falls back to model_name instead of collapsing.

Suggested fix that keeps friendly names and the sub-version detail this issue is asking for:

  1. Normalize Devin's dash-form generation_model to the canonical dot form before display (gpt-5-3-codex-xhigh -> gpt-5.3-codex), map through the existing short-name table, and surface the effort tier as a suffix, e.g. GPT-5.3 Codex (xhigh), GPT-5.4 (low).
  2. Fall back to model_name when generation_model is an opaque MODEL_* id, so those rows read Gemini 3 Flash instead of the raw token.
  3. Have getModelName also read step.extra.generation_model so v1.4 and v1.7 stay consistent.

That gets the same forensic granularity #489 is after (codex variant and effort tier) while staying friendly and consistent with how Claude rows render (Opus 4.8), and it avoids leaking the opaque ids. Happy to put this up as a PR, or fold it into #489, with fixtures built from these transcripts. Let me know which you'd prefer.

ozymandiashh avatar Jun 30 '26 21:06 ozymandiashh

Opened #585 with a fix built from those redacted transcripts. It reports the friendly GPT name with the effort tier (e.g. gpt-5-3-codex-xhigh → GPT-5.3 Codex (xhigh)), falls back to model_name for opaque MODEL_* ids, and reads extra.generation_model for ATIF v1.7.

On your parser.ts worry: the only change there is a single devin-gated line, so every other provider keeps going through getShortModelName untouched. It's a different direction from #489 (friendly labels vs raw submodel ids), so happy to converge on whichever the maintainers prefer.

ozymandiashh avatar Jul 01 '26 10:07 ozymandiashh

resolved with release 0.9.15

bmcdonough avatar Jul 02 '26 12:07 bmcdonough