Commit Graph

11 Commits

Author SHA1 Message Date
90233690ad feat: add json-based extensible model registry and dynamic model UI 2026-04-09 20:56:54 +08:00
aeb782d479 refactor: 清理WebSocket遗留代码,标记为废弃
Phase 2 WebSocket代码清理:

前端 (useLegacySocket.ts):
1. 添加文件头注释说明架构变更
   - 聊天流式事件已废弃,改用 REST API 轮询
   - 保留系统事件、配额事件、对话事件、子智能体事件
   - 标记待清理的流式处理代码

2. 简化 ai_message_start 事件处理器
   - 只保留子智能体模式的处理
   - 删除复杂的流式状态管理逻辑

3. 保留备份文件 useLegacySocket.ts.backup
   - 用于紧急回退

后端 (socket_handlers.py):
1. 标记 handle_message 为废弃
   - 添加废弃警告和迁移指南
   - 返回错误提示引导用户使用 REST API
   - 保留原代码用于紧急回退(注释掉)

2. 说明新架构优势
   - 支持分布式部署
   - 更好的错误恢复
   - 减少 WebSocket 连接压力

注意:
- 未删除大量流式处理代码,只添加注释标记
- 保留向后兼容性,避免破坏现有功能
- 后续可逐步清理标记为废弃的代码

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-04 01:15:31 +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
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
08bc08b35f feat: update model support and multimodal 2026-02-25 01:41:05 +08:00
a013abb3c4 fix: improve terminal timeout messaging 2026-02-12 11:55:15 +08:00
bb91d22631 feat: add video send/view flow and guard model constraints 2026-01-30 17:04:33 +08:00
7890926c3d fix: improve cancellation flow and api error tracing 2026-01-30 15:36:44 +08:00
8a7cc5d9c6 feat: support kimi-k2.5 with multimodal thinking 2026-01-28 10:34:27 +08:00
6e0df78fef feat(api): multi-workspace endpoints and container cleanup 2026-01-24 18:29:30 +08:00
d6fb59e1d8 refactor: split web_server into modular architecture
- Refactor 6000+ line web_server.py into server/ module
- Create separate modules: auth, chat, conversation, files, admin, etc.
- Keep web_server.py as backward-compatible entry point
- Add container running status field in user_container_manager
- Improve admin dashboard API with credentials and debug support

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-22 09:21:53 +08:00