Merged
Conversation
…M e2e tests Backend: - SubAgent role-based routing with independent context/memory/model config - Inter-agent MessageBus (request/response/notify/broadcast) - CronScheduler (asyncio background task + croniter) with CronAgent execution - Complete execution logging for both SubAgent tasks and Cron jobs - New API endpoints: /sub-agents CRUD, /cron CRUD + executions - Session list API now returns model_name and channel - API endpoints properly commit DB transactions Frontend: - SessionsPage: searchable session list with model/message/time info - ChatPage meta panel: card-style tool/skill toggles, model badge, stats grid - Navigation: added Sessions entry - API types and hooks for SubAgents and Cron Tests: - 39 new unit tests (registry, message_bus, cron_manager) - 15 new integration tests (sub_agent + cron API) - 7 new e2e tests (LLM conversation, multi-turn, sessions page) - All 216 tests passing (195 unit/integration + 21 e2e) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
新增 cron_cli 内置工具,支持通过自然语言管理定时任务: - list: 列出所有定时任务(显示状态、下次执行时间) - create: 创建新任务(name/schedule/task_prompt) - update: 更新任务配置 - delete: 删除任务 - toggle: 启用/禁用任务 - history: 查看执行历史(最近 20 条) 技术实现: - 使用 ThreadPoolExecutor 在同步工具中运行异步代码 - 集成 CronManager 服务层 - 详细的用户提示和错误处理 - cron 表达式格式说明和示例 与现有系统集成: - 复用 services/cron_scheduler.py 的 CronManager - 遵循项目的异步代码模式 - 统一的错误返回格式(<error>) 使用示例: - cron_cli(action='list') - cron_cli(action='create', name='每日新闻', schedule='0 7 * * *', task_prompt='获取并总结新闻') - cron_cli(action='toggle', job_id='xxx', enabled=False)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 功能概述
添加
cron_cli内置工具,支持通过自然语言管理定时任务,完善定时任务系统的用户交互界面。✨ 主要特性
支持的操作
listcreateupdatedeletetogglehistory用户友好特性
'0 9 * * *'= 每天 09:00'*/30 * * * *'= 每 30 分钟'0 9 * * 1'= 每周一 09:00🔧 技术实现
异步代码集成
服务层集成
services/cron_scheduler.py的CronManagerflush(),API 层commit()<error>错误信息</error>参数设计
📦 文件变更
修改文件:
backend/agentpal/tools/builtin.py(+192 行)cron_cli工具函数BUILTIN_TOOLS列表🧪 测试建议
待添加:
手动测试清单:
📝 使用示例
通过工具调用
前端集成(待实现)
访问
/tools页面,启用cron_cli工具后,用户可在对话中直接使用:🔗 相关模块
services/cron_scheduler.py- CronManager 服务层models/cron.py- CronJob / CronJobExecution ORM 模型api/v1/endpoints/cron.py- RESTful API 端点agents/cron_agent.py- 定时任务执行 Agent🚀 后续优化
update操作修改enabled字段--verbose模式检查清单:
<error>格式)