Add status-aware auto_execute gate for Content Creation Phase 2

The scheduler's blanket auto_execute check was blocking "outline approved"
Content Creation tasks from reaching Phase 2. Now checks
auto_execute_on_status for status-specific overrides. Also adds
trigger_hint to skip log messages for easier debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix/customer-field-migration
PeninsulaInd 2026-03-08 19:05:50 -05:00
parent 8f2ec48e10
commit a3eacbd0e5
2 changed files with 15 additions and 6 deletions

View File

@ -385,14 +385,19 @@ class Scheduler:
continue
# Respect auto_execute flag — skip tasks that require manual trigger
# Unless the task status matches an auto_execute_on_status entry
mapping = skill_map[task.task_type]
if not mapping.get("auto_execute", False):
log.debug(
"Skipping task '%s' (type=%s): auto_execute is false",
task.name,
task.task_type,
)
continue
status_triggers = mapping.get("auto_execute_on_status", [])
if task.status.lower() not in [s.lower() for s in status_triggers]:
hint = mapping.get("trigger_hint", "manual trigger only")
log.info(
"Skipping task '%s' (type=%s): auto_execute is false (%s)",
task.name,
task.task_type,
hint,
)
continue
# Client-side verify: due_date must exist and be within window
if not task.due_date:

View File

@ -64,6 +64,7 @@ clickup:
"On Page Optimization":
tool: "create_content"
auto_execute: false
trigger_hint: "content-cora-inbox file watcher"
required_fields: [keyword, url]
field_mapping:
url: "IMSURL"
@ -72,6 +73,8 @@ clickup:
"Content Creation":
tool: "create_content"
auto_execute: false
auto_execute_on_status: ["outline approved"]
trigger_hint: "content-cora-inbox file watcher (Phase 1), outline approved status (Phase 2)"
field_mapping:
url: "IMSURL"
keyword: "Keyword"
@ -79,6 +82,7 @@ clickup:
"Link Building":
tool: "run_link_building"
auto_execute: false
trigger_hint: "cora-inbox file watcher"
complete_status: "complete"
error_status: "error"
field_mapping: