renjianbo
ab1589921a
fix: 修复35个安全与功能缺陷,补全知识进化/数字孪生/行为采集模块
...
## 安全修复 (12项)
- Webhook接口添加全局Token认证,过滤敏感请求头
- 修复JWT Base64 padding公式,防止签名验证绕过
- 数据库密码/飞书Token从源码移除,改为环境变量
- 工作流引擎添加路径遍历防护 (_resolve_safe_path)
- eval()添加模板长度上限检查
- 审批API添加认证依赖
- 前端v-html增强XSS转义,console.log仅开发模式输出
- 500错误不再暴露内部异常详情
## Agent运行时修复 (7项)
- 删除_inject_knowledge_context中未定义db变量的finally块
- 工具执行添加try/except保护,异常不崩溃Agent
- LLM重试计入budget计数器
- self_review异常时passed=False
- max_iterations截断标记success=False
- 工具参数JSON解析失败时记录警告日志
- run()开始时重置_llm_invocations计数器
## 配置与基础设施
- DEBUG默认False,SQL_ECHO独立配置项
- init_db()补全13个缺失模型导入
- 新增WEBHOOK_AUTH_TOKEN/SQL_ECHO配置项
- 新增.env.example模板文件
## 前端修复 (12项)
- 登录改用URLSearchParams替代FormData
- 401拦截器通过Pinia store统一清理状态
- SSE流超时从60s延长至300s
- final/error事件时清除streamTimeout
- localStorage聊天记录添加24h TTL
- safeParseArgCount替代模板中裸JSON.parse
- fetchUser 401时同时清除user对象
## 新增模块
- 知识进化: knowledge_extractor/retriever/tasks
- 数字孪生: shadow_executor/comparison模型
- 行为采集: behavior_middleware/collector/fingerprint_engine
- 代码审查: code_review_agent/document_review_agent
- 反馈学习: feedback_learner
- 瓶颈检测/优化引擎/成本估算/需求估算
- 速率限制器 (rate_limiter)
- Alembic迁移 015-020
## 文档
- 商业化落地计划
- 8篇docs文档 (架构/API/部署/开发/贡献等)
- Docker Compose生产配置
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-10 19:50:20 +08:00
renjianbo
926ec6c0a1
feat: add Main Agent core service, tools, and Celery tasks (Phase 2)
...
数字员工大脑 — Main Agent 核心实现:
- MainAgentService: 目标分解(LLM)、任务调度、进度监控、失败重试、自主循环
- 4个 Main Agent 专有工具: create_task / assign_task / check_progress / notify_user
- Celery 异步任务: decompose_goal / execute_goal / execute_task / autonomy_tick
- Goal API 增强: decompose / execute-async / replan 端点
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-08 19:58:53 +08:00
renjianbo
0606137d57
fix: schedule timezone bug + missing notifications + celery beat startup
...
- Timezone: compute_next_run now correctly interprets cron in the schedule's
configured timezone (e.g., "0 8 * * *" with Asia/Shanghai = 8AM Beijing, not UTC)
- Notifications: agent_tasks now reuses pre-created execution records and calls
notify_schedule_result on completion, so non-workflow agent schedules get
DB notifications + Feishu webhook + Feishu app messages
- Duplicate execution: execute_agent_task accepts optional execution_id to reuse
the record created by schedule_service instead of creating a second one
- Celery Beat: added to restart_backend_celery.ps1, stop_aiagent.ps1, and
docker-compose.dev.yml; fixed repo-root path resolution in all PS1 scripts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-05 08:57:00 +08:00
renjianbo
592bca4f39
feat: Phase 4 - LLM/Agent fallback chain, cross-agent knowledge sharing, async agent execution
...
- 4.1 Fallback chain: LLM fallback_llm config in AgentLLMConfig, retry with alternate model on API failure; Agent fallback_agent in DAG nodes
- 4.2 Knowledge sharing: GlobalKnowledge model with embedding-based semantic search, auto-extraction of tool names as tags after execution
- 4.3 Async execution: execute_agent_task fully implemented with AgentRuntime, scheduler dual-path for workflow/non-workflow agents
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-05 00:27:54 +08:00
renjianbo
7e00b027d4
feat: Phase 3 - parallel execution, progress reporting, result caching + AgentChat bug fixes
...
Phase 3 能力:
- DAG 并行执行 (workflow_engine): asyncio.gather 并行执行就绪节点
- Debate 并行 (orchestrator): for 循环改为 asyncio.gather
- 粒度进度上报 (workflow_engine + tasks + websocket): Redis 推送 + DB 降级
- 工具结果缓存 (tool_manager): 确定性工具默认开启缓存
- LLM 响应缓存 (core): messages[-4:] + model 哈希,5min TTL
AgentChat bug 修复 (Gitea #1-#5):
- #1 SSE 降级重复空消息: fallback POST 前移除占位消息
- #2 streamTimeout 泄漏: while 正常退出后 clearTimeout
- #3 loading 闪烁: final/error 事件中提前设 loading=false
- #4 SSE 事件类型对齐: 确认匹配,未知类型加 console.warn
- #5 retryMessage 流式残留: 重试时清理占位消息
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-05 00:00:51 +08:00
renjianbo
7ee80c74b2
feat: 集成飞书通知和机器人对话系统
...
- 新增通知系统 (notifications 表、服务、API)
- 新增飞书定时任务结果推送 (webhook + 应用消息)
- 新增飞书应用消息发送服务 (feishu_app_service)
- 新增飞书 WebSocket 长连接事件监听 (苹果应用)
- 新增飞书账号绑定/解绑 API
- 新增橙子飞书机器人 (独立 WS 连接,固定路由到橙子助手 Agent)
- 执行记录添加 schedule_id,用户添加飞书绑定字段
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-02 16:17:49 +08:00
renjianbo
0bbf68d5bb
feat: 实现 Agent 定时任务系统 — 按 cron 表达式周期执行 Agent
...
- 新增 AgentSchedule 模型、CRUD API、调度服务
- 集成 Celery Beat 每分钟检查到期任务并自动触发执行
- 支持手动触发、cron 表达式解析、执行状态跟踪
- 依赖: croniter (cron 表达式解析)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-02 12:14:37 +08:00
renjianbo
4366312946
feat: DeepSeek v4 模型对齐、作业助手脚本与 Agent 对比测试
...
- 前端 WorkflowEditor/ModelConfigs/NodeTemplates:deepseek-v4-flash、v4-pro,弃用提示
- llm_service 默认 deepseek-v4-flash;workflow_engine 等与模型配置注入
- 作业管理脚本支持 AGENT_NAME 与 v4-pro;新增 compare_homework_agents 脚本
- 文档重命名为 (红头)项目核心文档汇总.md 并更新 DeepSeek 说明
Made-with: Cursor
2026-04-30 00:57:13 +08:00
renjianbo
df4fab1e6e
feat: Agent 批量测试、作业助手与上传预览;Windows 启动脚本与文档- 新增 run_agent_test_cases 与示例 JSON、(红头)agent测试用例文档
...
- 扩展 test_agent_execution(--homework、UTF-8 控制台)
- 后端:uploads 预览、file_read、工作流与对话落盘等
- 前端:AgentChatPreview 与设计器相关调整
- 忽略 redis二进制、agent_workspaces、uploads、tessdata 等本机产物
Made-with: Cursor
2026-04-13 20:17:18 +08:00
renjianbo
0608161c82
feat: 完善企业场景多线路由与执行稳定性
...
补齐平台模板与场景 DSL、预算控制、执行看板和企业场景脚本,增强 Windows 启动/迁移与前端代理和聊天会话记忆,修复执行创建阶段 500 与异步链路排障体验。
Made-with: Cursor
2026-04-09 21:58:53 +08:00
renjianbo
bd3f8be781
feat: 工作流记忆与内置工具、知你客服脚本、Agent管理技能展示与能力配置、文档与Windows启动脚本;忽略 redis_temp 二进制目录
...
Made-with: Cursor
2026-04-08 11:44:24 +08:00
6674060f2f
第一次提交
2026-01-19 00:09:36 +08:00