Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(desktop-ui): r5-l4 share selection revision with list load
Josué9e07d4a4eb04
diff --git a/desktop-app/ui/src/hooks/domain/useAgentChatController.ts b/desktop-app/ui/src/hooks/domain/useAgentChatController.tsindex 948f59628..c8c9130d3 100644--- a/desktop-app/ui/src/hooks/domain/useAgentChatController.ts+++ b/desktop-app/ui/src/hooks/domain/useAgentChatController.ts@@ -1372,7 +1372,7 @@ export function useAgentChatController({}setChatListLoading(true);(async () => {- const result = await loadChatList(selectedAgent)+ const result = await loadChatList(selectedAgent, selectionIntentRevision)if (cancelled || isHostAccessBlocked(selectedAgent)) returnsetChatListLoading(false)// A newer selection intent, including an explicit blank New chat, ownsdiff --git a/desktop-app/ui/src/hooks/domain/useChatListController.ts b/desktop-app/ui/src/hooks/domain/useChatListController.tsindex baadb8b65..ab6e50bc8 100644--- a/desktop-app/ui/src/hooks/domain/useChatListController.ts+++ b/desktop-app/ui/src/hooks/domain/useChatListController.ts@@ -503,7 +503,7 @@ export function useChatListController({async (agentRef: string,requestGeneration: number,- selectionIntentRevisionAtRequest: number | undefined+ selectionIntentRevisionAtRequest: number): Promise<{ index: ChatIndex; merged: SidebarChatEntry[] }> => {const authorityScopeGeneration = authorityScopeGenerationRef.currentconst authorityScopeAtRequest = currentAuthorityScopeRef.current@@ -640,7 +640,6 @@ export function useChatListController({activeChatId !== latestServerSession.chatId &&serverIsNewerThanSelection &¤tHost.shouldAutoSelectLatest() &&- selectionIntentRevisionAtRequest !== undefined &¤tHost.getSelectionIntentRevision() === selectionIntentRevisionAtRequest &&!suppressAutoSelection) {@@ -815,11 +814,13 @@ export function useChatListController({])const loadChatList = useCallback(- async (agentRef: string): Promise<{ index: ChatIndex; merged: SidebarChatEntry[] } | null> => {+ async (+ agentRef: string,+ selectionIntentRevisionAtRequest: number+ ): Promise<{ index: ChatIndex; merged: SidebarChatEntry[] } | null> => {const requestGeneration = ++requestGenerationRef.current// A retry remains part of this logical load, so it must keep the selection// authority captured before the first attempt rather than adopt a newer intent.- const selectionIntentRevisionAtRequest = host.current?.getSelectionIntentRevision()// One retry with a short backoff: during boot a concurrent team-switch /// access-catalog refresh can momentarily rebind the main-process chat// store, rejecting `getIndex` with "Not authenticated". Swallowing that