Skip to content

Agent Zero AI framework

fixing tasks/projects

frdelf25543ead050
diff --git a/python/api/poll.py b/python/api/poll.py
index b7516d5e1..dbe7105c6 100644
--- a/python/api/poll.py
+++ b/python/api/poll.py
@@ -88,12 +88,6 @@ class Poll(ApiHandler):
"last_result": task_details.get("last_result"),
"attachments": task_details.get("attachments", []),
"context_id": task_details.get("context_id"),
- "project_name": task_details.get("project_name"),
- "project_color": task_details.get("project_color"),
- "project": {
- "name": task_details.get("project_name"),
- "color": task_details.get("project_color"),
- },
})
# Add type-specific fields
diff --git a/python/helpers/log.py b/python/helpers/log.py
index 068e85499..1ae0bff5a 100644
--- a/python/helpers/log.py
+++ b/python/helpers/log.py
@@ -321,11 +321,11 @@ class Log:
secrets_mgr = get_secrets_manager(self.context or AgentContext.current())
# debug helper to identify context mismatch
- self_id = self.context.id if self.context else None
- current_ctx = AgentContext.current()
- current_id = current_ctx.id if current_ctx else None
- if self_id != current_id:
- print(f"Context ID mismatch: {self_id} != {current_id}")
+ # self_id = self.context.id if self.context else None
+ # current_ctx = AgentContext.current()
+ # current_id = current_ctx.id if current_ctx else None
+ # if self_id != current_id:
+ # print(f"Context ID mismatch: {self_id} != {current_id}")
if isinstance(obj, str):
return secrets_mgr.mask_values(obj)
diff --git a/python/helpers/task_scheduler.py b/python/helpers/task_scheduler.py
index 53da2c94f..a707777af 100644
--- a/python/helpers/task_scheduler.py
+++ b/python/helpers/task_scheduler.py
@@ -22,6 +22,7 @@ from python.helpers.print_style import PrintStyle
from python.helpers.defer import DeferredTask
from python.helpers.files import get_abs_path, make_dirs, read_file, write_file
from python.helpers.localization import Localization
+from python.helpers import projects
import pytz
from typing import Annotated
@@ -736,6 +737,10 @@ class TaskScheduler:
# initial name before renaming is same as task name
# context.name = task.name
+ # Activate project if set
+ if task.project_name:
+ projects.activate_project(context.id, task.project_name)
+
# Save the context
save_tmp_chat(context)
return context
diff --git a/webui/index.html b/webui/index.html
index 141ad9d41..82abf4b59 100644
--- a/webui/index.html
+++ b/webui/index.html
@@ -400,8 +400,8 @@
</div>
<template x-if="isCreating">
<div class="project-selector">
- <span class="project-color-ball"
- :style="editingTask.project?.color ? { backgroundColor: editingTask.project.color } : { border: '1px solid var(--color-border)' }"></span>
+ <!-- <span class="project-color-ball"
+ :style="editingTask.project?.color ? { backgroundColor: editingTask.project.color } : { border: '1px solid var(--color-border)' }"></span> -->
<select class="scheduler-project-select"
x-model="selectedProjectSlug"
@change="onProjectSelect($event.target.value)">