Skip to content

fix: recognise the Claude 5 generation in History (Opus 5, Sonnet 5) - #263

Merged
AThevon merged 2 commits into
mainfrom
fix/model-kind-claude-5
Sep 5, 2026
Merged

AThevon merged 2 commits into
mainfrom
fix/model-kind-claude-5

Conversation

@AThevon

@AThevon AThevon commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Fixes #259 and #261. Third iteration of the unknown-model-ID pattern (#188 fixed by #189, #199 fixed by #201): the Claude 5 generation drops the minor version suffix, so claude-opus-5 was absorbed by the bare-opus fallback and labeled Opus 4.8, and claude-sonnet-5 collapsed into the unversioned legacy Sonnet bucket.

Changes

  • ModelKind: new opus5 and sonnet5 cases, matched before the 4.x checks and the generic buckets (opus-4-5/sonnet-4-5 cannot collide with the opus-5/sonnet-5 substrings, pinned by tests). An unrecognised 4.x minor now stays labeled Opus 4.8 instead of falling into the Opus 5 bucket. The bare opus alias maps to Opus 5, the current shipping version, as its comment always promised.
  • History chart: distinct colors for both new cases (hue-checked against their stack neighbors); family chips untouched (Opus 5 folds into Opus, Sonnet 5 into Sonnet), so filters, Monitoring tiles and topActiveModelName pick the fix up automatically.
  • HistoryCache schema bumped to v3 so already-parsed history is re-scanned and reclassified on first open, same mechanism as the Fable bump (History view classifies claude-fable-5 sessions as "Other" #199). The discard path is now expressed as HistoryCache.isCurrentVersion and pinned by a new test suite.

Accepted side effect

Legacy rows whose JSONL says just opus relabel from Opus 4.8 to Opus 5 in the re-scan: the bare alias carries no era information, and the fallback tracks the current shipping version by design. Called out in the v3 comment.

Tests

642 tests, 67 suites green, including new pins: opus5IsRecognised, sonnet5IsRecognised, unknownOpus4MinorStaysInGeneration4, the retargeted bare-alias test, the sonnet-4-5 non-collision guard, and the previously untested cache-version discard.

claude-opus-5 was absorbed by the bare-opus fallback and labeled
Opus 4.8 (#259); claude-sonnet-5 collapsed into the unversioned legacy
Sonnet bucket (#261). Third iteration of the unknown-model-ID pattern
after #188 and #199.

- ModelKind: new opus5 and sonnet5 cases, matched before the 4.x checks
  and the generic buckets; the bare opus alias now maps to Opus 5 (the
  current shipping version, as its comment always promised).
- History chart: distinct colors for both new cases; the family chips
  are untouched (Opus 5 folds into Opus, Sonnet 5 into Sonnet).
- HistoryCache schema bumped to v3 so already-parsed history is
  re-scanned and reclassified, same mechanism as the Fable bump (#199).
…he discard

Review hardening: an unrecognised 4.x minor (e.g. claude-opus-4-5) now
stays labeled Opus 4.8 instead of being absorbed by the bare-opus
fallback into the Opus 5 bucket; the cache-version discard the whole
reclassification relies on is now expressed as HistoryCache
.isCurrentVersion and pinned by tests; the v3 comment states the
accepted side effect (legacy bare-opus rows relabel to Opus 5).
@AThevon
AThevon merged commit 1e293b6 into main Sep 5, 2026
2 checks passed
@AThevon
AThevon deleted the fix/model-kind-claude-5 branch September 5, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Opus in 'History'-tab still recognized as Opus 4.8

1 participant