Skip to content

Commit be48010

Browse files
committed
fix (tasks): fixes to triggered tasks
1 parent 92cb40d commit be48010

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/server/workers/executor/tasks.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,12 @@ async def async_execute_task_plan(task_id: str, user_id: str, run_id: str):
269269
user_location_raw = personal_info.get("location", "Not specified")
270270
user_location = f"latitude: {user_location_raw.get('latitude')}, longitude: {user_location_raw.get('longitude')}" if isinstance(user_location_raw, dict) else user_location_raw
271271

272+
# The plan for recurring/triggered tasks is at the top level.
273+
# For one-off tasks, it might be in the run itself (e.g., after a change request).
274+
# Prioritize the run-specific plan, then fall back to the task-level plan.
272275
plan_to_execute = current_run.get("plan", [])
276+
if not plan_to_execute:
277+
plan_to_execute = task.get("plan", [])
273278

274279
required_tools_from_plan = {step['tool'] for step in plan_to_execute}
275280
user_integrations = user_profile.get("userData", {}).get("integrations", {}) if user_profile else {}

0 commit comments

Comments
 (0)