Skip to content

Update provider-type to support multiple options#4854

Open
AlanBacker wants to merge 1 commit intoAstrBotDevs:masterfrom
AlanBacker:patch-1
Open

Update provider-type to support multiple options#4854
AlanBacker wants to merge 1 commit intoAstrBotDevs:masterfrom
AlanBacker:patch-1

Conversation

@AlanBacker
Copy link

@AlanBacker AlanBacker commented Feb 3, 2026

Added "agent_runner"

现在 在选择“选择供应商”中,可以找到Agent执行器类型了

Modifications / 改动点

dashboard/src/views/SubAgentPage.vue中第108行添加了agent_runner类型

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

image

Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

新功能:

  • 在子代理提供者选择器界面中,将代理运行器暴露为额外的提供者选项。
Original summary in English

Summary by Sourcery

New Features:

  • Expose agent runner as an additional provider option in the sub-agent provider selector UI.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 3, 2026
@dosubot
Copy link

dosubot bot commented Feb 3, 2026

Related Documentation

1 document(s) may need updating based on files changed in this PR:

AstrBotTeam's Space

pr4697的改动
View Suggested Changes
@@ -1,5 +1,4 @@
 ## 主动代理(Proactive Agent)系统增强使用说明
-
 本说明基于 [PR #4697](https://github.com/AstrBotDevs/AstrBot/pull/4697) 的更新,涵盖 AstrBot 主动代理系统的最新特性,包括 SubAgent 架构、FutureTask(定时任务)机制、send_message_to_user 工具、工具注册与配置、以及 UI/API 支持等。
 
 ---
@@ -7,14 +6,12 @@
 ### 1. SubAgent(子代理)架构
 
 #### 架构说明
-
 主动代理系统引入了 SubAgent(子代理)架构。主代理(MainAgent)专注于对话和任务委派,具体工具和任务由子代理(SubAgent)处理。这样可以有效避免 prompt 膨胀和调用失败。
 
 - 工具分配:每个 SubAgent 继承自 Persona,拥有独立的工具集、技能、名称和描述。主代理通过 `transfer_to_<subagent>` 工具将任务转交给指定子代理。
 - 任务流转:主代理负责任务分发,子代理专注于具体执行。子代理之间可通过 transfer 工具实现任务转移。
 
 #### 使用示例
-
 假设有两个子代理:`DataAgent` 和 `ReportAgent`,分别负责数据处理和报告生成。主代理收到用户请求后,可通过 `transfer_to_DataAgent` 工具将数据处理任务分配给 DataAgent,处理完成后再通过 `transfer_to_ReportAgent` 工具将结果交给 ReportAgent 生成报告。
 
 ```mermaid
@@ -25,7 +22,6 @@
 ```
 
 #### 配置说明
-
 SubAgent 的定义与 Persona 配置一致,需在配置文件中指定 tools、skills、name、description 等。工具分配通过 UI 或配置文件完成。
 
 ---
@@ -33,7 +29,6 @@
 ### 2. FutureTask(定时任务)机制
 
 #### 功能说明
-
 FutureTask(定时任务)机制允许主代理管理全局 Cron Job 列表,实现定时唤醒和自动执行任务。支持的平台包括 Telegram、Slack、Discord 等。
 
 - 两类定时任务:BasicCronJob(简单定时函数)和 ActiveAgentCronJob(主动代理任务)。
@@ -41,11 +36,9 @@
 - 触发机制:到达设定时间后,CronJobManager 调用 MainAgent 执行任务循环,自动完成预设操作。
 
 #### 使用场景示例
-
 用户可通过对话指令或 UI 创建定时任务,例如“每天早上8点发送今日早报”。主代理会注册一个 ActiveAgentCronJob,定时触发后自动执行相关脚本并通过 send_message_to_user 工具推送内容。
 
 #### 相关工具
-
 - `create_future_task`(原 create_cron_job):创建定时任务
 - `delete_future_task`:删除定时任务
 - `list_future_tasks`:列出所有定时任务
@@ -55,14 +48,12 @@
 ### 3. send_message_to_user 工具
 
 #### 功能说明
-
 `send_message_to_user` 工具支持主动向用户发送消息,包括文本和多媒体内容。该工具可与定时任务、后台任务等结合,实现主动推送。
 
 - 支持多平台:Telegram、Slack、Discord 等
 - 支持多媒体类型:文本、图片、文件等
 
 #### 使用示例
-
 在定时任务触发后,主动调用 `send_message_to_user` 工具,将生成的日报、图片或其他内容直接发送给用户。
 
 ---
@@ -70,11 +61,9 @@
 ### 4. 工具注册与配置加载
 
 #### 逻辑改进
-
 工具注册和配置加载逻辑已优化,确保子代理配置的正确性和工具的动态注册。FunctionTool 新增 `is_background_task` 属性,支持异步后台任务,任务创建后立即返回任务 ID,完成后自动通知主代理。
 
 #### 注意事项
-
 - 工具需在对应 SubAgent/Persona 配置中声明
 - 动态注册工具时需确保配置同步更新
 - 后台任务需正确设置 `is_background_task: true`
@@ -84,28 +73,25 @@
 ### 5. UI 和 API 支持
 
 #### 子代理管理页面
-
 Web UI 新增子代理管理页面(SubAgentPage.vue),支持:
 
 - 创建/编辑 SubAgent
 - Persona 选择与工具分配
 - 配置持久化
+- 供应商类型选择:现在支持在“选择供应商”下拉菜单中选择 `chat_completion` 和 `agent_runner` 类型,便于根据不同需求配置子代理的执行方式。
 
 #### 定时任务管理
-
 新增 Cron Job 管理页面(CronJobPage.vue),支持:
 
 - 查看、创建、编辑、删除定时任务
 - 查看任务描述、触发条件等详细信息
 
 #### API 支持
-
 新增 CronRoute 等 API 路由,支持通过 API 管理定时任务。
 
 ---
 
 ### 6. 其他优化
-
 - JWT 处理和错误处理机制增强,提升系统安全性和稳定性
 - UI 细节优化,提升用户体验
 - 日志与异常处理增强,便于问题追踪

[Accept] [Decline]

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?  Join Discord

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些高层次的反馈:

  • 如果 ProviderSelector 预期要处理多种 provider 类型,建议将 provider-type 修改为接受结构化的值(例如数组或枚举),而不是逗号分隔的字符串,以避免解析歧义和“魔法字符串”。
给 AI Agent 的提示
请根据本次代码评审中的评论进行修改:

## 总体评论
- 如果 `ProviderSelector` 预期要处理多种 provider 类型,建议将 `provider-type` 修改为接受结构化的值(例如数组或枚举),而不是逗号分隔的字符串,以避免解析歧义和“魔法字符串”。

Sourcery 对开源项目是免费的 —— 如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每一条评论上点 👍 或 👎,我会根据你的反馈改进之后的评审。
Original comment in English

Hey - I've left some high level feedback:

  • If ProviderSelector is expected to handle multiple provider types, consider changing provider-type to accept a structured value (e.g., an array or enum) instead of a comma-separated string to avoid parsing ambiguity and magic strings.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- If `ProviderSelector` is expected to handle multiple provider types, consider changing `provider-type` to accept a structured value (e.g., an array or enum) instead of a comma-separated string to avoid parsing ambiguity and magic strings.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot dosubot bot added the area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. label Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant