Fix Phase 2 detection: pass original task status to create_content
The scheduler sets status to "automation underway" before the tool runs, so create_content's API re-fetch never saw "outline approved". Now the scheduler passes the pre-change status via clickup_task_status arg. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>fix/customer-field-migration
parent
a3eacbd0e5
commit
b4f1ddfced
|
|
@ -451,6 +451,7 @@ class Scheduler:
|
||||||
try:
|
try:
|
||||||
# args already built during validation above
|
# args already built during validation above
|
||||||
args["clickup_task_id"] = task_id
|
args["clickup_task_id"] = task_id
|
||||||
|
args["clickup_task_status"] = task.status
|
||||||
|
|
||||||
# Execute the skill via the tool registry
|
# Execute the skill via the tool registry
|
||||||
if hasattr(self.agent, "_tools") and self.agent._tools:
|
if hasattr(self.agent, "_tools") and self.agent._tools:
|
||||||
|
|
|
||||||
|
|
@ -771,8 +771,12 @@ def create_content(
|
||||||
task_id = ctx.get("clickup_task_id", "")
|
task_id = ctx.get("clickup_task_id", "")
|
||||||
|
|
||||||
# Determine phase from ClickUp task status
|
# Determine phase from ClickUp task status
|
||||||
|
# Prefer status passed by scheduler (pre-status-change) over re-fetching
|
||||||
phase = 1
|
phase = 1
|
||||||
if task_id and ctx:
|
original_status = ctx.get("clickup_task_status", "")
|
||||||
|
if original_status and original_status.lower() == "outline approved":
|
||||||
|
phase = 2
|
||||||
|
elif task_id and ctx:
|
||||||
client = _get_clickup_client(ctx)
|
client = _get_clickup_client(ctx)
|
||||||
if client:
|
if client:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue