Agent Zero AI framework
fix: respect for task-only contexts
Alessandro90ffc78799fd
diff --git a/webui/index.js b/webui/index.jsindex 83ed2d699..cd9a5482a 100644--- a/webui/index.js+++ b/webui/index.js@@ -337,10 +337,14 @@ export async function poll() {// Update selection in both storeschatsStore.setSelected(context);- // Check if this context exists in the chats list- const contextExists = chatsStore.contains(context);+ const contextInChats = chatsStore.contains(context);+ const contextInTasks = tasksStore.contains(context);- if (!contextExists) {+ if (contextInTasks) {+ tasksStore.setSelected(context);+ }++ if (!contextInChats && !contextInTasks) {if (chatsStore.contexts.length > 0) {// If it doesn't exist in the list but other contexts do, fall back to the firstconst firstChatId = chatsStore.firstId();@@ -352,8 +356,6 @@ export async function poll() {// No contexts remain – clear state so the welcome screen can surfacedeselectChat();}- } else {- tasksStore.setSelected(context);}} else {const welcomeStore =