Skip to content

fix(core): broadcast models.dev catalog refreshes server-wide - #57148

Merged
kitlangton merged 6 commits into
devfrom
models-dev-refresh
Oct 20, 2026
Merged

kitlangton merged 6 commits into
devfrom
models-dev-refresh

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ModelsDev.refresh published Refreshed tagged 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 mark models-dev.refreshed as "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.

@kitlangton kitlangton changed the title fix(core): broadcast models.dev refresh globally and hide retired models fix: hide retired models and offer another model when a provider retires one Oct 19, 2026
Drop the 410 model-retired error and the desktop/TUI/session-ui surfaces; keep the global ModelsDev refresh and deprecated-model filtering.
@kitlangton kitlangton changed the title fix: hide retired models and offer another model when a provider retires one fix(core): broadcast model catalog refreshes server-wide and hide retired models Oct 20, 2026
@kitlangton kitlangton changed the title fix(core): broadcast model catalog refreshes server-wide and hide retired models fix(core): broadcast models.dev catalog refreshes server-wide Oct 20, 2026
@kitlangton
kitlangton marked this pull request as ready for review October 20, 2026 07:08
@kitlangton
kitlangton merged commit 5a36ee7 into dev Oct 20, 2026
14 checks passed
@kitlangton
kitlangton deleted the models-dev-refresh branch October 20, 2026 07:08

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant