Skip to content

Commit aa14b2f

Browse files
byapparovclaude
andcommitted
refactor(provider): keep ModelsDev.get() the only catalog read path (#187)
Stop exporting the raw ModelsDev.Data lazy so every consumer reads the catalog through get(), which drops removed providers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c1b0732 commit aa14b2f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/cli/src/provider/models.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export namespace ModelsDev {
8585
return Flag.AICTRL_MODELS_URL || "https://models.dev"
8686
}
8787

88-
export const Data = lazy(async () => {
88+
const Data = lazy(async () => {
8989
const result = await Filesystem.readJson(Flag.AICTRL_MODELS_PATH ?? filepath).catch(() => {})
9090
if (result) return result
9191
// @ts-ignore
@@ -123,7 +123,7 @@ export namespace ModelsDev {
123123
})
124124
if (text !== undefined) {
125125
await Filesystem.write(filepath, text)
126-
ModelsDev.Data.reset()
126+
Data.reset()
127127
}
128128
}
129129
}

0 commit comments

Comments
 (0)