kin: KIN-ARCH-007 Дочистить оставшиеся workaround path='' после KIN-ARCH-003

This commit is contained in:
Gros Frumos 2026-03-16 10:08:50 +02:00
parent a28790d194
commit e4566d51a6
3 changed files with 7 additions and 10 deletions

View file

@ -1354,7 +1354,6 @@ def test_create_operations_project_with_ssh_fields(client):
r = client.post("/api/projects", json={
"id": "srv1",
"name": "My Server",
"path": "",
"project_type": "operations",
"ssh_host": "10.0.0.1",
"ssh_user": "root",
@ -1364,6 +1363,7 @@ def test_create_operations_project_with_ssh_fields(client):
assert r.status_code == 200
data = r.json()
assert data["project_type"] == "operations"
assert data["path"] is None
assert data["ssh_host"] == "10.0.0.1"
assert data["ssh_user"] == "root"
assert data["ssh_key_path"] == "~/.ssh/id_rsa"
@ -1397,7 +1397,6 @@ def test_create_operations_project_without_ssh_host_allowed(client):
r = client.post("/api/projects", json={
"id": "srv2",
"name": "Server No SSH",
"path": "",
"project_type": "operations",
})
# Фикс KIN-ARCH-001: был 200, стал 422
@ -1417,7 +1416,6 @@ def test_kin_arch_001_operations_without_ssh_host_returns_422(client):
r = client.post("/api/projects", json={
"id": "ops_no_ssh",
"name": "Ops Without SSH",
"path": "",
"project_type": "operations",
})
assert r.status_code == 422
@ -1429,7 +1427,6 @@ def test_kin_arch_001_operations_with_empty_ssh_host_returns_422(client):
r = client.post("/api/projects", json={
"id": "ops_empty_ssh",
"name": "Ops Empty SSH",
"path": "",
"project_type": "operations",
"ssh_host": "",
})
@ -1442,13 +1439,13 @@ def test_kin_arch_001_operations_with_valid_ssh_host_returns_200(client):
r = client.post("/api/projects", json={
"id": "ops_with_ssh",
"name": "Ops With SSH",
"path": "",
"project_type": "operations",
"ssh_host": "10.0.0.42",
})
assert r.status_code == 200
data = r.json()
assert data["project_type"] == "operations"
assert data["path"] is None
assert data["ssh_host"] == "10.0.0.42"
@ -1484,7 +1481,6 @@ def test_kin_arch_001_422_error_message_mentions_ssh_host(client):
r = client.post("/api/projects", json={
"id": "ops_err_msg",
"name": "Check Error Message",
"path": "",
"project_type": "operations",
})
assert r.status_code == 422

View file

@ -84,10 +84,11 @@ def test_create_development_project_defaults(conn):
def test_update_project_ssh_fields(conn):
"""KIN-071: update_project can set SSH fields."""
models.create_project(conn, "srv2", "Server 2", "", project_type="operations")
models.create_project(conn, "srv2", "Server 2", project_type="operations")
updated = models.update_project(conn, "srv2", ssh_host="192.168.1.1", ssh_user="pelmen")
assert updated["ssh_host"] == "192.168.1.1"
assert updated["ssh_user"] == "pelmen"
assert updated["path"] is None
# ---------------------------------------------------------------------------

View file

@ -38,7 +38,7 @@ const autoMode = ref(false)
function loadMode(t: typeof task.value) {
if (!t) return
if (t.execution_mode) {
autoMode.value = t.execution_mode === 'auto'
autoMode.value = t.execution_mode === 'auto_complete'
} else if (t.status === 'review') {
// Task is in review always show Approve/Reject regardless of localStorage
autoMode.value = false
@ -52,7 +52,7 @@ async function toggleMode() {
autoMode.value = !autoMode.value
localStorage.setItem(`kin-mode-${task.value.project_id}`, autoMode.value ? 'auto' : 'review')
try {
const updated = await api.patchTask(props.id, { execution_mode: autoMode.value ? 'auto' : 'review' })
const updated = await api.patchTask(props.id, { execution_mode: autoMode.value ? 'auto_complete' : 'review' })
task.value = { ...task.value, ...updated }
} catch (e: any) {
error.value = e.message
@ -343,7 +343,7 @@ async function saveEdit() {
<h1 class="text-xl font-bold text-gray-100">{{ task.id }}</h1>
<span class="text-gray-400">{{ task.title }}</span>
<Badge :text="task.status" :color="statusColor(task.status)" />
<span v-if="task.execution_mode === 'auto'"
<span v-if="task.execution_mode === 'auto_complete'"
class="text-[10px] px-1.5 py-0.5 bg-yellow-900/40 text-yellow-400 border border-yellow-800 rounded"
title="Auto mode: agents can write files">&#x1F513; auto</span>
<select