Repository navigation
fix(core): broadcast models.dev catalog refreshes server-wide - #57148
Conversation
Drop the 410 model-retired error and the desktop/TUI/session-ui surfaces; keep the global ModelsDev refresh and deprecated-model filtering.
There was a problem hiding this comment.
The one-line fix is correct. A refresh triggered in one location now reaches subscribers in every location, matching how credential, wellknown and plugin-SDK updates are already broadcast. I checked it by reverting the flag on the base: the new cross-location test then times out because the subscriber filters the event out. With the PR the full models.test.ts passes (17/17) and packages/core typechecks.
Public API: the models-dev.refreshed event keeps its type and payload; it just no longer carries a location. Clients and location-scoped subscribers keep working, and every location now receives it.
The 43-line cross-location test is large for a one-line fix and can be dropped so the change stays minimal.
Summary
ModelsDev.refreshpublishedRefreshedtagged with the location of whichever project first started the service. Subscribers in other projects filtered it out, so their model pickers stayed on the bundled snapshot until restart (seen as a frozen Default Project picker in Desktop).Refresh now publishes with
{ global: true }, so every location rebuilds from the live catalog. The models.dev source is shared by the whole server, so this is the planned"server"event scope. A future declarative scope should markmodels-dev.refreshedas"server"and drop the call-site flag.Tests
packages/core/test/models.test.ts: a refresh triggered in one location reaches a subscriber in another, with no location on the event.