mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 07:00:48 +08:00
统一 specialist 发现与角色绑定入口,收敛到运行时 registry 快照。
移除静态 specialist 列表依赖,并将未知动态 specialist 默认映射为最小权限 expert,降低路由与权限不一致风险。 Made-with: Cursor
This commit is contained in:
parent
87ff00aa06
commit
e9227bf7a0
5 changed files with 50 additions and 26 deletions
15
tests/test_specialists_registry.py
Normal file
15
tests/test_specialists_registry.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue