Commit Graph

264 Commits

Author SHA1 Message Date
5ab3acef9c feat: 添加 terminal-guide 和 sub-agent-guide skills
- 新增 terminal-guide skill: 持久化终端使用指南
- 新增 sub-agent-guide skill: 子智能体使用指南
- 优化终端工具定义和执行逻辑
- 更新系统提示词以引用新 skills
- 添加 utils/__init__.py 模块初始化文件

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-16 21:17:02 +08:00
b6462ff1e2 fix: skip sub-agent notify for blocking run 2026-03-14 21:35:47 +08:00
96d0e68347 fix: run sub-agent tools inside container 2026-03-14 21:13:27 +08:00
f3179e2a97 feat: 优化滚动锁定和个性化称呼功能
滚动锁定优化:
- 滚动锁定默认始终启用,不再根据输出状态自动解锁
- 深色模式下锁定图标显示为白色,与箭头图标保持一致

个性化称呼功能:
- AI 助手名称根据个性化设置中的"自称"动态显示
- 用户名称根据个性化设置中的"称呼"动态显示
- 页面初始化时自动加载个性化设置,无需打开个人空间
- 在"模型行为"中新增"使用自定义称呼"开关
- 开关关闭时显示默认的"AI Assistant"和"用户"
- 修复保存后开关状态被重置的问题

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-13 12:10:08 +08:00
bd863f6d38 feat: 优化图片/视频上传和显示功能
- 支持从本地一次选择多个文件上传
- 图片选择器上传完成后自动关闭
- 输入框和用户消息块显示缩略图(60x60px)而非文件名
- 输入框缩略图悬停时显示删除按钮(右上角 × 符号)
- 统一图片/视频预览样式,提升用户体验

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-13 11:40:54 +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
e395c82a9f fix: 优化对话压缩和复制功能
- 隐藏前端系统消息块显示
- 修复压缩对话后自动跳转到新对话
- 压缩对话标题改为"原标题 压缩后"
- 复制对话标题改为"原标题 的副本"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-09 17:59:53 +08:00
bc9a0ed2d7 chore: 添加 .venv 到 .gitignore 2026-03-09 17:00:43 +08:00
a4d3160b0a fix: 修复页面加载时出现两次动画的问题
问题原因:
- Socket 事件(conversation_changed, status_update 等)在初始化期间与 bootstrapRoute 并发执行
- loadConversationsList 在初始化期间自动加载第一个对话
- 导致 currentConversationId 被多次设置,触发多次历史加载和动画

解决方案:
- 在 Socket 事件处理中添加 initialRouteResolved 检查
- 初始化完成前,Socket 事件不修改 currentConversationId
- loadConversationsList 在初始化完成前不自动加载对话
- 确保所有数据(历史、文件树、思考模式等)在同一时间加载完成

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-09 16:59:56 +08:00
cd68812743 fix: 修复页面刷新时思考块自动展开的问题
- 在历史加载时给思考块设置 collapsed: true 默认折叠
- 在任务恢复时跳过思考块的展开/折叠动画
- 延迟清除 _rebuildingFromScratch 标记,确保所有历史事件处理完毕
- 删除过早清除重建标记的逻辑,避免后续思考块被展开

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-09 16:31:00 +08:00
d71525a3c6 feat: add personal usage stats 2026-03-09 12:03:47 +08:00
77b96623ac feat: 优化手机端UI布局和样式
- 手机端对话内容左右边距减小,AI消息更贴近屏幕边缘
- 修复工具intent文本溢出显示省略号,保持箭头和图标位置不变
- 重构手机端左上角菜单为纵向下拉样式,新增"新建对话"选项
- 统一菜单图标大小和线条粗细,支持亮色/暗色主题自动适配
- 修复个人空间弹窗顶部被状态栏遮挡问题

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-09 00:20:47 +08:00
43409c523e fix: 移除错误的对话切换跳转逻辑并修复工具执行返回值问题
主要修复:
1. 移除前端"取消跳转到正在运行的对话"的错误逻辑
   - 删除 switchConversation 中的任务检查和确认提示
   - 删除 createNewConversation 中的跳转回运行对话逻辑
   - 删除 loadConversation 中对未定义变量 hasActiveTask 的引用

2. 修复后端工具执行返回值问题
   - 修复 execute_tool_calls 在用户停止时返回 None 的 bug
   - 确保所有返回路径都返回包含 stopped 和 last_tool_call_time 的字典

3. 其他改进
   - 添加代码复制功能 (handleCopyCodeClick)
   - 移除 FocusPanel 相关代码
   - 更新个性化配置 (enhanced_tool_display)
   - 样式和主题优化

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-08 17:42:07 +08:00
5ce21eb280 修复手机端个人空间选项卡滑动问题
- 为选项卡容器添加 width: 100% 和 max-width: 100% 限制宽度
- 添加 -webkit-overflow-scrolling: touch 启用 iOS 平滑滚动
- 添加 touch-action: pan-x 明确允许横向触摸滚动
- 添加 scroll-behavior: smooth 实现平滑滚动效果
- 添加 overscroll-behavior-x: contain 防止滚动溢出

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-08 04:52:30 +08:00
823b1e105e feat: implement graceful tool cancellation on stop request
- Add stop flag monitoring loop (checks every 100ms during tool execution)
- Cancel tool task immediately when stop flag is detected
- Return cancellation message to conversation history with role=tool
- Save cancellation result: '命令执行被用户取消'
- Clean up pending tasks to prevent 'Task was destroyed but it is pending' warnings
- Fix terminal_ops.py to properly cancel stdout/stderr read tasks

