feat(coordinator): 添加团队节点默认最大工具迭代次数配置

添加 DEFAULT_TEAM_NODE_MAX_TOOL_ITERATIONS 配置项以控制团队节点的最大工具迭代次数,
并修改 LocalAgentRunner 中的逻辑来使用此默认值当 envelope 中未指定时。

fix(runtime): 修复团队节点运行成功判断逻辑

更新运行成功判断条件,将 finish_reason 为 "max_tool_iterations_finalized" 的情况
视为运行失败,并添加对原始工具调用输出的检测,避免将其误判为成功完成。

feat(mcp): 添加团队工作流MCP工具类别支持

增加新的本地MCP工具类别 "team_workflow" 及其对应的工具创建功能,
为团队工作流提供本地工具支持。

refactor(engine): 调整AgentLoop最大工具迭代次数设置

将 AgentProfile 中的默认 max_tool_iterations 从 30 增加到 100,
同时移除 TaskExecutionPlanner 构造函数中的重复参数传递。

perf(mcp): 优化MCP连接管理避免重复连接

添加 mcp_connected 标志来跟踪MCP连接状态,确保 connect_all 只执行一次,
提高性能并避免不必要的重复连接。

refactor(skills): 移除技能团队模板相关功能

移除与技能团队模板相关的代码,包括解析、存储和处理逻辑,
简化技能记录结构和加载流程。

feat(process): 增强会话过程投影器功能

添加技能激活快照事件处理,改进团队运行完成消息显示,
并增强技能激活事件的时间戳记录功能。

refactor(tasks): 简化任务尝试编排器团队执行逻辑

移除团队执行相关代码,将所有任务统一按单步执行处理,
简化任务编排器的复杂度并提升执行效率。

fix(evidence): 修复节点证据评估中需求验证逻辑

更新节点证据评估逻辑,跳过自然语言证据需求的确定性验证,
只执行机器可读的需求验证,避免因自然语言需求导致的节点失败。
This commit is contained in:
2026-06-26 16:36:29 +08:00
parent 53b13e8eac
commit 520a21a027
360 changed files with 13271 additions and 1848 deletions

View File

@ -2,38 +2,9 @@ from __future__ import annotations
from beaver.skills.assembler.task_assembler import SkillAssembler
from beaver.skills.catalog.loader import SkillsLoader
from beaver.skills.catalog.utils import extract_skill_team_template
def test_extract_team_template_returns_none_when_block_is_absent() -> None:
result = extract_skill_team_template("# Ordinary Skill")
assert result.template is None
assert result.warnings == []
def test_extract_team_template_parses_valid_json_block() -> None:
result = extract_skill_team_template(
"```beaver-team-template\n"
'{"version": 1, "nodes": [{"node_id": "collect", "task": "Collect"}]}\n'
"```"
)
assert result.template == {
"version": 1,
"nodes": [{"node_id": "collect", "task": "Collect"}],
}
assert result.warnings == []
def test_invalid_template_is_warning_not_skill_load_failure() -> None:
result = extract_skill_team_template("```beaver-team-template\nnot-json\n```")
assert result.template is None
assert result.warnings == ["team template JSON is invalid"]
def test_loader_and_assembler_propagate_team_template_to_skill_context(tmp_path) -> None:
def test_beaver_team_template_block_is_not_runtime_metadata(tmp_path) -> None:
skill_dir = tmp_path / "plugin-skills" / "financial-comparison"
skill_dir.mkdir(parents=True)
(skill_dir / "SKILL.md").write_text(
@ -56,10 +27,7 @@ def test_loader_and_assembler_propagate_team_template_to_skill_context(tmp_path)
context = SkillAssembler(loader)._activate_skill_contexts(["financial-comparison"])[0]
assert record is not None
assert record.team_template == {
"version": 1,
"nodes": [{"node_id": "collect", "task": "Collect official sources"}],
}
assert record.team_template_warnings == []
assert context.team_template == record.team_template
assert context.team_template_warnings == []
assert not hasattr(record, "team_template")
assert not hasattr(record, "team_template_warnings")
assert not hasattr(context, "team_template")
assert not hasattr(context, "team_template_warnings")