kin: KIN-080 Разобраться с KIN-FIX-003 и KIN-FIX-004, одна из задач уже выполнена, вторая берется в работу (руками завершаю) но в задаче не меняется текущий статус

This commit is contained in:
Gros Frumos 2026-03-16 17:30:31 +02:00
parent bfc8f1c0bb
commit c67fa379b3
2 changed files with 125 additions and 5 deletions

View file

@ -76,7 +76,7 @@ class ClaudeAuthError(Exception):
def check_claude_auth(timeout: int = 10) -> None:
"""Check that claude CLI is authenticated before running a pipeline.
Runs: claude -p 'ok' --output-format json --no-verbose with timeout.
Runs: claude -p 'ok' --output-format json with timeout.
Returns None if auth is confirmed.
Raises ClaudeAuthError if:
- claude CLI not found in PATH (FileNotFoundError)
@ -89,7 +89,7 @@ def check_claude_auth(timeout: int = 10) -> None:
env = _build_claude_env()
try:
proc = subprocess.run(
[claude_cmd, "-p", "ok", "--output-format", "json", "--no-verbose"],
[claude_cmd, "-p", "ok", "--output-format", "json"],
capture_output=True,
text=True,
timeout=timeout,
@ -1084,7 +1084,13 @@ def run_pipeline(
last_role = steps[-1].get("role", "") if steps else ""
auto_eligible = last_role in {"tester", "reviewer"}
if mode == "auto_complete" and auto_eligible:
# Guard: re-fetch current status — user may have manually changed it while pipeline ran
current_task = models.get_task(conn, task_id)
current_status = current_task.get("status") if current_task else None
if current_status in ("done", "cancelled"):
pass # User finished manually — don't overwrite
elif mode == "auto_complete" and auto_eligible:
# Auto-complete mode: last step is tester/reviewer — skip review, approve immediately
models.update_task(conn, task_id, status="done")
try:
@ -1114,8 +1120,8 @@ def run_pipeline(
except Exception:
pass
else:
# Review mode: wait for manual approval
models.update_task(conn, task_id, status="review", execution_mode="review")
# Review mode: wait for manual approval (don't overwrite execution_mode)
models.update_task(conn, task_id, status="review")
# Run post-pipeline hooks (failures don't affect pipeline status)
try: