language_model: Refresh the LLM token upon receiving a UserUpdated message from Cloud (#35839)

This PR makes it so we refresh the LLM token upon receiving a
`UserUpdated` message from Cloud over the WebSocket connection.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-08-07 19:00:45 -04:00 committed by GitHub
parent d110459ef8
commit 50482a6bc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 19 deletions

View file

@ -193,7 +193,7 @@ pub fn init(client: &Arc<Client>, cx: &mut App) {
});
}
pub type MessageToClientHandler = Box<dyn Fn(&MessageToClient, &App) + Send + Sync + 'static>;
pub type MessageToClientHandler = Box<dyn Fn(&MessageToClient, &mut App) + Send + Sync + 'static>;
struct GlobalClient(Arc<Client>);
@ -1684,7 +1684,7 @@ impl Client {
pub fn add_message_to_client_handler(
self: &Arc<Client>,
handler: impl Fn(&MessageToClient, &App) + Send + Sync + 'static,
handler: impl Fn(&MessageToClient, &mut App) + Send + Sync + 'static,
) {
self.message_to_client_handlers
.lock()