kin: auto-commit after pipeline
This commit is contained in:
parent
96047f3525
commit
8fa2cc266c
3 changed files with 11 additions and 3 deletions
|
|
@ -3,6 +3,7 @@ Kin agent runner — launches Claude Code as subprocess with role-specific conte
|
||||||
Each agent = separate process with isolated context.
|
Each agent = separate process with isolated context.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import errno as _errno
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
@ -1175,7 +1176,6 @@ def _execute_department_head_step(
|
||||||
# Watchdog helpers
|
# Watchdog helpers
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
import errno as _errno
|
|
||||||
|
|
||||||
|
|
||||||
def _check_parent_alive(
|
def _check_parent_alive(
|
||||||
|
|
@ -1266,8 +1266,7 @@ def run_pipeline(
|
||||||
department=department,
|
department=department,
|
||||||
)
|
)
|
||||||
# Save PID so watchdog can detect dead subprocesses (KIN-099)
|
# Save PID so watchdog can detect dead subprocesses (KIN-099)
|
||||||
models.update_pipeline(conn, pipeline["id"], pid=os.getpid())
|
pipeline = models.update_pipeline(conn, pipeline["id"], pid=os.getpid())
|
||||||
pipeline["pid"] = os.getpid()
|
|
||||||
models.update_task(conn, task_id, status="in_progress")
|
models.update_task(conn, task_id, status="in_progress")
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
|
|
|
||||||
4
scripts/start-api.sh
Executable file
4
scripts/start-api.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
sock=$(ls /private/tmp/com.apple.launchd.*/Listeners 2>/dev/null | head -1)
|
||||||
|
[ -n "$sock" ] && export SSH_AUTH_SOCK="$sock"
|
||||||
|
exec /opt/homebrew/bin/python3.11 -m uvicorn web.api:app --host 0.0.0.0 --port 8420
|
||||||
|
|
@ -3,6 +3,7 @@ Kin Web API — FastAPI backend reading ~/.kin/kin.db via core.models.
|
||||||
Run: uvicorn web.api:app --reload --port 8420
|
Run: uvicorn web.api:app --reload --port 8420
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import glob as _glob
|
||||||
import logging
|
import logging
|
||||||
import mimetypes
|
import mimetypes
|
||||||
import shutil
|
import shutil
|
||||||
|
|
@ -114,6 +115,10 @@ def _launch_pipeline_subprocess(task_id: str) -> None:
|
||||||
cmd = [sys.executable, "-m", "cli.main", "--db", str(DB_PATH), "run", task_id]
|
cmd = [sys.executable, "-m", "cli.main", "--db", str(DB_PATH), "run", task_id]
|
||||||
cmd.append("--allow-write")
|
cmd.append("--allow-write")
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
|
if 'SSH_AUTH_SOCK' not in env:
|
||||||
|
_socks = _glob.glob('/private/tmp/com.apple.launchd.*/Listeners')
|
||||||
|
if _socks:
|
||||||
|
env['SSH_AUTH_SOCK'] = _socks[0]
|
||||||
env["KIN_NONINTERACTIVE"] = "1"
|
env["KIN_NONINTERACTIVE"] = "1"
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue