mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30:48 +08:00
将 generalist/ops/image 的 expert 组合加入 memory,使主控调度下的各专家都可调用 memory_wiki_search/apply/lint,并补充注册策略测试防止回归。 Made-with: Cursor
21 lines
965 B
Python
21 lines
965 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")
|
|
assert "memory" in specialists_mod.expert_name_for_specialist("image")
|