zed/crates/client
Tom Houlé 32f2593047
client: Refresh cloud models on websocket reconnect (#57528)
Until now, the cloud-hosted model list was only refreshed in response to
events that exercise the LLM token (a `UserUpdated` push, an
organization change, or `PrivateUserInfoUpdated`). If a user wasn't
actively using AI features around the time we shipped new models, the
list could stay stale until they restarted Zed.

This is the second step toward fixing that, after #57078 made the cloud
websocket reconnect on its own. We now treat each successful (re)connect
as a hint that the server state may have changed, so possibly new model
definitions will be available, and trigger a model list refresh.

The trigger is a new `Client::cloud_connection_id()` watch that bumps a
counter each time the websocket handshake completes.
`CloudLanguageModelProvider::State` subscribes to it and, on every tick
after the initial `0`, schedules a debounced refresh (with jitter, so we
don't have all active clients trying to reconnect at the same time after
we deploy in cloud).

Closes CLO-713.

Release Notes:

- The list of Zed hosted models is now refreshed automatically, without
requiring a restart
2026-05-27 16:39:19 +00:00
..
src client: Refresh cloud models on websocket reconnect (#57528) 2026-05-27 16:39:19 +00:00
Cargo.toml client: Use cloud as source of truth for the selected organization (#57140) 2026-05-20 07:00:02 +00:00
LICENSE-GPL chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00