kin: KIN-016 Агенты должны уметь говорить 'не могу'. Если агент не может выполнить задачу (нет доступа, не понимает, выходит за компетенцию) — он должен вернуть status: blocked с причиной, а не пытаться угадывать. PM при получении blocked от агента — эскалирует к человеку через GUI (уведомление) и Telegram (когда будет).
This commit is contained in:
parent
a605e9d110
commit
d9172fc17c
35 changed files with 2375 additions and 23 deletions
|
|
@ -84,6 +84,10 @@ def build_context(
|
|||
conn, project_id, types=["convention"],
|
||||
)
|
||||
|
||||
elif role == "sysadmin":
|
||||
ctx["decisions"] = models.get_decisions(conn, project_id)
|
||||
ctx["modules"] = models.get_modules(conn, project_id)
|
||||
|
||||
elif role == "tester":
|
||||
# Minimal context — just the task spec
|
||||
pass
|
||||
|
|
@ -118,14 +122,22 @@ def _slim_task(task: dict) -> dict:
|
|||
|
||||
def _slim_project(project: dict) -> dict:
|
||||
"""Extract only relevant fields from a project."""
|
||||
return {
|
||||
result = {
|
||||
"id": project["id"],
|
||||
"name": project["name"],
|
||||
"path": project["path"],
|
||||
"tech_stack": project.get("tech_stack"),
|
||||
"language": project.get("language", "ru"),
|
||||
"execution_mode": project.get("execution_mode"),
|
||||
"project_type": project.get("project_type", "development"),
|
||||
}
|
||||
# Include SSH fields for operations projects
|
||||
if project.get("project_type") == "operations":
|
||||
result["ssh_host"] = project.get("ssh_host")
|
||||
result["ssh_user"] = project.get("ssh_user")
|
||||
result["ssh_key_path"] = project.get("ssh_key_path")
|
||||
result["ssh_proxy_jump"] = project.get("ssh_proxy_jump")
|
||||
return result
|
||||
|
||||
|
||||
def _extract_module_hint(task: dict | None) -> str | None:
|
||||
|
|
@ -159,6 +171,25 @@ def format_prompt(context: dict, role: str, prompt_template: str | None = None)
|
|||
if proj.get("tech_stack"):
|
||||
sections.append(f"Tech stack: {', '.join(proj['tech_stack'])}")
|
||||
sections.append(f"Path: {proj['path']}")
|
||||
project_type = proj.get("project_type", "development")
|
||||
sections.append(f"Project type: {project_type}")
|
||||
sections.append("")
|
||||
|
||||
# SSH connection info for operations projects
|
||||
if proj and proj.get("project_type") == "operations":
|
||||
ssh_host = proj.get("ssh_host") or ""
|
||||
ssh_user = proj.get("ssh_user") or ""
|
||||
ssh_key = proj.get("ssh_key_path") or ""
|
||||
ssh_proxy = proj.get("ssh_proxy_jump") or ""
|
||||
sections.append("## SSH Connection")
|
||||
if ssh_host:
|
||||
sections.append(f"Host: {ssh_host}")
|
||||
if ssh_user:
|
||||
sections.append(f"User: {ssh_user}")
|
||||
if ssh_key:
|
||||
sections.append(f"Key: {ssh_key}")
|
||||
if ssh_proxy:
|
||||
sections.append(f"ProxyJump: {ssh_proxy}")
|
||||
sections.append("")
|
||||
|
||||
# Task info
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue