oclaw/tests/test_specialists_registry.py
oliver d5e30542aa 统一会话展示与专家路由行为,修复图片异步显示与气泡宽度问题。
本次移除 image 专家角色并同步更新路由/绑定/测试,同时增强 session-bootstrap 的共享与角色分层记忆加载,减少刷新依赖并提升默认可用性。

Made-with: Cursor
2026-04-29 22:16:49 +08:00

20 lines
890 B
Python

from __future__ import annotations
from oclaw.runtime.agents import specialists as specialists_mod
def test_unknown_dynamic_specialist_defaults_to_minimum_expert_permissions(monkeypatch) -> None:
monkeypatch.setattr(specialists_mod, "discover_specialist_ids", lambda: ("generalist", "qa"))
assert specialists_mod.expert_name_for_specialist("qa") == "generalist"
def test_agent_role_ids_uses_runtime_discovery(monkeypatch) -> None:
monkeypatch.setattr(specialists_mod, "discover_specialist_ids", lambda: ("generalist", "ops", "qa"))
got = specialists_mod.agent_role_ids()
assert got[0] == specialists_mod.MANAGER_AGENT_ID
assert "qa" in set(got)
def test_builtin_specialists_include_memory_tools() -> None:
assert "memory" in specialists_mod.expert_name_for_specialist("generalist")
assert "memory" in specialists_mod.expert_name_for_specialist("ops")