kin: KIN-128-backend_dev
This commit is contained in:
parent
d3bb5ef6a9
commit
11314a8c37
9 changed files with 348 additions and 4 deletions
14
web/api.py
14
web/api.py
|
|
@ -1051,6 +1051,20 @@ def revise_task(task_id: str, body: TaskRevise):
|
|||
raw = row["steps"]
|
||||
steps = _json.loads(raw) if isinstance(raw, str) else raw
|
||||
|
||||
# KIN-128: On 2nd+ revision, inject analyst as first step for fresh perspective.
|
||||
# Guard: skip if analyst is already the first step (idempotent), or if steps is None.
|
||||
if revise_count >= 2 and steps and (not steps or steps[0].get("role") != "analyst"):
|
||||
analyst_step = {
|
||||
"role": "analyst",
|
||||
"model": "sonnet",
|
||||
"brief": (
|
||||
f"Задача вернулась на ревизию №{revise_count}. "
|
||||
"Проведи свежий анализ причин провала предыдущих попыток "
|
||||
"и предложи другой подход."
|
||||
),
|
||||
}
|
||||
steps = [analyst_step] + list(steps)
|
||||
|
||||
conn.close()
|
||||
|
||||
# Launch pipeline in background subprocess
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue