@@ -189,7 +189,7 @@ class ChatViewModel(
189 fun reloadModels() {
189 fun reloadModels() {
190 val conn = connection ?: return
190 val conn = connection ?: return
191 viewModelScope.launch {
191 viewModelScope.launch {
192− conn.api.invalidateCache()
192+ conn.api.invalidateProvidersCache()
193 _modelsReload.value++
193 _modelsReload.value++
@@ -197,7 +197,7 @@ class ChatViewModel(
197 fun reloadAgents() {
197 fun reloadAgents() {
198 val conn = connection ?: return
198 val conn = connection ?: return
199 viewModelScope.launch {
199 viewModelScope.launch {
200− conn.api.invalidateCache()
200+ conn.api.invalidateAgentsCache()
201 _agentsReload.value++
201 _agentsReload.value++
@@ -205,7 +205,7 @@ class ChatViewModel(
205 fun reloadCommands() {
205 fun reloadCommands() {
206 val conn = connection ?: return
206 val conn = connection ?: return
207 viewModelScope.launch {
207 viewModelScope.launch {
208− conn.api.invalidateCache()
208+ conn.api.invalidateCommandsCache()
209 _commandsReload.value++
209 _commandsReload.value++
@@ -337,9 +337,13 @@ class ChatViewModel(
337 reloadTrigger = _commandsReload,
337 reloadTrigger = _commandsReload,
339 // Resolve the human-readable session title for the app bar (non-fatal).
339 // Resolve the human-readable session title for the app bar (non-fatal).
340+ // Skips the REST call when the SSE event collector already delivered the title
341+ // (SessionUpdated fires shortly after connect), avoiding a redundant full
342+ // session-list download.
340 viewModelScope.launch {
343 viewModelScope.launch {
341 container.activeConnection.collectLatest { conn ->
344 container.activeConnection.collectLatest { conn ->
342 if (conn == null) return@collectLatest
345 if (conn == null) return@collectLatest
346+ if (_sessionTitle.value != null) return@collectLatest
343 runCatchingCancellable { conn.repository.listSessions() }
347 runCatchingCancellable { conn.repository.listSessions() }
344 .getOrNull()
348 .getOrNull()
345 ?.firstOrNull { it.id == sessionId }
349 ?.firstOrNull { it.id == sessionId }