feat: Chat → Agent 迁移功能(手动按钮 + LLM 工具建议)#49
Open
zongshuai818 wants to merge 2 commits intoErlichLiu:mainfrom
Open
feat: Chat → Agent 迁移功能(手动按钮 + LLM 工具建议)#49zongshuai818 wants to merge 2 commits intoErlichLiu:mainfrom
zongshuai818 wants to merge 2 commits intoErlichLiu:mainfrom
Conversation
Phase 1: ChatHeader 手动迁移按钮,点击后自动携带对话上下文创建 Agent 会话 Phase 2: suggest_agent_mode 工具注入,模型自主判断并推送建议卡片 新增文件: - chat-migration-service.ts: 迁移核心逻辑(3层上下文压缩、XML构建) - useMigrateToAgent.ts: 渲染进程迁移 Hook - MigrationSuggestionCard.tsx: 建议卡片组件 修改文件: - shared/chat.ts: 迁移类型 + IPC 常量 - chat-service.ts: suggest_agent_mode 工具定义与分发 - ipc.ts / preload: 迁移 handler 注册与桥接 - chat-atoms.ts: 建议状态 atoms - ChatHeader/ChatView/ChatMessages: UI 集成
- 移除 chat-migration-service.ts 中的 console.log - 修正 MigrateToAgentResult.contextPrompt 过时注释 - MigrationSuggestionCard.accept 改为 await migrate 后再 dismiss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
实现 Chat → Agent 模式迁移功能,让用户在 Chat 中遇到复杂任务时可以无缝切换到 Agent 模式,携带完整对话历史。
功能
Phase 1:手动迁移按钮
Phase 2:LLM 工具建议
suggest_agent_mode工具,模型判断任务适合 Agent 时主动建议变更文件
packages/shared/src/types/chat.tsapps/electron/src/main/lib/chat-migration-service.tsapps/electron/src/main/lib/chat-service.tsapps/electron/src/main/ipc.tsapps/electron/src/preload/index.tsapps/electron/src/renderer/atoms/chat-atoms.tsapps/electron/src/renderer/hooks/useMigrateToAgent.tsapps/electron/src/renderer/components/chat/ChatInput.tsxapps/electron/src/renderer/components/chat/ChatMessages.tsxapps/electron/src/renderer/components/chat/ChatView.tsxapps/electron/src/renderer/components/chat/MigrationSuggestionCard.tsx测试
联系邮箱:qizongshuai@163.com