kin: auto-commit after pipeline
This commit is contained in:
parent
fe344c2a4f
commit
d53c4096fd
9 changed files with 343 additions and 22 deletions
24
web/api.py
24
web/api.py
|
|
@ -897,6 +897,30 @@ def approve_task(task_id: str, body: TaskApprove | None = None):
|
|||
}
|
||||
|
||||
|
||||
class FollowupBody(BaseModel):
|
||||
dry_run: bool = False
|
||||
|
||||
|
||||
@app.post("/api/tasks/{task_id}/followup")
|
||||
def followup_task(task_id: str, body: FollowupBody | None = None):
|
||||
"""Generate follow-up tasks for a blocked or completed task."""
|
||||
from core.followup import generate_followups
|
||||
|
||||
conn = get_conn()
|
||||
t = models.get_task(conn, task_id)
|
||||
if not t:
|
||||
conn.close()
|
||||
raise HTTPException(404, f"Task '{task_id}' not found")
|
||||
dry_run = body.dry_run if body else False
|
||||
result = generate_followups(conn, task_id, dry_run=dry_run)
|
||||
conn.close()
|
||||
return {
|
||||
"created": result["created"],
|
||||
"pending_actions": result["pending_actions"],
|
||||
"needs_decision": len(result["pending_actions"]) > 0,
|
||||
}
|
||||
|
||||
|
||||
class ResolveAction(BaseModel):
|
||||
action: dict
|
||||
choice: str # "rerun" | "manual_task" | "skip"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue