feat: 添加swarms团队编排功能并优化agent委派系统
- 引入AgentTeamOrchestrator支持多agent协同任务执行 - 增加第三方swarms库依赖并配置git协议替换以改善包管理 - 扩展DelegationManager支持团队任务调度和进度跟踪 - 实现中文bigram分词算法提升中文任务检索准确性 - 调整A2AClient和DelegationManager超时时间从30秒增至600秒 - 优化AgentRunResult状态判断逻辑增加有意义摘要检测 - 修改Dockerfile配置npm仓库镜像地址和git协议映射 - 更新CLI命令行接口支持网关端口配置传递 - 调整提供者超时配置机制增强请求稳定性 - 移除过时的support_group字段简化agent描述符结构 - 增强错误处理和进度事件报告机制改进用户体验
This commit is contained in:
@ -287,7 +287,10 @@ def _make_provider(config: Config):
|
||||
|
||||
# OpenAI Codex (OAuth)
|
||||
if provider_name == "openai_codex" or model.startswith("openai-codex/"):
|
||||
return OpenAICodexProvider(default_model=model)
|
||||
return OpenAICodexProvider(
|
||||
default_model=model,
|
||||
request_timeout_seconds=p.request_timeout_seconds if p else 600,
|
||||
)
|
||||
|
||||
# Custom: direct OpenAI-compatible endpoint, bypasses LiteLLM
|
||||
if provider_name == "custom":
|
||||
@ -295,6 +298,7 @@ def _make_provider(config: Config):
|
||||
api_key=p.api_key if p else "no-key",
|
||||
api_base=config.get_api_base(model) or "http://localhost:8000/v1",
|
||||
default_model=model,
|
||||
request_timeout_seconds=p.request_timeout_seconds if p else 600,
|
||||
)
|
||||
|
||||
# LiteLLM 通道:绝大多数 provider 走这里。
|
||||
@ -311,6 +315,7 @@ def _make_provider(config: Config):
|
||||
default_model=model,
|
||||
extra_headers=p.extra_headers if p else None,
|
||||
provider_name=provider_name,
|
||||
request_timeout_seconds=p.request_timeout_seconds if p else 600,
|
||||
)
|
||||
|
||||
|
||||
@ -387,6 +392,7 @@ def gateway(
|
||||
channels_config=config.channels,
|
||||
authz_config=config.authz,
|
||||
backend_identity=config.backend_identity,
|
||||
gateway_port=config.gateway.port,
|
||||
)
|
||||
|
||||
# 把 cron 执行回调绑定到 agent:定时触发时会走一次完整 agent 处理流程。
|
||||
@ -523,6 +529,7 @@ def web(
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
config = load_config()
|
||||
config.gateway.port = port
|
||||
_create_workspace_templates(config.workspace_path)
|
||||
|
||||
console.print(f"{__brand__}: starting web backend on {host}:{port}...")
|
||||
@ -596,6 +603,7 @@ def agent(
|
||||
channels_config=config.channels,
|
||||
authz_config=config.authz,
|
||||
backend_identity=config.backend_identity,
|
||||
gateway_port=config.gateway.port,
|
||||
)
|
||||
|
||||
# `_thinking_ctx` 统一封装“思考中”UI 的上下文管理器。
|
||||
@ -1217,6 +1225,7 @@ def cron_run(
|
||||
channels_config=config.channels,
|
||||
authz_config=config.authz,
|
||||
backend_identity=config.backend_identity,
|
||||
gateway_port=config.gateway.port,
|
||||
)
|
||||
|
||||
store_path = get_cron_store_path(config.workspace_path)
|
||||
|
||||
Reference in New Issue
Block a user