Spaces:
Paused
Paused
frdel commited on
Commit ·
93d5e89
1
Parent(s): e287d47
fixing tasks/projects
Browse files- python/api/poll.py +0 -6
- python/helpers/log.py +5 -5
- python/helpers/task_scheduler.py +5 -0
- webui/index.html +2 -2
python/api/poll.py
CHANGED
|
@@ -88,12 +88,6 @@ class Poll(ApiHandler):
|
|
| 88 |
"last_result": task_details.get("last_result"),
|
| 89 |
"attachments": task_details.get("attachments", []),
|
| 90 |
"context_id": task_details.get("context_id"),
|
| 91 |
-
"project_name": task_details.get("project_name"),
|
| 92 |
-
"project_color": task_details.get("project_color"),
|
| 93 |
-
"project": {
|
| 94 |
-
"name": task_details.get("project_name"),
|
| 95 |
-
"color": task_details.get("project_color"),
|
| 96 |
-
},
|
| 97 |
})
|
| 98 |
|
| 99 |
# Add type-specific fields
|
|
|
|
| 88 |
"last_result": task_details.get("last_result"),
|
| 89 |
"attachments": task_details.get("attachments", []),
|
| 90 |
"context_id": task_details.get("context_id"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
})
|
| 92 |
|
| 93 |
# Add type-specific fields
|
python/helpers/log.py
CHANGED
|
@@ -321,11 +321,11 @@ class Log:
|
|
| 321 |
secrets_mgr = get_secrets_manager(self.context or AgentContext.current())
|
| 322 |
|
| 323 |
# debug helper to identify context mismatch
|
| 324 |
-
self_id = self.context.id if self.context else None
|
| 325 |
-
current_ctx = AgentContext.current()
|
| 326 |
-
current_id = current_ctx.id if current_ctx else None
|
| 327 |
-
if self_id != current_id:
|
| 328 |
-
|
| 329 |
|
| 330 |
if isinstance(obj, str):
|
| 331 |
return secrets_mgr.mask_values(obj)
|
|
|
|
| 321 |
secrets_mgr = get_secrets_manager(self.context or AgentContext.current())
|
| 322 |
|
| 323 |
# debug helper to identify context mismatch
|
| 324 |
+
# self_id = self.context.id if self.context else None
|
| 325 |
+
# current_ctx = AgentContext.current()
|
| 326 |
+
# current_id = current_ctx.id if current_ctx else None
|
| 327 |
+
# if self_id != current_id:
|
| 328 |
+
# print(f"Context ID mismatch: {self_id} != {current_id}")
|
| 329 |
|
| 330 |
if isinstance(obj, str):
|
| 331 |
return secrets_mgr.mask_values(obj)
|
python/helpers/task_scheduler.py
CHANGED
|
@@ -22,6 +22,7 @@ from python.helpers.print_style import PrintStyle
|
|
| 22 |
from python.helpers.defer import DeferredTask
|
| 23 |
from python.helpers.files import get_abs_path, make_dirs, read_file, write_file
|
| 24 |
from python.helpers.localization import Localization
|
|
|
|
| 25 |
import pytz
|
| 26 |
from typing import Annotated
|
| 27 |
|
|
@@ -736,6 +737,10 @@ class TaskScheduler:
|
|
| 736 |
# initial name before renaming is same as task name
|
| 737 |
# context.name = task.name
|
| 738 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 739 |
# Save the context
|
| 740 |
save_tmp_chat(context)
|
| 741 |
return context
|
|
|
|
| 22 |
from python.helpers.defer import DeferredTask
|
| 23 |
from python.helpers.files import get_abs_path, make_dirs, read_file, write_file
|
| 24 |
from python.helpers.localization import Localization
|
| 25 |
+
from python.helpers import projects
|
| 26 |
import pytz
|
| 27 |
from typing import Annotated
|
| 28 |
|
|
|
|
| 737 |
# initial name before renaming is same as task name
|
| 738 |
# context.name = task.name
|
| 739 |
|
| 740 |
+
# Activate project if set
|
| 741 |
+
if task.project_name:
|
| 742 |
+
projects.activate_project(context.id, task.project_name)
|
| 743 |
+
|
| 744 |
# Save the context
|
| 745 |
save_tmp_chat(context)
|
| 746 |
return context
|
webui/index.html
CHANGED
|
@@ -400,8 +400,8 @@
|
|
| 400 |
</div>
|
| 401 |
<template x-if="isCreating">
|
| 402 |
<div class="project-selector">
|
| 403 |
-
<span class="project-color-ball"
|
| 404 |
-
:style="editingTask.project?.color ? { backgroundColor: editingTask.project.color } : { border: '1px solid var(--color-border)' }"></span>
|
| 405 |
<select class="scheduler-project-select"
|
| 406 |
x-model="selectedProjectSlug"
|
| 407 |
@change="onProjectSelect($event.target.value)">
|
|
|
|
| 400 |
</div>
|
| 401 |
<template x-if="isCreating">
|
| 402 |
<div class="project-selector">
|
| 403 |
+
<!-- <span class="project-color-ball"
|
| 404 |
+
:style="editingTask.project?.color ? { backgroundColor: editingTask.project.color } : { border: '1px solid var(--color-border)' }"></span> -->
|
| 405 |
<select class="scheduler-project-select"
|
| 406 |
x-model="selectedProjectSlug"
|
| 407 |
@change="onProjectSelect($event.target.value)">
|