Skip to content

fix: load modelparams >= 0.0.58 catalogs and bump to 0.0.72 - #3109

Merged
guillaumegay13 merged 2 commits into
mnfst:mainfrom
schroderfernando16:fix/modelparams-0.0.72
Nov 4, 2026
Merged

guillaumegay13 merged 2 commits into
mnfst:mainfrom
schroderfernando16:fix/modelparams-0.0.72

Conversation

@schroderfernando16

@schroderfernando16 schroderfernando16 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Refs #3103

Why

The backend reads the vendored modelparams catalog (dist/generated/data.js) with a regex. Since modelparams 0.0.58 that file defines the array as const GENERATED_CATALOG = [...] and re-exports it as CATALOG. The old regex captured the identifier instead of the array, so JSON.parse threw while ProviderParamSpecService was constructed and the backend could not boot on any newer version. That is also why the Dependabot group bump (#3108) cannot be merged as it stands.

With the loader fixed, the bump to 0.0.72 gives the offline and cold-boot seed (also used with MODELPARAMS_API_DISABLED) the parameter specs for gpt-6-luna, gpt-6-astra, gpt-6-sol, gpt-6.1-sol and claude-fable-5-1, including their Bedrock ids. Online installs already get these from the hourly refresh.

What changes

Two commits. The loader goes first and passes on its own with 0.0.57; the bump comes second.

  • provider-param-spec.service.ts: one regex change. It matches the array literal itself, in both the old and the new layout, and is anchored on the array and its closing ]; on column 0 (the file is generated with JSON.stringify(..., 4)). The error message for an unknown shape is unchanged. Production code: 1 line plus 3 of comments.
  • modelparams ^0.0.57 to ^0.0.72 in the backend package.json, and the modelparams entry in package-lock.json. Nothing else in the lockfile changes (8 lines). I edited those lines by hand and checked them with npm ci, because npm install rewrites about 360 unrelated lines of this lockfile (devOptional/dev flips and the packages/manifest version), which is already the case on main.
  • Two specs: one runs the loader against both layouts and an unknown shape with the file content mocked; one reads the real installed package and pins a few ids on purpose, as a canary for future bumps.
  • A changeset (manifest, patch).

What does not change

No runtime behaviour for installs already on a working catalog, no API or database changes, no other dependency.

How it was done

The specs were written first. Against the old loader with 0.0.72 installed they fail with Unexpected token 'G', "GENERATED_CATALOG" is not valid JSON. The regex was run against the real files of 0.0.57, 0.0.58, 0.0.67 and 0.0.72 (382, 382, 481 and 490 entries) and a few hostile synthetic layouts.

Testing

  • npm ci --ignore-scripts on a clean copy with Node 24: the lockfile is unchanged and modelparams@0.0.72 is hoisted at the root.
  • Backend unit suite: 519 suites, 9741 tests, all passing. tsc, eslint (0 errors), prettier and the changeset check are clean.
  • Boot smoke test with MODELPARAMS_API_DISABLED=true: 489 entries; gpt-6-luna and claude-fable-5-1 resolve, also through their Bedrock ids.
  • shared (489) and cli (325) pass. Failures that this PR does not touch: one frontend test (Account.test.tsx expects the text "August 15, 2026", a date that has passed) and the e2e tests ST-07 and ST-08, which also fail on an unmodified main.

Caveats


Summary by cubic

Fixes the backend catalog loader that failed on modelparams 0.0.58 and newer, and bumps modelparams to 0.0.72 so GPT-6 (luna, astra, sol), GPT-6.1 sol, and Claude Fable 5.1 parameter specs are available offline and on cold boot.

  • The loader now matches the array literal in both the old CATALOG and new GENERATED_CATALOG layouts instead of the identifier, which previously made JSON.parse throw and prevented boot on newer versions.
  • Adds loader tests for both layouts and an unknown shape, plus a canary spec that pins model ids from the real installed package to catch future drops.
  • Adds a patch changeset and updates only the modelparams entry in the lockfile.

Note: gpt-6.1-terra is not in 0.0.72 and needs an upstream fix, so that item of #3103 stays open. This PR should land before #3108 so Dependabot can rebase it as a no-op.

Written for commit 6b09189. Summary will update on new commits.

View guided diff

fernasch added 2 commits November 3, 2026 11:55
Since modelparams 0.0.58 the generated data file defines the array as
`const GENERATED_CATALOG = [...]` and re-exports it as `CATALOG`. The old
regex captured the identifier instead of the array, so JSON.parse threw
while the service was constructed and the backend could not boot on any
newer version. Match the array literal itself, in either layout.
The vendored seed, used on cold boot, on offline installs and with
MODELPARAMS_API_DISABLED, had no parameter specs for gpt-6-*, gpt-6.1-sol
or claude-fable-5-1. This needs the loader from the previous commit, since
0.0.72 ships the new catalog file layout. The lockfile changes only the
modelparams entry.
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.20%. Comparing base (394d9a9) to head (6b09189).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3109   +/-   ##
=======================================
  Coverage   96.20%   96.20%           
=======================================
  Files         673      673           
  Lines       39749    39749           
  Branches    11095    11144   +49     
=======================================
+ Hits        38240    38241    +1     
  Misses        521      521           
+ Partials      988      987    -1     
Flag Coverage Δ
backend 95.20% <100.00%> (+<0.01%) ⬆️
frontend 97.44% <ø> (ø)
shared 98.78% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

View guided diff | Re-trigger cubic

@guillaumegay13
guillaumegay13 merged commit ac0d8bf into mnfst:main Nov 4, 2026
20 checks passed
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.

2 participants