feat: add user's intention in apply prompt#4454
Conversation
Walkthrough此次变更在多个模块中引入了对用户指令的支持。具体来说,在 chat 模块中,构造请求时会根据条件附加用户意图的说明;在 mcp 模块中,更新了 Changes
Sequence Diagram(s)sequenceDiagram
participant U as 用户
participant EF as EditFileHandler
participant BA as BaseApplyService
participant CA as ChatApplyService
participant AI as AI后端
U->>EF: 发起编辑文件请求 (targetFile, codeEdit, instructions?)
EF->>BA: 调用 registerCodeBlock(targetFile, codeEdit, toolCallId, instructions?)
BA-->>EF: 返回 CodeBlockData
EF->>CA: 生成并发送AI请求 (包含条件性插值)
CA->>AI: 请求处理代码更新 (附带 "User's intention: [instructions]?" )
AI-->>CA: 返回处理结果
CA-->>EF: 返回AI响应
EF-->>U: 返回最终处理结果
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
yarn install v1.22.22 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (8)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4454 +/- ##
==========================================
- Coverage 53.27% 53.27% -0.01%
==========================================
Files 1661 1661
Lines 102534 102535 +1
Branches 22179 22180 +1
==========================================
- Hits 54627 54626 -1
- Misses 39859 39860 +1
- Partials 8048 8049 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Types
Background or solution
feat: add user's intention in apply prompt
Changelog
feat: add user's intention in apply prompt
Summary by CodeRabbit
registerCodeBlock方法现在支持可选的说明参数,允许在注册代码块时包含额外的说明信息。EditFileHandler的处理方法现在可以接收并传递附加的说明参数。