mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30:48 +08:00
Converge manager out of product roles and drop dead inherit prefs.
Specialists-only binding/prewarm/MCP allowlists fold legacy manager aliases into generalist; stop persisting confirm/plan prefs and strip inherit from prompt signatures. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
bc20b41ee2
commit
454c841af7
20 changed files with 131 additions and 290 deletions
|
|
@ -11,7 +11,6 @@ from runtime.agents.specialists import (
|
|||
SpecialistProfile,
|
||||
normalize_specialist_id,
|
||||
agent_role_ids,
|
||||
MANAGER_AGENT_ID,
|
||||
specialist_ids,
|
||||
default_system_prefix_for_specialist,
|
||||
default_tool_tags_for_specialist,
|
||||
|
|
@ -196,7 +195,7 @@ def _build_executor_components(
|
|||
return active_model, active_mode
|
||||
return _build_chat_model_for_profile(bound_pid, allow_runtime_overrides=False)
|
||||
|
||||
manager_model, manager_mode = _pick_model_for_role(MANAGER_AGENT_ID)
|
||||
manager_model, manager_mode = _pick_model_for_role("generalist")
|
||||
specialist_models: dict[str, object] = {}
|
||||
specialist_modes: dict[str, str] = {}
|
||||
for sid in specialist_ids():
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ def specialist_ids() -> tuple[SpecialistId, ...]:
|
|||
|
||||
|
||||
def agent_role_ids() -> tuple[AgentRoleId, ...]:
|
||||
return (MANAGER_AGENT_ID, *specialist_ids())
|
||||
return specialist_ids()
|
||||
|
||||
|
||||
def expert_name_for_specialist(specialist_id: SpecialistId) -> str:
|
||||
|
|
@ -101,6 +101,8 @@ def model_role_for_specialist(specialist_id: SpecialistId) -> AgentRoleId:
|
|||
|
||||
def normalize_specialist_id(specialist_id: SpecialistId | None) -> SpecialistId:
|
||||
sid = (specialist_id or "").strip().lower()
|
||||
if sid in {"manager", "manager_self", "main", "comprehensive"}:
|
||||
return "generalist"
|
||||
if sid in _REMOVED_SPECIALIST_IDS:
|
||||
return "generalist"
|
||||
if sid in SPECIALISTS:
|
||||
|
|
@ -125,6 +127,11 @@ def parse_agent_profile_bindings(raw: str | None) -> dict[AgentRoleId, str]:
|
|||
return out
|
||||
if not isinstance(obj, dict):
|
||||
return out
|
||||
# Fold legacy manager profile into generalist when generalist empty.
|
||||
mgr = str(obj.get("manager") or "").strip()
|
||||
if mgr and not str(obj.get("generalist") or "").strip():
|
||||
obj = dict(obj)
|
||||
obj["generalist"] = mgr
|
||||
for rid in agent_role_ids():
|
||||
v = obj.get(rid)
|
||||
if v is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue