Commit Graph

90 Commits

Author SHA1 Message Date
朱潮
dd6dfb7116 Merge branch 'master' into bot_manager 2026-03-16 13:32:36 +08:00
朱潮
32fd8c8656 shell_env支持 2026-03-16 13:31:59 +08:00
朱潮
786e7c2a07 Merge branch 'master' into bot_manager 2026-03-15 16:53:36 +08:00
朱潮
b8368068ae 心跳发送增加 15 秒间隔判断,发送后也更新 last_yield_time 2026-03-15 16:53:18 +08:00
朱潮
f7e8680472 merge from master 2026-03-14 22:03:23 +08:00
朱潮
0469ea2ecd 心跳输出格式改成json 2026-03-12 19:32:37 +08:00
朱潮
94471c90d8 添加心跳机制 2026-03-12 16:57:44 +08:00
朱潮
85cc57ce1a aupdate from_v2_request 新增 model_name、model_server、api_key 三个可选参数 2026-03-06 12:53:16 +08:00
朱潮
8264257ab6 现在 from_v2_request 的 model_name 和 model_server 优先级逻辑为:
1. 最高优先级:generate_cfg 中的 model / model_server(需不为空且不等于 whatever)
  2. 回退:bot_config 中的值(原有逻辑)
2026-03-06 12:47:33 +08:00
朱潮
c6641337c1 Merge branch 'master' into bot_manager 2026-03-05 15:39:59 +08:00
朱潮
4c74acaf18 chat.py:730 的 v2 接口 exclude_fields 现在与 v1 接口保持一致,补上了 'model', 'model_server', 'dataset_ids', 'system_prompt', 'mcp_settings',
'robot_type', 'enable_thinking', 'skills', 'enable_memory' 这些字段。
2026-03-05 15:08:09 +08:00
朱潮
f7773a93e1 Merge branch 'upgrade/deepagents-0.4.4' 2026-03-04 14:08:51 +08:00
朱潮
26905ad623 新增memory管理 2026-03-04 13:43:49 +08:00
朱潮
b3b6dd85d9 排查n参数 2026-03-04 09:57:36 +08:00
朱潮
5b29e866f2 现在 v1 和 v2 接口都支持传递额外参数了 2026-03-02 20:01:43 +08:00
朱潮
ba51bd3583 Merge branch 'upgrade/deepagents-0.4.4' into bot_manager 2026-03-02 15:27:44 +08:00
朱潮
186d2fe265 添加tmp脚本删除 2026-03-02 15:27:26 +08:00
朱潮
6365d65715 user_identifier 2026-02-27 00:21:06 +08:00
朱潮
742eaf0a1c remove robot_type 2026-02-08 00:04:39 +08:00
朱潮
e5ee24a765 create_project_directory 2026-02-07 23:59:05 +08:00
朱潮
1df52ca8d0 merge from prod 2026-02-06 22:07:47 +08:00
朱潮
c7e9f305b7 feat: 实现 Claude Plugins 模式的 Hook 机制
- 新增 agent/plugin_hook_loader.py:支持通过 .claude-plugin/plugin.json 配置 hooks 和 mcpServers
- 修改 agent/prompt_loader.py:集成 PrePrompt hooks,优先读取 skill MCP 配置
- 修改 routes/chat.py:添加 PostAgent 和 PreSave hooks
- 修改 routes/skill_manager.py:优先从 plugin.json 读取 name/description,fallback 到 SKILL.md
- 删除旧的 agent/skill_hook_loader.py
- 新增示例 skill user-context-loader,演示完整的 hooks 用法

Hook 类型:
- PrePrompt: 在 system_prompt 加载时注入内容
- PostAgent: 在 agent 执行后处理
- PreSave: 在消息保存前处理

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 20:15:54 +08:00
朱潮
e67d50b4fc rename general agent 2026-02-06 17:05:17 +08:00
朱潮
7e058e1505 Merge branch 'prod' into bot_manager 2026-02-04 17:54:42 +08:00
朱潮
2e429e82f7 remove summary output 2026-02-04 17:39:51 +08:00
朱潮
4c70857ff6 增加bot_manager 2026-01-28 23:32:34 +08:00
朱潮
f1107ea35a 增加enable_thinking和enable_memory 2026-01-28 17:13:41 +08:00
朱潮
f694101747 refactor: migrate from Memori to Mem0 for long-term memory
Replace Memori with Mem0 for memory management:
- Delete memori_config.py, memori_manager.py, memori_middleware.py
- Add mem0_config.py, mem0_manager.py, mem0_middleware.py
- Update environment variables (MEMORI_* -> MEM0_*)
- Integrate Mem0 with LangGraph middleware
- Add sync connection pool for Mem0 in DBPoolManager
- Move checkpoint message prep to config creation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 21:15:30 +08:00
朱潮
05744cb9f4 批量保存聊天记录 2026-01-19 09:44:57 +08:00
朱潮
3b438d8ab7 优化输出 2026-01-18 22:04:36 +08:00
朱潮
f9ba3c8e51 添加聊天记录查询 2026-01-18 12:29:20 +08:00
朱潮
723b249e42 增加2个系统级别的skill 2026-01-16 23:05:30 +08:00
朱潮
174a5e2059 deep_agent支持 checkpoint 2026-01-11 00:08:19 +08:00
朱潮
b3303ef8e6 refactor(sse): simplify error handling and remove __debug__ security issue
- Remove __debug__ conditional that exposed tracebacks in production
- Simplify error response structure to {"error": str(e)}
- Remove redundant exception handling in init_agent()
- Remove unnecessary traceback logging
- Reduce code from ~30 lines to ~10 lines

Fixes security vulnerability where __debug__ is always True
unless Python runs with -O flag, causing full tracebacks
to be sent to clients in production.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-07 20:24:30 +08:00
朱潮
8a85e9025e fix(sse): properly handle MCP tool errors and send error responses to client
- Enhance exception handling in agent_task() to capture and send structured error messages via SSE stream
- Add [DONE] marker to outer exception handler to ensure proper stream termination
- Improve MCP tool loading error handling in init_agent() to prevent cascading failures
- Add detailed error logging with traceback for debugging

Fixes RemoteProtocolError that occurred when MCP tool calls failed,
which previously caused incomplete chunked read errors and connection drops.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-07 19:24:28 +08:00
朱潮
766b9becda feat(deep-agent): add skills support and improve project structure
- Add skills parameter to ChatRequest for skill file processing
- Extract and unzip skill files to robot project skills directory
- Add robot_config.json with bot_id and environment variables
- Update symlink setup to skip if ~/.deepagents already exists
- Enhance system prompt with directory access restrictions
- Refactor _get_robot_dir to handle symlink paths correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 13:21:58 +08:00
朱潮
0e6b2f1511 add CHECKPOINT_DB_URL 2025-12-24 20:43:10 +08:00
朱潮
b86a8364e9 db 2025-12-24 11:05:10 +08:00
朱潮
d8dc973b95 sqlite pool and change agent cache to tools cache 2025-12-23 22:18:18 +08:00
朱潮
a92bea5b58 删除一些环境变量 2025-12-18 09:41:43 +08:00
朱潮
6bad1743b3 warm_up 2025-12-18 00:38:04 +08:00
朱潮
47f1d1c7eb cache 2025-12-17 23:05:42 +08:00
朱潮
b78b178c03 删除agent manager 2025-12-17 20:27:06 +08:00
朱潮
e36787fb63 修改agent_config 2025-12-16 21:26:20 +08:00
朱潮
de72321875 add safe_print 2025-12-16 16:28:11 +08:00
朱潮
9525c0f883 add AgentConfig 2025-12-16 16:06:47 +08:00
朱潮
77c8f5e501 settings 2025-12-15 21:58:54 +08:00
朱潮
9ada70eb58 session_id 2025-12-15 21:38:09 +08:00
朱潮
0d50cd8e9f session_id 2025-12-15 21:36:13 +08:00
朱潮
d9ee1edf8a 修复none值的问题 2025-12-15 17:38:27 +08:00