Merge branch 'dev' of ssh://git.commumedia.org:2222/alex/headquarter into dev

This commit is contained in:
Alex Blank
2026-05-28 21:36:04 +02:00
2 changed files with 25 additions and 3 deletions
+15
View File
@@ -124,6 +124,21 @@ async def _handle_terminal_websocket(
logger.debug("Terminal auth passed for instance %s, user %s", instance_id, user_id)
# Verify the container actually exists (may have been removed/recreated)
from src.services.docker import get_container_status
container_status = get_container_status(instance.container_id)
if container_status["status"] == "not_found":
logger.error(
"Container %s for instance %s not found (may have been removed)",
instance.container_id,
instance_id,
)
await websocket.close(
code=4004, reason="Container not found — restart the tool instance"
)
return
# Fetch tool type to get startup_command
tool_type = await db_session.get(ToolType, instance.tool_type_id)
startup_command = tool_type.startup_command if tool_type else None