310d82f4b8
perf(debug): 添加多智能体模式内存监控埋点
...
- 新增 modules/memory_debug.py 统一内存监控模块
- 在子智能体任务、主对话 build_messages、多智能体消息注入、
API 请求准备、深压缩等关键路径记录 RSS/VMS 和消息规模
- 日志输出到 ~/.astrion/astrion/host/logs/memory_debug.log
2026-07-15 17:02:33 +08:00
e29ccb318e
fix(multi-agent): 修复情况2主消息池派发链路
...
修复多智能体模式下主智能体空闲时收不到子智能体输出推送的一系列 bug:
1. poll_multi_agent_notifications 死锁:原实现先等所有 running 实例
退出再 drain 消息池,导致 ask_master 在 await 期间永远等不到主对话
回答。改为池优先:pool 有消息立即派发,不管 running 状态。
2. _dispatch_multi_agent_idle_messages 缺 import:调用
inject_multi_agent_master_message 但文件顶部从未导入,NameError
被外层 except 吞掉,task 永远建不起来。
3. dispatch 内调试日志引用 rec 错位:dispatch_ma_idle_sender_user_message
被放到 create_chat_task 之前,触发 UnboundLocalError,task 同样建不起来。
4. session_data['auto_user_message_payload'] / preceding_user_notices
payload 漏写 auto_message_type:前端 isMultiAgentMessage() 只认
auto_message_type.startsWith('multi_agent_'),空字符串走 fallback
通知渲染。
5. dispatch 第①步重复持久化:对包含 last 的全部消息都调
inject_multi_agent_master_message 落盘,之后 task 又在 handle_task_with_sender
再 add_conversation,导致历史里出现两条相同 user 消息(前一条多智能体渲染,
后一条通知渲染)。前置 N-1 条只持久化一次,最后一条交给后续 task 自己持久化。
6. last 赋值时机错位:last_emit_payload 在 last=parsed_messages[-1] 之前引用,
UnboundLocalError 再次吃掉后续链路。
7. handle_task_with_sender 多智能体分支漏写 visibility='chat':
_user_message_ui_defaults('sub_agent') 默认 visibility='compact',
透传到落盘 metadata 后,前端从后端加载历史时走通知渲染分支。显式
user_message_metadata['visibility']='chat' 强制走多智能体专用渲染。
2026-07-13 20:05:02 +08:00
692748d567
fix(multi-agent): 修复消息渲染、分类、存储与滚动抖动
...
- 子智能体消息渲染为左侧对话气泡
- 多智能体通知细分为进度/完成/提问三类
- 修复多智能体会话存储到 mutiagents 目录并迁移数据
- 修复 token-statistics API 支持多智能体会话
- 修复 ma_debug 未定义报错
- 移除 .message-block content-visibility 修复滚动抖动
2026-07-12 23:09:56 +08:00
7f2ad9144d
fix(multi-agent): 修复子智能体状态误判、后台任务隔离与 idle 等待异常
2026-07-12 18:39:21 +08:00
f652118527
fix(multi-agent): 跨事件循环问答、线程安全取消、任务结束汇报格式、工具参数可选
2026-07-12 15:09:16 +08:00
72a49a7c8d
fix: 修复对话计时器持久化、子智能体工具美化与状态查询,统一后台通知池
...
- 新增 server/work_timer.py,在对话真正空闲(无前台任务、无后台子智能体/后台命令/压缩)时持久化 work_timer,并同步内存副本,解决刷新后计时器回退问题。
- server/chat_flow_task_main.py / chat_flow.py / tasks/models.py 在任务结束/取消时按空闲判定决定是否持久化。
- 前端 lifecycle.ts 在仍有后台任务时不提前停止计时器。
- 子智能体工具(create/terminate/get_status)渲染美化,task 参数放在顶部元信息区。
- 子智能体状态查询支持返回「已完成」「已终止」「不存在」;修复 wait_for_completion 在 final_result 就绪前返回导致的「ID 被占用」误报。
- 统一后台完成通知池 poll_completion_notifications,合并子智能体与后台 run_command 两路轮询,避免逐条触发工作循环与单工作区互斥冲突。
- 删除本次新增的各类 debug_log / notify_pool_log 调用及辅助脚本。
2026-06-25 04:16:44 +08:00
9ed956518c
refactor(sub_agent): 子智能体从 Node.js 子进程改为主进程内 Python 协程
...
- 重写子智能体执行核心,不再启动 easyagent Node.js 子进程
- 新增 modules/sub_agent/ 包集中管理子智能体逻辑
- 工具调用复用主进程 WebTerminal.handle_tool_call,自然经过沙箱/容器链路
- 子智能体模型独立读取 ~/.agents/<mode>/config/sub_agent_models.json
- 支持 8 个工具:read_file/write_file/edit_file(replacements+replace_all)/run_command/web_search/extract_webpage/search_workspace/read_mediafile
- 修复子智能体进度弹窗:标题颜色、write_file 显示、过滤非 progress 条目、统一滚动条样式
- 更新 AGENTS.md / CLAUDE.md 子智能体描述
- 新增 test/test_sub_agent_regression.py 回归测试
2026-06-20 00:26:45 +08:00
f5e4541d83
feat(chat): add compact message display mode and goal-review/compression headers
...
- 审核(goal_review) user 消息气泡显示「审核 + circle-alert 图标」
- compact 消息新增「简略信息」显示形式(个人空间可切换),渲染为横线包裹的一行概要
- 压缩续接消息单独标记为 compression_handoff,visibility 改为 compact
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 19:05:59 +08:00
32865f6d6e
fix(ui): refine message visibility and goal approval flow
2026-05-30 16:30:05 +08:00
8a1e17b9a0
feat(goal): add autonomous goal mode workflow
...
Introduce workspace-level goal state persistence, goal prompt injection, and after-turn review handling so an active task can continue until the configured completion conditions are met.
Add a dedicated goal review agent with readonly and active evidence modes, configurable model settings, review prompt, token/turn boundaries, idle-no-tool protection, and progress/completed/stopped events.
Wire goal_mode through task creation, task restoration, compression handoff, runtime user messages, API message sanitization, and tool-call ordering so goal continuations survive long-running tasks and deep compression.
Add Vue UI for arming goal mode from the quick menu, showing running/completed banners, displaying progress metrics, restoring running goal state, and exposing personalization settings for review mode and stop limits.
Include goal mode research notes and default goal review configuration.
2026-05-30 12:51:42 +08:00
67fdb715f5
refactor(messages): 统一运行期消息插入为 [系统通知|source] 前缀的 user 消息
...
- 新增 server/chat_flow_task_support.inject_runtime_user_message 作为唯一入口,
统一处理 add_conversation + messages.insert + sender(user_message) 三件事
- 子智能体 / 后台 run_command / runtime_guidance / mode notice 全部走该入口,
role 一律 user,inline 仅作 metadata 标记,不再复用 system role 表达语义
- inline poll 移出 tool 执行循环,改为整轮 tool 完成后批量注入,
避免在 assistant.tool_calls 与 tool 序列之间插入 user 导致 API 报错
- 删除 _insert_completion_notice_message / _record_sub_agent_message
以及 build_messages 中 system→user 的回转分支
- 移除已废弃的 wait_sub_agent 工具残留(后端注册、前端图标/动画、
prompts、SKILL 文档;保留 sleep 的 wait_sub_agent_ids 参数)
- 前端取消对 is_auto_generated/auto_message_type 的过滤,
让运行期注入的 user 消息在历史和实时推送中正常渲染
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 02:01:36 +08:00
757718c492
feat: add user turn tool protection to shallow compression
...
- Add shallow_compress_keep_user_turn_tools config (default: 3)
- Add is_auto_generated metadata to system messages (sub_agent/background_command)
- Fix sub_agent notification path to include auto_message marker
- Frontend: add input field in PersonalizationDrawer
- Backend: implement protection logic in _run_auto_shallow_compression
2026-04-12 18:48:08 +08:00
a04eca3aab
fix: unify background run_command notifications with sub-agent flow
2026-04-08 16:13:40 +08:00
cd3f07bcc8
fix: enrich sub-agent results
2026-03-11 18:05:01 +08:00
ed82fc966e
fix: improve sub-agent ui and state
2026-03-11 15:40:28 +08:00
f09621fd86
feat: 为子智能体添加思考模式参数
...
- 新增 thinking_mode 参数(fast/thinking),支持根据任务复杂度选择模式
- 优化子智能体工具说明,提供详细的使用场景示例
- 增强子智能体状态展示,添加统计信息摘要
- 完善交付目录验证,要求必须为不存在的新目录
- 优化子智能体完成/超时/失败的消息格式
- 同步更新前端和批处理相关代码
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-11 03:34:20 +08:00
b68dee9d98
chore: snapshot current changes
2026-03-10 23:48:40 +08:00
3402375710
refactor: split pending writes and task support from chat task main
2026-03-07 20:37:58 +08:00