refactor(constants): initialize LEAD_TEMPLATE_MAP as an empty dictionary
refactor(page): clean up import statements for better readability fix(tests): update assertions for clarity and consistency
This commit is contained in:
@@ -110,8 +110,7 @@ BOARD_SHARED_TEMPLATE_MAP = {
|
|||||||
"TOOLS.md": "BOARD_TOOLS.md.j2",
|
"TOOLS.md": "BOARD_TOOLS.md.j2",
|
||||||
}
|
}
|
||||||
|
|
||||||
LEAD_TEMPLATE_MAP = {
|
LEAD_TEMPLATE_MAP: dict[str, str] = {}
|
||||||
}
|
|
||||||
|
|
||||||
_TOOLS_KV_RE = re.compile(r"^(?P<key>[A-Z0-9_]+)=(?P<value>.*)$")
|
_TOOLS_KV_RE = re.compile(r"^(?P<key>[A-Z0-9_]+)=(?P<value>.*)$")
|
||||||
_NON_TRANSIENT_GATEWAY_ERROR_MARKERS = ("unsupported file",)
|
_NON_TRANSIENT_GATEWAY_ERROR_MARKERS = ("unsupported file",)
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import pytest
|
|||||||
|
|
||||||
import app.services.openclaw.internal.agent_key as agent_key_mod
|
import app.services.openclaw.internal.agent_key as agent_key_mod
|
||||||
import app.services.openclaw.provisioning as agent_provisioning
|
import app.services.openclaw.provisioning as agent_provisioning
|
||||||
from app.services.souls_directory import SoulRef
|
|
||||||
from app.services.openclaw.provisioning_db import AgentLifecycleService
|
from app.services.openclaw.provisioning_db import AgentLifecycleService
|
||||||
from app.services.openclaw.shared import GatewayAgentIdentity
|
from app.services.openclaw.shared import GatewayAgentIdentity
|
||||||
|
from app.services.souls_directory import SoulRef
|
||||||
|
|
||||||
|
|
||||||
def test_slugify_normalizes_and_trims():
|
def test_slugify_normalizes_and_trims():
|
||||||
@@ -67,7 +67,7 @@ def test_templates_root_points_to_repo_templates_dir():
|
|||||||
root = agent_provisioning._templates_root()
|
root = agent_provisioning._templates_root()
|
||||||
assert root.name == "templates"
|
assert root.name == "templates"
|
||||||
assert root.parent.name == "backend"
|
assert root.parent.name == "backend"
|
||||||
assert (root / "AGENTS.md").exists()
|
assert (root / "BOARD_AGENTS.md.j2").exists()
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -372,7 +372,9 @@ def test_select_role_soul_ref_prefers_exact_slug() -> None:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_resolve_role_soul_markdown_returns_best_effort(monkeypatch: pytest.MonkeyPatch) -> None:
|
async def test_resolve_role_soul_markdown_returns_best_effort(
|
||||||
|
monkeypatch: pytest.MonkeyPatch,
|
||||||
|
) -> None:
|
||||||
refs = [SoulRef(handle="team", slug="data-scientist")]
|
refs = [SoulRef(handle="team", slug="data-scientist")]
|
||||||
|
|
||||||
async def _fake_list_refs() -> list[SoulRef]:
|
async def _fake_list_refs() -> list[SoulRef]:
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ from uuid import uuid4
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
from sqlmodel import col, select, SQLModel
|
|
||||||
from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine
|
from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine
|
||||||
|
from sqlmodel import SQLModel, col, select
|
||||||
from sqlmodel.ext.asyncio.session import AsyncSession
|
from sqlmodel.ext.asyncio.session import AsyncSession
|
||||||
|
|
||||||
from app.api import tasks as tasks_api
|
from app.api import tasks as tasks_api
|
||||||
@@ -165,7 +165,10 @@ async def test_non_lead_agent_forbidden_without_assigned_task() -> None:
|
|||||||
assert exc.value.status_code == 403
|
assert exc.value.status_code == 403
|
||||||
assert isinstance(exc.value.detail, dict)
|
assert isinstance(exc.value.detail, dict)
|
||||||
assert exc.value.detail["code"] == "task_assignee_required"
|
assert exc.value.detail["code"] == "task_assignee_required"
|
||||||
assert exc.value.detail["message"] == "Agents can only change status on tasks assigned to them."
|
assert (
|
||||||
|
exc.value.detail["message"]
|
||||||
|
== "Agents can only change status on tasks assigned to them."
|
||||||
|
)
|
||||||
finally:
|
finally:
|
||||||
await engine.dispose()
|
await engine.dispose()
|
||||||
|
|
||||||
@@ -247,7 +250,10 @@ async def test_non_lead_agent_forbidden_when_task_assigned_to_other_agent() -> N
|
|||||||
assert exc.value.status_code == 403
|
assert exc.value.status_code == 403
|
||||||
assert isinstance(exc.value.detail, dict)
|
assert isinstance(exc.value.detail, dict)
|
||||||
assert exc.value.detail["code"] == "task_assignee_mismatch"
|
assert exc.value.detail["code"] == "task_assignee_mismatch"
|
||||||
assert exc.value.detail["message"] == "Agents can only change status on tasks assigned to them."
|
assert (
|
||||||
|
exc.value.detail["message"]
|
||||||
|
== "Agents can only change status on tasks assigned to them."
|
||||||
|
)
|
||||||
finally:
|
finally:
|
||||||
await engine.dispose()
|
await engine.dispose()
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ TEMPLATES_DIR = Path(__file__).resolve().parents[1] / "templates"
|
|||||||
|
|
||||||
def test_heartbeat_templates_fit_in_injected_context_limit() -> None:
|
def test_heartbeat_templates_fit_in_injected_context_limit() -> None:
|
||||||
"""Heartbeat templates must stay under gateway injected-context truncation limit."""
|
"""Heartbeat templates must stay under gateway injected-context truncation limit."""
|
||||||
targets = (
|
targets = ("BOARD_HEARTBEAT.md.j2",)
|
||||||
"BOARD_HEARTBEAT.md.j2",
|
|
||||||
)
|
|
||||||
for name in targets:
|
for name in targets:
|
||||||
size = (TEMPLATES_DIR / name).stat().st_size
|
size = (TEMPLATES_DIR / name).stat().st_size
|
||||||
assert (
|
assert (
|
||||||
|
|||||||
@@ -31,9 +31,7 @@ import {
|
|||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "@/components/ui/select";
|
} from "@/components/ui/select";
|
||||||
import {
|
import { DEFAULT_IDENTITY_PROFILE } from "@/lib/agent-templates";
|
||||||
DEFAULT_IDENTITY_PROFILE,
|
|
||||||
} from "@/lib/agent-templates";
|
|
||||||
|
|
||||||
type IdentityProfile = {
|
type IdentityProfile = {
|
||||||
role: string;
|
role: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user