sync update from LAN repo (source ji @ 85078a31)

This commit is contained in:
gozeros committed 2026-10-21 15:09:16 +08:00
1 parent 5d6627af50
commit e602d88695
864 files changed
+99150 -6346

No files matched your search

@@ -55,6 +55,7 @@ __all__ = [
"normalize_retrieval_directions",
"normalize_retrieval_skills",
"queries_from_retrieval_directions",
"resolve_collector_skill_visibility",
"runtime_extra_skills",
]
@@ -120,10 +121,12 @@ def merge_collector_skill_allowlist(
base: list[str] | None,
extra: Any,
) -> list[str] | None:
"""Widen the collector agent's skill allowlist for one run.
"""Apply one run's 检索来源 extras to the collector agent's skill visibility.
Other agents are unchanged. Empty extras are a no-op. ``None`` base means
"all skills" (default lead agent) and is left alone.
The collector's base is ``None`` ("all skills", like the default lead
agent — its config.yaml whitelist is ignored). Empty extras keep ``None``;
non-empty extras narrow the run to exactly those skills, because 检索来源
is the user's explicit per-research choice. Other agents are unchanged.
"""
extras = normalize_retrieval_skills(extra)
if not extras or agent_id != COLLECTOR_AGENT_ID:
@@ -136,3 +139,20 @@ def merge_collector_skill_allowlist(
seen.add(name)
out.append(name)
return out
def resolve_collector_skill_visibility(
agent_id: str | None,
base: list[str] | None,
extra: Any = None,
) -> list[str] | None:
"""Resolve the collector's runtime skill visibility.
The deep-research collector does NOT use its config.yaml ``skills``
whitelist: without run extras it sees **every** enabled skill (``None``),
exactly like the default lead agent in a normal chat — free to use any
skill it wants. Non-collector agents pass through ``base`` untouched.
"""
if agent_id != COLLECTOR_AGENT_ID:
return base
return merge_collector_skill_allowlist(agent_id, None, extra)