Known issue: Tool result display in frontend still shows arguments instead of cancellation message when expanded

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-08 04:12:50 +08:00
07be7a1061 feat: gracefully stop tool execution on user request
- Remove direct task.cancel() calls, use stop flag instead
- Monitor stop flag every 100ms during tool execution
- Cancel tool task immediately when stop flag is detected
- Return "命令执行被用户取消" as tool result with role=tool
- Save cancellation result to conversation history
- Prevent abrupt task termination, allow graceful shutdown

Changes:
- server/socket_handlers.py: Comment out pending_task.cancel()
- server/tasks.py: Comment out entry['task'].cancel()
- server/chat_flow_tool_loop.py: Add stop flag monitoring loop

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-08 03:50:34 +08:00
141f6116fd perf: increase conversation search batch size
- Increase initial search batch from 100 to 5000
- Increase load more batch from 50 to 200
- Raise backend API limit from 100 to 10000
- Improve search performance for large conversation lists

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-08 03:32:43 +08:00
0e4f625338 feat: add task confirmation when switching conversations
- Prompt user to confirm when switching/creating conversation with active task
- Automatically stop running task after user confirmation
- Filter out events from previous conversation to prevent cross-talk
- Show toast notification after task is stopped

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-08 03:32:35 +08:00
801d20591c feat: 实现 REST API + 轮询模式,支持页面刷新后任务继续执行
主要改进:
- 新增 REST API 任务管理接口 (/api/tasks)
- 实现 150ms 轮询机制,提供流畅的流式输出体验
- 支持页面刷新后自动恢复任务状态
- WebSocket 断开时检测 REST API 任务,避免误停止
- 修复堆叠块融合问题,刷新后内容正确合并
- 修复思考块展开/折叠逻辑,只展开正在流式输出的块
- 修复工具块重复显示问题,通过注册机制实现状态更新
- 修复历史不完整导致内容丢失的问题
- 新增 tool_intent 事件处理,支持打字机效果显示
- 修复对话列表排序时 None 值比较错误

技术细节:
- 前端:新增 taskPolling.ts 和 task store 处理轮询逻辑
- 后端:TaskManager 管理任务生命周期和事件存储
- 状态恢复:智能判断是否需要从头重建,避免内容重复
- 工具块注册:恢复时注册到 toolActionIndex,支持状态更新
- Intent 显示:0.5-1秒打字机效果,历史加载直接显示

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-08 03:12:46 +08:00
463d89f295 fix: review filename sanitize and tool output 2026-03-08 00:03:28 +08:00
66b846ee37 refactor: split frontend app modules 2026-03-08 00:03:14 +08:00
5e768a9e41 refactor: split chat flow streaming loop 2026-03-07 21:21:14 +08:00
7f6a8d8511 refactor: extract tool execution loop from chat task main 2026-03-07 20:41:10 +08:00
3402375710 refactor: split pending writes and task support from chat task main 2026-03-07 20:37:58 +08:00
8ecfac0c06 refactor: isolate chat task main pipeline module 2026-03-07 20:32:02 +08:00
63e367a996 refactor: further split runner and tools mixins 2026-03-07 20:25:58 +08:00
067500b163 chore: remove obsolete segmented server snapshot files 2026-03-07 18:45:45 +08:00
5c92f93e8c chore: add smoke checks and refactor notes 2026-03-07 18:42:25 +08:00
dcba8d9d76 refactor: split terminal and server chat flow modules 2026-03-07 18:38:30 +08:00
c067df4e1b feat: add include_domains search filter and UI display 2026-03-07 17:50:35 +08:00
877bcc2fad fix: improve api error diagnostics and raise model quotas 2026-03-06 17:02:19 +08:00
868640b479 feat: add aliyun quota fallback 2026-03-06 12:31:20 +08:00
4be61fe76e feat: unify terminal session controls 2026-03-04 23:49:10 +08:00
dc6d998afb fix: reduce prompt time precision 2026-02-25 17:56:05 +08:00
8f7e704a7a feat: refresh system prompts 2026-02-25 17:28:06 +08:00
1eaa9461a1 feat: enrich host workspace info 2026-02-25 17:21:27 +08:00
12047ce237 feat: add terminal_input timeout hints 2026-02-25 15:21:35 +08:00
bec4902f1f fix: request minimax stream usage properly 2026-02-25 13:28:09 +08:00
5868095587 docs: add minimax misalignment bug log 2026-02-25 13:22:10 +08:00
eb32e31cc1 feat: update image and video sending 2026-02-25 13:20:27 +08:00
8d0c187bbf fix: ignore empty text blocks in stacks 2026-02-25 13:20:15 +08:00
6af1fe6364 docs: add weird bug log template 2026-02-25 03:20:10 +08:00
3f76780fff fix: avoid empty text action on stream 2026-02-25 03:18:18 +08:00
08bc08b35f feat: update model support and multimodal 2026-02-25 01:41:05 +08:00
89eeb449b5 chore: sync workspace updates 2026-02-23 01:20:41 +08:00
a013abb3c4 fix: improve terminal timeout messaging 2026-02-12 11:55:15 +08:00
7472028997 feat: add skills framework and controls 2026-02-07 00:20:35 +08:00