kin: KIN-135-backend_dev
This commit is contained in:
parent
4c01e0e4ee
commit
24be66d16c
9 changed files with 436 additions and 6 deletions
14
cli/main.py
14
cli/main.py
|
|
@ -661,6 +661,20 @@ def run_task(ctx, task_id, dry_run, allow_write):
|
|||
raise SystemExit(1)
|
||||
|
||||
if not isinstance(output, dict) or "pipeline" not in output:
|
||||
# KIN-135: if PM returned status='blocked', record the return for escalation tracking
|
||||
if isinstance(output, dict) and output.get("status") == "blocked":
|
||||
try:
|
||||
reason_category = output.get("return_category") or "missing_context"
|
||||
reason_text = output.get("reason") or ""
|
||||
models.record_task_return(
|
||||
conn,
|
||||
task_id=task_id,
|
||||
reason_category=reason_category,
|
||||
reason_text=reason_text[:500] if reason_text else None,
|
||||
returned_by="pm",
|
||||
)
|
||||
except Exception:
|
||||
pass # Never block on return tracking errors
|
||||
click.echo(f"PM output missing 'pipeline' key:\n{json.dumps(output, indent=2)[:500]}", err=True)
|
||||
raise SystemExit(1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue