myagent-ai 1.23.57 → 1.23.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/myagent/scripts/cli.py +58 -6
- package/myagent/web/api_server.py +8 -1
- package/package.json +1 -1
- package/worklog.md +14 -462
package/myagent/scripts/cli.py
CHANGED
|
@@ -1089,14 +1089,66 @@ async def cmd_chat(args):
|
|
|
1089
1089
|
print("错误: 必须指定 --message 或 --file", file=sys.stderr)
|
|
1090
1090
|
sys.exit(1)
|
|
1091
1091
|
|
|
1092
|
-
#
|
|
1093
|
-
|
|
1092
|
+
# [v1.23.58] Agent 查找:先按路径查找,找不到则按名字模糊匹配
|
|
1093
|
+
agents_data_dir = Path(__file__).parent.parent / "data" / "agents"
|
|
1094
|
+
agent_dir = agents_data_dir / a.agent
|
|
1094
1095
|
cfg_file = agent_dir / "config.json"
|
|
1096
|
+
resolved_path = a.agent # 最终解析出的 Agent 路径
|
|
1097
|
+
|
|
1095
1098
|
if not cfg_file.exists():
|
|
1096
|
-
|
|
1097
|
-
|
|
1099
|
+
# 按路径找不到,尝试按名字模糊查找
|
|
1100
|
+
found = False
|
|
1101
|
+
if agents_data_dir.exists():
|
|
1102
|
+
for dept_dir in agents_data_dir.iterdir():
|
|
1103
|
+
if not dept_dir.is_dir():
|
|
1104
|
+
continue
|
|
1105
|
+
for ag_dir in dept_dir.iterdir():
|
|
1106
|
+
if not ag_dir.is_dir():
|
|
1107
|
+
continue
|
|
1108
|
+
cf = ag_dir / "config.json"
|
|
1109
|
+
if cf.exists():
|
|
1110
|
+
try:
|
|
1111
|
+
ag_cfg = json.loads(cf.read_text(encoding="utf-8"))
|
|
1112
|
+
ag_name = ag_cfg.get("name", "")
|
|
1113
|
+
# 精确匹配名字
|
|
1114
|
+
if ag_name == a.agent:
|
|
1115
|
+
resolved_path = ag_dir.relative_to(agents_data_dir).as_posix()
|
|
1116
|
+
found = True
|
|
1117
|
+
break
|
|
1118
|
+
except Exception:
|
|
1119
|
+
pass
|
|
1120
|
+
if found:
|
|
1121
|
+
break
|
|
1122
|
+
# 如果精确匹配也没找到,尝试部分匹配(路径末尾或名字包含)
|
|
1123
|
+
if not found:
|
|
1124
|
+
for dept_dir in agents_data_dir.iterdir():
|
|
1125
|
+
if not dept_dir.is_dir():
|
|
1126
|
+
continue
|
|
1127
|
+
for ag_dir in dept_dir.iterdir():
|
|
1128
|
+
if not ag_dir.is_dir():
|
|
1129
|
+
continue
|
|
1130
|
+
cf = ag_dir / "config.json"
|
|
1131
|
+
if cf.exists():
|
|
1132
|
+
try:
|
|
1133
|
+
ag_cfg = json.loads(cf.read_text(encoding="utf-8"))
|
|
1134
|
+
ag_name = ag_cfg.get("name", "")
|
|
1135
|
+
ag_rel = ag_dir.relative_to(agents_data_dir).as_posix()
|
|
1136
|
+
if ag_rel.endswith("/" + a.agent) or a.agent in ag_name:
|
|
1137
|
+
resolved_path = ag_rel
|
|
1138
|
+
found = True
|
|
1139
|
+
break
|
|
1140
|
+
except Exception:
|
|
1141
|
+
pass
|
|
1142
|
+
if found:
|
|
1143
|
+
break
|
|
1144
|
+
if not found:
|
|
1145
|
+
print(f"错误: Agent 不存在: {a.agent}(请使用 Agent 路径/ID,而非名字。例如: myagent-ai chat --agent 部门名/Agent名 --message \"消息\")", file=sys.stderr)
|
|
1146
|
+
sys.exit(1)
|
|
1147
|
+
|
|
1148
|
+
agent_dir = agents_data_dir / resolved_path
|
|
1149
|
+
cfg_file = agent_dir / "config.json"
|
|
1098
1150
|
cfg = json.loads(cfg_file.read_text(encoding="utf-8"))
|
|
1099
|
-
agent_name = cfg.get("name",
|
|
1151
|
+
agent_name = cfg.get("name", resolved_path)
|
|
1100
1152
|
|
|
1101
1153
|
# 验证文件是否存在
|
|
1102
1154
|
files_info = ""
|
|
@@ -1124,7 +1176,7 @@ async def cmd_chat(args):
|
|
|
1124
1176
|
# Output chat marker
|
|
1125
1177
|
# 格式: __CHAT_AGENT__agent_path|agent_name|message|files__END__
|
|
1126
1178
|
# files 为空字符串时表示纯文本消息
|
|
1127
|
-
print(f"__CHAT_AGENT__{
|
|
1179
|
+
print(f"__CHAT_AGENT__{resolved_path}|{agent_name}|{a.message}|{files_info}__END__")
|
|
1128
1180
|
|
|
1129
1181
|
|
|
1130
1182
|
async def cmd_zip(args):
|
|
@@ -7892,6 +7892,10 @@ window.addEventListener('beforeunload', function() {{
|
|
|
7892
7892
|
- @所有人 / @all: 所有成员都需要回复
|
|
7893
7893
|
- 不@任何人(广播): 你自行判断是否需要回复
|
|
7894
7894
|
2. **跨Agent私下沟通**: 你可以使用 `myagent-ai chat --agent <路径> --message "消息"` 命令向群内其他Agent发送私下消息。对方会在自己下次处理消息时收到。
|
|
7895
|
+
- **⚠️ 必须使用 Agent 路径(ID),不能用名字!** 例如群成员列表中显示 `薇纸 [五香鸡/薇纸] (成员)`,则路径是 `五香鸡/薇纸`,不是 `薇纸`
|
|
7896
|
+
- 从上方「群成员列表」中找到目标Agent的 `[方括号]` 内容就是它的路径
|
|
7897
|
+
- 正确示例: `myagent-ai chat --agent 五香鸡/薇纸 --message "你好"`
|
|
7898
|
+
- 错误示例: `myagent-ai chat --agent 薇纸 --message "你好"`(名字可能重复或找不到)
|
|
7895
7899
|
- 私下沟通的内容不会直接显示给用户,适合讨论细节、交换数据、协调方案
|
|
7896
7900
|
- 当任务需要多个Agent协作时,应该先在群里讨论分工,然后私下沟通具体细节
|
|
7897
7901
|
3. **协作分工模式**(复杂任务):
|
|
@@ -7908,7 +7912,8 @@ window.addEventListener('beforeunload', function() {{
|
|
|
7908
7912
|
- 你只代表你自己发言,使用第一人称
|
|
7909
7913
|
- 不要假装是其他Agent或代替其他Agent回答
|
|
7910
7914
|
- 如果问题超出你的能力范围,建议用户@相关专家Agent
|
|
7911
|
-
- 如果需要其他Agent的信息,使用 `myagent-ai chat
|
|
7915
|
+
- 如果需要其他Agent的信息,使用 `myagent-ai chat --agent <路径>` 命令私下沟通
|
|
7916
|
+
**注意:--agent 参数必须使用路径(ID),不是名字!从群成员列表的[方括号]中获取路径**
|
|
7912
7917
|
|
|
7913
7918
|
### 能力提醒(关键)
|
|
7914
7919
|
- 你拥有完整的工具调用能力(搜索、文件操作、代码执行、图片生成等)
|
|
@@ -8275,6 +8280,7 @@ window.addEventListener('beforeunload', function() {{
|
|
|
8275
8280
|
+ "\n".join(member_lines)
|
|
8276
8281
|
+ "\n\n注意:你只代表自己发言,回复时使用第一人称。"
|
|
8277
8282
|
"如果消息不是跟你相关的,可以简短回复或不回复。"
|
|
8283
|
+
"\n向其他Agent发消息时必须使用路径(ID),不是名字。从成员列表的[方括号]中获取路径。"
|
|
8278
8284
|
)
|
|
8279
8285
|
|
|
8280
8286
|
if agent_system_prompt:
|
|
@@ -8438,6 +8444,7 @@ window.addEventListener('beforeunload', function() {{
|
|
|
8438
8444
|
+ "\n".join(member_lines)
|
|
8439
8445
|
+ "\n\n注意:你只代表自己发言,回复时使用第一人称。"
|
|
8440
8446
|
"如果消息不是跟你相关的,可以简短回复或不回复。"
|
|
8447
|
+
"\n向其他Agent发消息时必须使用路径(ID),不是名字。从成员列表的[方括号]中获取路径。"
|
|
8441
8448
|
)
|
|
8442
8449
|
|
|
8443
8450
|
if agent_system_prompt:
|
package/package.json
CHANGED
package/worklog.md
CHANGED
|
@@ -1,469 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
Task ID: 1
|
|
3
|
-
Agent: Main Agent
|
|
4
|
-
Task: 移动端多项UI修复
|
|
5
|
-
|
|
6
|
-
Work Log:
|
|
7
|
-
- 分析了 chat_main.js, chat.css, right_agents.html, left_sessions.html, index.html, groupchat.js 等文件
|
|
8
|
-
- 定位并修复了 newChat() 不关闭移动端侧边栏的问题
|
|
9
|
-
- 定位并修复了 quickChatAgent() 和 selectGroup() 不关闭移动端右侧栏的问题
|
|
10
|
-
- 定位了右侧agent面板在collapsed状态下,mobile CSS的 display:flex!important 缺少 flex-direction:column 导致内容横向排列的bug
|
|
11
|
-
- 修复了移动端collapsed状态下版本号/更新信息被 display:none 隐藏的问题
|
|
12
|
-
- 对admin后台(index.html)的sidebar-footer-text在移动端collapsed+mobile-open状态下也做了显示修复
|
|
13
|
-
- 版本号bump: CSS v3→v4, JS v2→v3
|
|
14
|
-
|
|
15
|
-
Stage Summary:
|
|
16
|
-
- 修改文件: web/ui/chat/chat.css, web/ui/chat/chat_main.js, web/ui/chat/groupchat.js, web/ui/index.html, web/ui/chat/chat_container.html
|
|
17
|
-
- 已 commit & push (4ec4726)
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
Task ID: 2
|
|
21
|
-
Agent: Main Agent
|
|
22
|
-
Task: 修复聊天消息排版混乱和脚本注入漏洞
|
|
23
|
-
|
|
24
|
-
Work Log:
|
|
25
|
-
- 分析了 renderMarkdown() 函数,发现所有 markdown 转换(行内代码、粗体、斜体、列表、引用块)均未对内容进行 HTML 转义
|
|
26
|
-
- 发现漏洞:agent 回复中的 HTML 标签可以执行 JavaScript(XSS),也可以破坏页面布局(如注入未闭合的 div)
|
|
27
|
-
- 实现了 3 层防护:
|
|
28
|
-
1. renderMarkdown() 重写:先提取代码块为占位符 → escapeHtml() 转义所有 HTML → 应用 markdown 转换 → 还原代码块
|
|
29
|
-
2. CSS 容器隔离:message-bubble / group-msg-bubble / thought-content / msg-timeline 添加 overflow:hidden 防溢出
|
|
30
|
-
3. 代码块 pre 添加 max-width:100% + white-space:pre-wrap 防止代码块撑破容器
|
|
31
|
-
- 确认了 flow_engine.js 中的 renderInlineExecEvent()、showExecResultModal()、showToolResultModal() 均已正确使用 escapeHtml()
|
|
32
|
-
- 版本号 bump: 1.8.5 → 1.8.6, CSS v4→v5, JS v3→v4
|
|
33
|
-
|
|
34
|
-
Stage Summary:
|
|
35
|
-
- 修改文件: web/ui/chat/chat_main.js, web/ui/chat/chat.css, package.json, web/ui/chat/chat_container.html, web/ui/chat/chat.js
|
|
36
|
-
- 修复了 XSS 漏洞和排版破坏问题
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
Task ID: 1
|
|
40
|
-
Agent: main
|
|
41
|
-
Task: 部门Agent管理 + 工具调用保存 + 会话分页加载 (v1.9.0)
|
|
42
|
-
|
|
43
|
-
Work Log:
|
|
44
|
-
- 拉取最新代码 (git pull --rebase)
|
|
45
|
-
- 修改 web/ui/index.html: 部门详情页 showDeptDetail() 新增Agent成员管理面板(添加/移除)
|
|
46
|
-
- 修改 web/ui/index.html: renderDeptTree() 显示成员数量标签
|
|
47
|
-
- 修改 web/ui/index.html: openCreateAgentModal() 新增部门选择下拉框
|
|
48
|
-
- 修改 web/ui/index.html: openEditAgentModal() 部门选择支持子部门路径
|
|
49
|
-
- 修改 web/ui/index.html: 新增 _flattenDepts() 辅助函数
|
|
50
|
-
- 修改 web/ui/index.html: viewSession() 改为分页加载 + 工具调用折叠显示
|
|
51
|
-
- 修改 web/api_server.py: handle_create_agent 支持 department 字段
|
|
52
|
-
- 修改 web/api_server.py: handle_update_agent allowed_fields 添加 department
|
|
53
|
-
- 修改 web/api_server.py: handle_get_messages/handle_get_messages_query 支持 limit/offset 分页
|
|
54
|
-
- 修改 agents/main_agent.py: 处理完成后保存执行事件为 role=tool 短期记忆
|
|
55
|
-
- 修改 memory/manager.py: get_conversation 默认 limit 从50提升到500
|
|
56
|
-
- 修改 web/ui/chat/chat_main.js: selectSession 不再过滤 tool 角色
|
|
57
|
-
- 修改 web/ui/chat/chat_main.js: _renderMessagesInner 新增 tool 角色折叠显示
|
|
58
|
-
- 版本号升级到 1.9.0
|
|
59
|
-
- git commit + git push 成功
|
|
60
|
-
- npm publish 失败(登录凭证过期)
|
|
61
|
-
|
|
62
|
-
Stage Summary:
|
|
63
|
-
- 部门管理现在可以添加/移除Agent成员
|
|
64
|
-
- 创建和编辑Agent时可以指定所属部门(支持子部门)
|
|
65
|
-
- 工具调用过程现在会保存为role=tool的短期记忆
|
|
66
|
-
- 会话消息API支持分页(limit/offset参数)
|
|
67
|
-
- 聊天页面和管理后台都能查看工具调用过程
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
Task ID: 1
|
|
71
|
-
Agent: Main Agent
|
|
72
|
-
Task: 修复 V2 finish回调逻辑 + 轻量测试服务验证
|
|
73
|
-
|
|
74
|
-
Work Log:
|
|
75
|
-
- 分析 _process_v2_inner 中的 V2 循环逻辑,发现 finish 检查位置错误
|
|
76
|
-
- 原逻辑: Step 10 先检查 finish=true 直接 break(工具不执行),Step 11 工具执行后只看 need_callback
|
|
77
|
-
- 修复后: Step 10 先执行工具 → Step 12 工具执行完检查 finish(优先级最高)→ 再检查 need_callback
|
|
78
|
-
- 提交 58be408 并推送到远程仓库
|
|
79
|
-
- 搭建轻量 HTTP 测试服务器 (server.py),使用 ModelScope API 直接验证 V2 全链路
|
|
80
|
-
- 运行 3 个测试场景全部通过:
|
|
81
|
-
1. 搜索场景: finish=false, callback=false → no_callback(正确)
|
|
82
|
-
2. 问候场景: finish=true, 有工具 → finish_after_tools(修复验证)
|
|
83
|
-
3. 机票场景: finish=true, askuser非空 → ask_user(正确)
|
|
84
|
-
|
|
85
|
-
Stage Summary:
|
|
86
|
-
- 关键修复: finish 标志是最终决策者,优先级高于工具级 callback
|
|
87
|
-
- finish=true → 即使工具 callback=true 也不回调 LLM
|
|
88
|
-
- finish=false → 根据工具 callback 标志决定是否回调
|
|
89
|
-
- 测试服务器文件: /home/z/my-project/download/v2-test-server/server.py
|
|
90
|
-
- 所有更改已推送至 ctz168/myagent main 分支
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
Task ID: stream-test
|
|
94
|
-
Agent: main
|
|
95
|
-
Task: 使用轻量测试环境对前后端流式输出进行全面测试
|
|
96
|
-
|
|
97
|
-
Work Log:
|
|
98
|
-
- 分析项目架构:LLM客户端(chat_stream)、前端(flow_engine.js SSE)、API服务(handle_chat_stream)
|
|
99
|
-
- 发现 test/server.py 仅有非流式 /api/chat 端点,前端使用标准 fetch JSON 响应
|
|
100
|
-
- 升级 test/server.py:新增 /api/chat/stream SSE 流式端点,支持 7 种事件类型
|
|
101
|
-
- 升级 test/index.html:新增流式 Agent 循环标签页,实时渲染 text_delta/v2_tool/v2_parse 等事件
|
|
102
|
-
- 发现并修复 core/llm.py _stream_openai 的 AsyncOpenAI 流式迭代 bug (coroutine is not iterable)
|
|
103
|
-
- 验证单轮迭代:1+1 简短回答,25 chunks,TTFT=13.5s,parse_success=true
|
|
104
|
-
- 验证多轮迭代:天气查询→工具执行→回调→二次处理,2 轮迭代,123 SSE 事件,finish 正确
|
|
105
|
-
- 运行单元测试:output_parser(get_knowledge)、context_builder(knowledge) 全部通过
|
|
106
|
-
|
|
107
|
-
Stage Summary:
|
|
108
|
-
- SSE 流式端点 /api/chat/stream 完整实现,支持 7 种事件类型
|
|
109
|
-
- 前端流式渲染面板,含 TTFT 统计、自动滚动、停止按钮
|
|
110
|
-
- 修复 core/llm.py AsyncOpenAI 流式调用关键 bug
|
|
111
|
-
- 代码已推送到 origin/main (commit ce63c16)
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
Task ID: 1
|
|
115
|
-
Agent: main
|
|
116
|
-
Task: 测试前端输入"你好"后无回复的问题,验证前后端流式通信
|
|
117
|
-
|
|
118
|
-
Work Log:
|
|
119
|
-
- 启动 test/server.py 测试服务器,验证 /api/health 正常
|
|
120
|
-
- 用 curl 直接测试 /api/chat/stream SSE 端点,确认后端流式输出正常
|
|
121
|
-
- 用 Python 直接调用 event_generator 确认 SSE 事件完整(session/iteration_start/text_delta/v2_parse/v2_task_plan/v2_ask/iteration_end/done)
|
|
122
|
-
- 发现 uvicorn 后台进程容易被 shell 退出时杀死,影响测试稳定性
|
|
123
|
-
- 编写 test_e2e_runner.py 自包含 E2E 测试脚本(自动启停服务器+Playwright)
|
|
124
|
-
- 运行 Playwright 流式测试:PASS(7个事件渲染,0错误,43个SSE事件,8.6s完成)
|
|
125
|
-
- 运行 Playwright 非流式测试:PASS(1次迭代成功)
|
|
126
|
-
- 用 VLM 视觉分析截图确认前端 UI 渲染正确
|
|
127
|
-
- 更新 test_automated.py 新增流式SSE浏览器测试用例
|
|
128
|
-
- 更新测试说明.md 增加流式API和E2E测试文档
|
|
129
|
-
- 推送代码到 GitHub: 2ce96cc
|
|
130
|
-
|
|
131
|
-
Stage Summary:
|
|
132
|
-
- 前后端流式通信完全正常,用户遇到的"无回复"很可能是服务器未启动或提前崩溃
|
|
133
|
-
- SSE 流式输出验证通过:43个chunk,完整的 8 种事件类型
|
|
134
|
-
- E2E 测试工具链已就绪:test_e2e_runner.py 一键运行
|
|
135
|
-
- 截图保存在 /home/z/my-project/download/stream_test_result.png
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
Task ID: 1
|
|
139
|
-
Agent: Main Agent
|
|
140
|
-
Task: 修复前端V2模式下"无回复"和刷新后排版断裂问题
|
|
141
|
-
|
|
142
|
-
Work Log:
|
|
143
|
-
- 分析 flow_engine.js sendMessage() 的 SSE 事件处理流程
|
|
144
|
-
- 发现根因:V2模式下 text_delta 事件包含原始XML(<output><usersays_correct>...),被当作用户可见内容
|
|
145
|
-
- 发现根因:最终 content 仅从 msgParts.filter(p.type==='text') 组装,但 V2 的用户文本来自 v2_reasoning/v2_ask_user 事件
|
|
146
|
-
- 发现根因:flushCurrentText() 在 V2 模式下将原始 XML 推入 msgParts,导致 content 是原始标签而非中文文本
|
|
147
|
-
- 新增 _isV2Mode 标志位(通过 v2_context 事件激活)
|
|
148
|
-
- 新增 _v2RawXml 分离存储(V2模式下 text_delta 不再混入 msgParts)
|
|
149
|
-
- 新增 _assembleV2Content() 函数,按优先级组装最终内容:v2_reasoning > _askUser > V1 text parts > server content > '(无回复)'
|
|
150
|
-
- 修复 flushCurrentText() 在 V2 模式下不将 raw XML 推入 msgParts
|
|
151
|
-
- 修复 text_delta handler:V2模式下显示 v2_reasoning 文本而非原始XML
|
|
152
|
-
- 修复 v2_reasoning handler:多事件间添加 \n\n 分隔符,同时更新 content 和 _streamingText
|
|
153
|
-
- 修复 done/finalization handler:使用 _assembleV2Content() 替代旧的 filter+join 逻辑
|
|
154
|
-
- 修复 queue_start/clear_text handler:同样使用 _assembleV2Content()
|
|
155
|
-
- 所有旧式 "msgParts.filter(p=>p.type==='text').join('\\n\\n') || '(无回复)'" 已替换为 _assembleV2Content()
|
|
156
|
-
|
|
157
|
-
Stage Summary:
|
|
158
|
-
- 修改文件: web/ui/chat/flow_engine.js
|
|
159
|
-
- 核心修复:V2模式用户可见内容现在来自 v2_reasoning/v2_ask_user 事件,不再显示原始XML
|
|
160
|
-
- 后向兼容:V1模式行为不变(text_delta 仍然是用户可见内容)
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
Task ID: 3
|
|
164
|
-
Agent: Main Agent
|
|
165
|
-
Task: 修复聊天页面三个渲染Bug + web_search结果传递给LLM的问题
|
|
166
|
-
|
|
167
|
-
Work Log:
|
|
168
|
-
- **web_search结果传递问题**: 定位到 _extract_tool_output() 函数优先返回 message 摘要("找到16条结果")而忽略 data 字段中的URL。修复: 新增 _format_data_for_llm() 智能格式化函数,优先处理 data 字段;增大搜索类工具输出截断限制到6000字符
|
|
169
|
-
- **推理框闪烁**: 推理块(thought-block)每次 throttledStreamUpdate(~12fps)都用 outerHTML 完全重建,包括 renderMarkdown() 重渲染全部内容。修复: 改为增量更新——只更新字数统计/badge,用 insertAdjacentHTML 追加新增文本
|
|
170
|
-
- **消息位置错乱**: updateStreamingMessage() 通过计算 .assistant 行找目标消息,但 msgIdx 是全局索引(含user/tool行),导致匹配错位。修复: 改为计算所有 .message-row 行来匹配 msgIdx
|
|
171
|
-
- **聊天历史显示XML**: 后端存储了 LLM 原始 XML 输出(key=llm_output)到数据库,刷新后前端加载显示裸XML。修复:
|
|
172
|
-
- 后端 api_server.py: handle_get_messages/query 过滤掉 _HIDDEN_KEYS = {llm_output, tool_call, tool_result}
|
|
173
|
-
- 前端 chat_main.js: selectSession/loadMoreMessages 加载时对 XML 内容执行 _stripXmlTags 清理
|
|
174
|
-
|
|
175
|
-
Stage Summary:
|
|
176
|
-
- 修改文件: agents/main_agent.py, web/ui/chat/flow_engine.js, web/ui/chat/chat_main.js, web/api_server.py
|
|
177
|
-
- agents/main_agent.py: _extract_tool_output() 重写 + _format_data_for_llm() + 截断限制增大
|
|
178
|
-
- flow_engine.js: 推理框增量更新、消息索引修正
|
|
179
|
-
- chat_main.js: 消息加载时XML清理
|
|
180
|
-
- api_server.py: 聊天历史API过滤内部键
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
Task ID: 2
|
|
184
|
-
Agent: Main Agent
|
|
185
|
-
Task: v1.15.3 - 修复 LLM 调用 400 错误 (缺少 user role 消息)
|
|
186
|
-
|
|
187
|
-
Work Log:
|
|
188
|
-
- 定位根因: main_agent.py 的 _process_v2_inner() 在构建 LLM 消息时,首次迭代(无工具输出)只发送了 system 消息,缺少 role=user 的消息
|
|
189
|
-
- OpenAI 兼容 API 要求消息列表中至少包含一条 role=user 的消息,否则返回 400 错误
|
|
190
|
-
- 修复: 在 else 分支中,当 all_tool_outputs 为空时,追加一条 role=user 的消息,内容为 context.user_message 或默认文本 "请处理上述上下文。"
|
|
191
|
-
- 额外改进: LLM 调用失败时将错误信息保存到会话记忆,刷新后仍可见
|
|
192
|
-
|
|
193
|
-
Stage Summary:
|
|
194
|
-
- 修改文件: agents/main_agent.py, package.json
|
|
195
|
-
- version: 1.15.2 → 1.15.3
|
|
196
|
-
- 核心修复: 确保每次 LLM 调用的 messages 数组始终包含 role=user 消息
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
Task ID: 3
|
|
200
|
-
Agent: Main Agent
|
|
201
|
-
Task: v1.15.4 - 四项前端修复 (流式MD渲染/工具详情/推理持久化/滚动持久化)
|
|
202
|
-
|
|
203
|
-
Work Log:
|
|
204
|
-
- 修复流式输出时未闭合代码块显示裸MD: 改写 renderMarkdown() 的 Step 1.5,检测最后一个未闭合的 ``` 开头,将其内容渲染为带 streaming-code-block 样式的代码块(左边框脉动动画)
|
|
205
|
-
- 修复工具执行详情按钮点击无效: 所有 showToolResultModal/showExecResultModal 的 onclick 中 eventId 未加引号,字符串ID无法作为JS标识符传递。统一添加引号,匹配逻辑改为 String(e.id) === String(eventId)
|
|
206
|
-
- 修复刷新后推理过程丢失:
|
|
207
|
-
- LLMResponse 新增 reasoning 字段,_call_llm_stream 返回 full_reasoning
|
|
208
|
-
- main_agent.py 将推理文本以 key=reasoning 保存到会话记忆
|
|
209
|
-
- 前端 groupHistoryMessages 识别 key=reasoning 消息,合并到分组消息的 reasoning 字段
|
|
210
|
-
- 修复滚动位置不持久化:
|
|
211
|
-
- 新增 saveScrollPosition()/restoreScrollPosition() 函数
|
|
212
|
-
- 滚动事件触发防抖保存
|
|
213
|
-
- saveUIState() 中立即保存(beforeunload 时)
|
|
214
|
-
- selectSession() 渲染后恢复滚动位置
|
|
215
|
-
|
|
216
|
-
Stage Summary:
|
|
217
|
-
- 修改文件: package.json, core/llm.py, agents/base.py, agents/main_agent.py, web/ui/chat/chat_main.js, web/ui/chat/flow_engine.js, web/ui/chat/chat.css
|
|
218
|
-
- version: 1.15.3 → 1.15.4
|
|
219
|
-
- 核心修复: 流式Markdown渲染、工具详情弹窗、推理过程持久化、滚动位置持久化
|
|
220
|
-
|
|
221
|
-
---
|
|
222
|
-
Task ID: 4
|
|
223
|
-
Agent: Main Agent
|
|
224
|
-
Task: v1.15.5 - 推理框宽度/finish_reason显示/TTS播报/STT自动安装
|
|
225
|
-
|
|
226
|
-
Work Log:
|
|
227
|
-
- 修复推理过程框文本宽度: thought-content 添加 box-sizing:border-box,子元素 p/pre 添加 width:100%;max-width:100%;box-sizing:border-box,message-content 内联样式补全 width:100%
|
|
228
|
-
- 实现 finish_reason 展示: v2_output_parsed 事件中 finish=true 时,将 finish_reason 存到 msg._v2FinishReason;渲染时在 taskPlan 之后显示绿色左边框标签;流式更新时动态插入 DOM
|
|
229
|
-
- 实现 finish_reason TTS/通知逻辑:
|
|
230
|
-
- TTS 未在播报且已开启 → 调用 ttsManager.speakText() 直接播报
|
|
231
|
-
- TTS 正在播报 → 弹出带双音提示音的通知窗口(5秒自动关闭)
|
|
232
|
-
- TTS 未开启 → 仅在消息中显示文字
|
|
233
|
-
- 新增 ttsManager.speakText() 方法: 支持直接传入文本进行 TTS 播报(不依赖消息索引)
|
|
234
|
-
- 新增 _showFinishNotification() 函数: 双音提示 + 弹窗通知
|
|
235
|
-
- 修复 STT 安装问题:
|
|
236
|
-
- deps_checker.py 添加 faster-whisper 依赖项(category=stt)
|
|
237
|
-
- deps_checker.py category_map 添加 stt 映射
|
|
238
|
-
- start.js CORE_PACKAGES 添加 faster-whisper
|
|
239
|
-
- api_server.py handle_voice_stt 的 ImportError 处理中添加自动安装逻辑(ensure_skill_deps)
|
|
240
|
-
- 前端错误提示改为友好信息
|
|
241
|
-
|
|
242
|
-
Stage Summary:
|
|
243
|
-
- 修改文件: package.json, core/deps_checker.py, web/api_server.py, web/ui/chat/chat_main.js, web/ui/chat/flow_engine.js, web/ui/chat/chat.css, start.js
|
|
244
|
-
- version: 1.15.4 → 1.15.5
|
|
245
|
-
- 核心修复: 推理框宽度、finish_reason展示+TTS播报、STT自动安装
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
Task ID: 5
|
|
249
|
-
Agent: Main Agent
|
|
250
|
-
Task: v1.15.5 后续修复 — 弹出窗口链接、部门侧栏、成员数、后台部门详情
|
|
251
|
-
|
|
252
|
-
Work Log:
|
|
253
|
-
- 修复弹出窗口(popout)链接错误: new URL('.', ...).href + 'chat/...' 导致双路径问题,改为 window.location.origin + '/ui/chat/chat_container.html'
|
|
254
|
-
- 修复右侧边栏部门点击不展开: renderRpDeptNode 的 .rp-dept-item div 添加 onclick="toggleRpDept()",点击部门名称即可展开/折叠显示 agent 列表
|
|
255
|
-
- 部门名称后始终显示成员数: 之前仅在 agentCount > 0 时显示,改为始终显示 "(N成员)" 标签(chat_main.js 右侧面板、renderDeptItem、admin renderDeptTree)
|
|
256
|
-
- 修复后台部门成员数不准: departments/manager.py get_dept() 方法返回结果补充 agent_count 字段(动态计算 len(meta.agents))
|
|
257
|
-
- 重构后台部门详情弹窗(index.html showDeptDetail):
|
|
258
|
-
- 保存/关闭按钮移至页面最底部(justify-content:flex-end)
|
|
259
|
-
- 成员列表改为行列表样式(每行带背景、emoji、名称、部长标签、删除按钮)
|
|
260
|
-
- 删除按钮从 × 改为明显的"删除"文字按钮(btn-danger 样式)
|
|
261
|
-
- 暂无成员时显示带虚线边框的空状态提示
|
|
262
|
-
|
|
263
|
-
Stage Summary:
|
|
264
|
-
- 修改文件: web/ui/chat/chat_main.js, web/ui/index.html, departments/manager.py
|
|
265
|
-
- version: 1.15.5 (unchanged, cumulative fixes)
|
|
266
|
-
- 核心修复: popout链接、部门点击展开、成员数显示、后台部门详情弹窗布局
|
|
267
|
-
|
|
268
|
-
---
|
|
269
|
-
Task ID: 6
|
|
270
|
-
Agent: Main Agent
|
|
271
|
-
Task: context_window 从配置动态读取,不再硬编码 128000
|
|
272
|
-
|
|
273
|
-
Work Log:
|
|
274
|
-
- 发现 context_builder.py:738 硬编码 window=128000,完全忽略了模型配置的 context_window
|
|
275
|
-
- LLMClient.__init__ 新增 context_window 参数(默认 128000)
|
|
276
|
-
- main.py 创建 LLMClient 时传入 context_window=llm_cfg.context_window
|
|
277
|
-
- ContextBuilder.__init__ 新增 context_window 参数,_enforce_token_budget() 改用 self.context_window
|
|
278
|
-
- init_context_builder() 自动从 self.llm.context_window 读取并传给 ContextBuilder
|
|
279
|
-
- _hot_reload_llm() 新增 context_window 同步到所有 agent 的 context_builder
|
|
280
|
-
- _build_model_chain() 在模型链字典中加入 context_window 字段
|
|
281
|
-
- _try_model_chain_inner/_stream_inner 切换模型时同步 context_window 到 context_builder
|
|
282
|
-
- _try_model_chain_inner/_stream_inner 的 finally 恢复原始 context_window
|
|
283
|
-
- get_llm_client() 工厂函数传入 context_window
|
|
284
|
-
|
|
285
|
-
Stage Summary:
|
|
286
|
-
- 修改文件: core/llm.py, core/context_builder.py, main.py, agents/main_agent.py, web/api_server.py
|
|
287
|
-
- version: 1.15.5 → 1.15.6
|
|
288
|
-
- 核心修复: context 截断现在根据模型配置中的 context_window 动态调整,不再硬编码 128000
|
|
289
|
-
- 影响范围: 启动初始化、热重载、模型链切换(含 fallback)都会正确同步 context_window
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
Task ID: 7
|
|
293
|
-
Agent: Main Agent
|
|
294
|
-
Task: knowledge写入隔离 + 注释聊天历史注入
|
|
295
|
-
|
|
296
|
-
Work Log:
|
|
297
|
-
- 发现 _save_knowledge_to_base() 总是写入 organization/knowledge/auto_knowledge/,导致所有 agent 知识混在一起
|
|
298
|
-
- 修改 _save_knowledge_to_base() 优先写入 agent_knowledge_dir(agent 专属目录),无 agent KB 时才回退 knowledge_base_dir(组织 KB)
|
|
299
|
-
- 注释掉 build_context() 中的 _build_recent_dialog() 调用,不再注入 <resentdialog> 聊天历史
|
|
300
|
-
- 现在上下文仅包含:datetime + whoami + automemory + recall_memory + knowledge + user_input + task_plan + tools
|
|
301
|
-
- 用户最新消息通过 messages[role=user] 直接传入 LLM,工具执行结果通过 all_tool_outputs 传入
|
|
302
|
-
|
|
303
|
-
Stage Summary:
|
|
304
|
-
- 修改文件: agents/main_agent.py, core/context_builder.py
|
|
305
|
-
- version: 1.15.6 (cumulative)
|
|
306
|
-
- 核心修复: knowledge 写入隔离到 agent 目录;取消聊天历史注入,依赖系统记忆
|
|
307
|
-
---
|
|
308
|
-
Task ID: 1
|
|
309
|
-
Agent: main
|
|
310
|
-
Task: 实现文件/图片点击展示功能和完善agent文件发送工具
|
|
311
|
-
|
|
312
|
-
Work Log:
|
|
313
|
-
- 阅读了全部相关代码文件:chat_main.js, flow_engine.js, api_server.py, main_agent.py, file_send.py, chat.css
|
|
314
|
-
- 分析了后端文件保存流程:_save_upload_file 保存文件到磁盘并返回file_id
|
|
315
|
-
- 分析了前端消息渲染流程:renderMessages中已有msg-image和msg-file的渲染代码
|
|
316
|
-
- 发现3个关键bug:
|
|
317
|
-
1. 后端保存文件后没有将file_ids通过SSE发送回前端
|
|
318
|
-
2. 前端加载历史消息时丢弃了images/files元数据
|
|
319
|
-
3. file_send工具的stream_callback传递方式错误
|
|
320
|
-
|
|
321
|
-
- 修复1: api_server.py _stream_process_message中,保存图片/文件后发送 user_files SSE事件
|
|
322
|
-
- 修复2: flow_engine.js 中添加 user_files 事件处理,更新用户消息的images/files为file_id版本
|
|
323
|
-
- 修复3: chat_main.js selectSession 和 loadMoreMessages 中保留 images/files 元数据
|
|
324
|
-
- 修复4: chat_main.js groupHistoryMessages 中保留用户消息的 images/files
|
|
325
|
-
- 修复5: main_agent.py file_send 工具传递正确的 stream_callback
|
|
326
|
-
- 修复6: file_send.py execute 方法改为async,支持async stream_callback
|
|
327
|
-
- 增强: chat.css 添加图片hover效果、过渡动画、"点击查看大图"提示
|
|
328
|
-
|
|
329
|
-
Stage Summary:
|
|
330
|
-
- 修改文件: api_server.py, flow_engine.js, chat_main.js, chat.css, main_agent.py, file_send.py
|
|
331
|
-
- 功能完整:图片显示缩略图,hover显示"点击查看大图",所有文件点击在新窗口打开,支持下载
|
|
332
|
-
- agent文件发送工具(stream_callback)修复后可以正确通过SSE推送文件到前端
|
|
333
|
-
---
|
|
334
|
-
Task ID: 1
|
|
335
|
-
Agent: main
|
|
336
|
-
Task: 实现 web_control 内置工具 — 聊天内嵌网页控制器
|
|
337
|
-
|
|
338
|
-
Work Log:
|
|
339
|
-
- 分析项目架构: 工具系统 (Skill Registry + main_agent 内联工具), SSE 事件流, VNC overlay 模式
|
|
340
|
-
- 设计 web_control 架构: 服务端代理 + 命令队列 + 客户端轮询的双向通信方案
|
|
341
|
-
- 创建 core/web_control.py: WebControlManager, WebControlSession, URL代理, HTML改写, 控制脚本注入
|
|
342
|
-
- 修改 web/api_server.py: 添加 8 个 API 端点 (status/create/close/poll/result/proxy-get/proxy-post/panel)
|
|
343
|
-
- 修改 agents/main_agent.py: 添加 web_control 工具处理器 (open/navigate/close/set_cookies/get_cookies/click/fill/scroll/evaluate/get_content/wait/screenshot), 更新 SYSTEM_PROMPT 工具说明
|
|
344
|
-
- 修改 web/ui/chat/chat_container.html: 添加 wcOverlay 叠加层 (类似 VNC overlay)
|
|
345
|
-
- 修改 web/ui/chat/chat_main.js: 添加 openWCOverlay/closeWCOverlay/openWCInNewTab 函数, web_control 事件渲染, 历史重建
|
|
346
|
-
- 修改 web/ui/chat/flow_engine.js: 处理 v2_web_control SSE 事件 (open/navigate → 打开面板, close → 关闭面板)
|
|
347
|
-
- 修改 web/ui/chat/chat.css: 添加 .msg-wc-card 状态卡片样式
|
|
348
|
-
- 修复 core/web_control.py: quote 命名冲突 (urllib.parse.quote vs 引号字符变量)
|
|
349
|
-
- 验证: 模块导入正常, HTML/CSS改写正确, 命令队列超时处理正确, Python 语法检查通过
|
|
350
|
-
|
|
351
|
-
Stage Summary:
|
|
352
|
-
- 核心架构: 基础JS面板 + 动态容器(iframe) + 服务端代理 + postMessage 控制脚本
|
|
353
|
-
- 新文件: core/web_control.py (~700行, 含控制脚本 ~250行)
|
|
354
|
-
- 修改文件: api_server.py (+~490行), main_agent.py (+~100行工具处理器 + ~12行系统提示词), chat_container.html (+~20行), chat_main.js (+~70行), flow_engine.js (+~20行), chat.css (+~14行)
|
|
355
|
-
- 支持 action: open, navigate, close, click, fill, scroll, evaluate, get_content, set_cookies, get_cookies, wait, screenshot
|
|
356
|
-
---
|
|
357
|
-
Task ID: 2
|
|
358
|
-
Agent: main
|
|
359
|
-
Task: 修复3个bug: 知识库文件预览/下载、聊天头像、平台启用停用
|
|
360
|
-
|
|
361
|
-
Work Log:
|
|
362
|
-
- 知识库文件: 发现 agent 知识库删除用 `?filename=` 但 API 期望 `?path=` (参数名不匹配导致删除静默失败); 缺少查看/下载功能
|
|
363
|
-
- 修复: index.html 中 deleteAgentKB 参数名改为 `path`; 添加 viewAgentKB 函数 (文本文件弹窗预览, 二进制文件下载)
|
|
364
|
-
- 新增 API: GET /api/agents/{name}/knowledge/file?path=xxx (文本返回JSON, 大文件/二进制返回FileResponse下载)
|
|
365
|
-
- 组织知识库也添加了下载按钮 downloadOrgKBFile; 后端 handle_read_org_knowledge 支持 download=1 参数
|
|
366
|
-
- 文件大小显示优化: 从显示原始字节数改为 KB 格式化
|
|
367
|
-
- 聊天页面agent头像: 发现 state.currentAgent 从未被定义/赋值, 导致 avatarHtml 始终收到 undefined
|
|
368
|
-
- 修复: 将 state.currentAgent?.avatar_image 改为直接使用已存在的 agent 变量 (通过 findAgentByPath(state.activeAgent) 获取)
|
|
369
|
-
- agent 变量在渲染函数开头已正确计算, 包含 avatar_image/avatar_emoji/avatar_color/name 等完整字段
|
|
370
|
-
- 聊天平台启用/停用: 发现 renderPlatforms 模板中使用了未定义的变量 supportsQR, 导致 ReferenceError 崩溃, 整个平台页面无法渲染
|
|
371
|
-
- 修复: 将 supportsQR 改为循环内定义的 _supportsQR = ['telegram','wechat','whatsapp'].includes(p.platform)
|
|
372
|
-
- 改进 togglePlatform 添加错误检查和 toast 反馈
|
|
373
|
-
|
|
374
|
-
Stage Summary:
|
|
375
|
-
- 修改文件: web/api_server.py (新增 handle_read_agent_knowledge, 改进 handle_read_org_knowledge), web/ui/index.html (viewAgentKB, downloadOrgKBFile, 修复 deleteAgentKB 参数, 修复 supportsQR), web/ui/chat/chat_main.js (修复 agent 头像渲染)
|
|
376
|
-
- 根因: 1) 参数名不匹配 2) state.currentAgent 从未赋值 3) supportsQR 未定义导致整个页面崩溃
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
Task ID: v1.21.1-bugfix
|
|
380
|
-
Agent: main
|
|
381
|
-
Task: 修复多个 bug: pdf_create JSON 解析、文件下载链接、历史文件、Markdown 表格/列表、admin 面板崩溃
|
|
382
|
-
|
|
383
|
-
Work Log:
|
|
384
|
-
- 修复 pdf_create/docx_create content JSON 解析失败 (Extra data) — 使用 raw_decode 兼容尾部多余字符
|
|
385
|
-
- 修复 agent 发送的文件下载链接为空 (/api/file//download) — skill 执行后自动通过 file_send 发送文件
|
|
386
|
-
- 修复历史聊天记录看不到 agent 文件 — _sent_files 作用域问题,改为参数传递 sent_files
|
|
387
|
-
- 修复 Markdown 表格不显示 — 添加 renderMarkdown 表格解析 + CSS 样式
|
|
388
|
-
- 修复 Markdown 列表行距过大 — li margin 从 3px 减为 1px,ul margin 从 6px 减为 2px
|
|
389
|
-
- 修复 admin 后台管理界面完全损坏 — renderPlatforms 中 for 循环缺少关闭花括号 }
|
|
390
|
-
|
|
391
|
-
Stage Summary:
|
|
392
|
-
- 根本原因: v1.20.4 添加 QR 码按钮时误删了 for 循环的关闭 }
|
|
393
|
-
- 文件修改: skills/pdf_skill.py, skills/docx_skill.py, agents/main_agent.py, web/ui/index.html, web/ui/chat/chat_main.js, web/ui/chat/chat.css
|
|
394
|
-
---
|
|
395
|
-
Task ID: 1
|
|
396
|
-
Agent: main
|
|
397
|
-
Task: 拉取最新代码、分析变更、同步回调措辞、分析前后端差异
|
|
398
|
-
|
|
399
|
-
Work Log:
|
|
400
|
-
- git remote add origin + fetch/pull,解决 unrelated histories 冲突(3个文件:SKILL.md×2 + worklog.md 取远程版)
|
|
401
|
-
- 分析远程新增提交:v1.23.32~v1.23.34 + 最新 main_agent.py 措辞更新
|
|
402
|
-
- 发现本地 main_agent.py 合并后未正确应用远程 commit 6e4849e 的3处改动
|
|
403
|
-
- 手动应用3处改动使其与远程完全一致(diff确认零差异)
|
|
404
|
-
- 深度分析前后端回调机制的差异
|
|
405
|
-
|
|
406
|
-
Stage Summary:
|
|
407
|
-
- v1.23.34 三大修复已合入:群聊刷新恢复、头像简介+复制、chat CLI防卡死
|
|
408
|
-
- main_agent.py timeout措辞已同步:3处"预估调用超时时限"→"最多给它执行多久"
|
|
409
|
-
- 前后端回调差异分析完成(详见下方总结)
|
|
410
|
-
---
|
|
411
|
-
Task ID: 2
|
|
412
|
-
Agent: main
|
|
413
|
-
Task: v1.23.35 — 五项修复
|
|
414
|
-
|
|
415
|
-
Work Log:
|
|
416
|
-
- 清理 output_parser.py 中 <callback> 标签残留死代码(常量、解析逻辑、文档注释)
|
|
417
|
-
- 修复 tool_dispatcher.py _exec_file_send 中 fskill.UPLOADS_DIR AttributeError,改为直接导入模块级 UPLOADS_DIR
|
|
418
|
-
- 群聊头像简介弹窗(showAgentProfile)添加"💬 对话"按钮,点击调用 selectAgent 切到该 Agent 个人对话
|
|
419
|
-
- playaudio/playvideo 媒体播放器位置从对话前面移到对话后面:
|
|
420
|
-
- flow_engine.js: bubbleWrapper.insertBefore → bubbleWrapper.nextSibling
|
|
421
|
-
- chat_main.js buildMessageHtml: mediaEmbedHtml 移到 bubbleHtml 之后
|
|
422
|
-
- 重构 session ID 生成防乱串:
|
|
423
|
-
- 前端: 时间戳格式改为 crypto.randomUUID() (sess_xxx)
|
|
424
|
-
- 后端: api_server.py 三处 handler 不再拼接 agent_path_ 前缀
|
|
425
|
-
- chat_main.js: formatSessionName 兼容 sess_xxx 新格式
|
|
426
|
-
|
|
427
|
-
Stage Summary:
|
|
428
|
-
- v1.23.35 五项修改完成
|
|
429
|
-
- 修改文件: output_parser.py, tool_dispatcher.py, groupchat.js, flow_engine.js, chat_main.js, api_server.py, package.json
|
|
430
|
-
---
|
|
431
|
-
Task ID: 1
|
|
432
|
-
Agent: main
|
|
433
|
-
Task: 每个 Agent 使用独立工作目录 + 修复聊天平台启用/停用按钮 + 修复 myagent-ai chat 命令
|
|
434
|
-
|
|
435
|
-
Work Log:
|
|
436
|
-
- 调查发现所有 Agent 共享全局工作目录 ~/.myagent/data/workspace/
|
|
437
|
-
- context_builder.py: build_context/_build_whomi/_get_workspace_dir 增加 agent_path 参数
|
|
438
|
-
- 非 default Agent 使用 ~/.myagent/data/agents/{path}/workspace/ 独立目录
|
|
439
|
-
- api_server.py: 执行前设置 executor.work_dir 为 agent 独立目录,执行后恢复
|
|
440
|
-
- main_agent.py: process_v2 传递 agent_path 参数
|
|
441
|
-
- _try_model_chain_inner 同样设置/恢复独立工作目录(覆盖 chatbot/群聊路径)
|
|
442
|
-
- 修复聊天平台启用/停用按钮:handle_toggle_platform 加 try/except 保护
|
|
443
|
-
- chatbot/manager.py: setup_platforms 异常捕获从 RuntimeError 改为 Exception
|
|
444
|
-
- 修复 myagent-ai chat 命令:start.js CLI_CMDS 列表添加 'chat'
|
|
445
|
-
- 发布 npm myagent-ai@1.23.54
|
|
446
|
-
|
|
447
|
-
Stage Summary:
|
|
448
|
-
- 修改文件: core/context_builder.py, agents/main_agent.py, web/api_server.py, chatbot/manager.py, start.js
|
|
449
|
-
- 版本: 1.23.54 已发布到 npm
|
|
450
|
-
---
|
|
451
|
-
Task ID: 2
|
|
452
3
|
Agent: main
|
|
453
|
-
Task:
|
|
4
|
+
Task: v1.23.57 - 修复后台管理四个 bug
|
|
454
5
|
|
|
455
6
|
Work Log:
|
|
456
|
-
-
|
|
457
|
-
-
|
|
458
|
-
-
|
|
459
|
-
-
|
|
460
|
-
-
|
|
461
|
-
-
|
|
462
|
-
-
|
|
463
|
-
-
|
|
464
|
-
-
|
|
465
|
-
-
|
|
7
|
+
- 定位 togglePlatform 函数中 {enabled} 引用不存在变量 enabled 的 bug(参数名是 enable)
|
|
8
|
+
- 完全重写启用/停用逻辑:_doTogglePlatform(id, enabled) 使用 {enabled: enabled} 显式写法
|
|
9
|
+
- 修复 renderPlatforms 每次渲染重复添加事件监听器的内存泄漏,改为一次性全局委托
|
|
10
|
+
- admin 导航栏从 inline onclick 改为 data-page 属性 + 事件委托,消除侧滑图标点击偏移
|
|
11
|
+
- sidebarToggle 按钮从 top:50% 移到 top:0,避免与导航项重叠
|
|
12
|
+
- showPage/navigateTo/goBack/popstate 全部改用 data-page 属性匹配
|
|
13
|
+
- chat_main.js 新增 goToAdmin() 函数,跳转后台时携带 from_agent/from_session/from_group/from_mode
|
|
14
|
+
- admin-core.js 解析 URL 参数构建正确的返回聊天链接(支持群聊恢复)
|
|
15
|
+
- chat_container.html 支持 ?group=xxx URL 参数恢复群聊视图
|
|
16
|
+
- api_server.py 的 handle_update_platform/add_platform/delete_platform 的 _hot_reload_chat_platforms() 加 try/except
|
|
17
|
+
- 发布 npm myagent-ai@1.23.57
|
|
466
18
|
|
|
467
19
|
Stage Summary:
|
|
468
|
-
-
|
|
469
|
-
-
|
|
20
|
+
- 修复文件:admin-platforms.js, admin-core.js, index.html, chat_main.js, chat_container.html, api_server.py
|
|
21
|
+
- 版本:v1.23.57 已发布到 npm
|