feat: show running state of skills in frontend using psutil
Ampel / ampel (push) Failing after 21s

This commit is contained in:
Hitonabi
2026-08-07 17:03:30 +02:00
parent a6e2f78c27
commit 6cb29ee70e
4 changed files with 25 additions and 440 deletions
+19 -1
View File
@@ -1,5 +1,6 @@
import os
import subprocess
import psutil
from fastapi import APIRouter
from pydantic import BaseModel
@@ -18,6 +19,22 @@ def list_skills():
skills_dir = os.path.join(repo_root, "deploy", "skills")
skills = []
# Check currently running hermes skill processes
running_skills = set()
for p in psutil.process_iter(['name', 'cmdline']):
try:
cmdline = p.info.get('cmdline')
if cmdline and any("hermes" in arg for arg in cmdline):
for arg in cmdline:
if "Führe den " in arg and " Skill aus" in arg:
# Extract skill name from "Führe den 'skill_name' Skill aus"
import re
match = re.search(r"Führe den '(.+?)' Skill aus", arg)
if match:
running_skills.add(match.group(1))
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
pass
if os.path.exists(skills_dir) and os.path.isdir(skills_dir):
for entry in os.scandir(skills_dir):
if entry.is_dir():
@@ -40,7 +57,8 @@ def list_skills():
skills.append({
"name": entry.name,
"description": description or "Keine Beschreibung verfügbar."
"description": description or "Keine Beschreibung verfügbar.",
"running": entry.name in running_skills
})
return {"skills": skills}