Initial commit: Agentic OS troubleshooting platform
Self-hosted, Docker-based agentic troubleshooting platform: FastAPI backend + LangGraph agent, Next.js UI, tiered LLM routing (local Ollama -> Gemini -> DeepSeek -> OpenRouter), MCP server manager, encrypted device credentials, RBAC, audit log, project-memory + Obsidian integrations, and editable troubleshooting decision rules tuned for the GeneseasX vessel stack. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
40
backend/tests/test_task_present.py
Normal file
40
backend/tests/test_task_present.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""Tests for compact task presentation helpers."""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from datetime import datetime, timezone
|
||||
|
||||
os.environ.setdefault("SECRET_KEY", "test-secret-key-for-unit-tests-only")
|
||||
|
||||
from app.models.enums import TaskStatus # noqa: E402
|
||||
from app.models.task import Task # noqa: E402
|
||||
from app.services.task_present import task_to_overview # noqa: E402
|
||||
|
||||
|
||||
def test_task_to_overview_omits_heavy_diagnostics():
|
||||
now = datetime.now(timezone.utc)
|
||||
task = Task(
|
||||
id=7,
|
||||
title="Status",
|
||||
issue="check proxmox and pfsense",
|
||||
status=TaskStatus.succeeded,
|
||||
vessel_id=2,
|
||||
report={
|
||||
"executive_summary": "Checked requested systems.",
|
||||
"findings": [{"title": "No critical issue", "summary": "Both devices answered."}],
|
||||
"devices_checked": ["proxmox", "pfsense"],
|
||||
"diagnostics": [{"output": "large raw data"}],
|
||||
"resolved": True,
|
||||
"run_cost_usd": 0.0,
|
||||
},
|
||||
created_at=now,
|
||||
updated_at=now,
|
||||
)
|
||||
task.memory_id = "mem-1"
|
||||
task.obsidian_path = "agentic-os-tasks/status.md"
|
||||
|
||||
overview = task_to_overview(task, vessel_name="IRINAs")
|
||||
assert overview.summary == "Checked requested systems."
|
||||
assert overview.key_finding == "Both devices answered."
|
||||
assert overview.devices_checked == ["proxmox", "pfsense"]
|
||||
assert not hasattr(overview, "diagnostics")
|
||||
Reference in New Issue
Block a user