feat: 添加 AI 崩溃分析功能及相关配置#2824
Conversation
审阅者指南添加可配置的基于 AI 的崩溃分析(通过兼容 OpenAI 的 API),将其集成到崩溃对话框流程中,并新增 AI 工具设置页以及专门的 AI 分析消息对话框。 基于 AI 的崩溃分析流程时序图sequenceDiagram
actor User
participant ModCrash
participant CrashAiAnalyzer
participant ModMain
participant MyMsgAiAnalysis
participant Requester
User->>ModCrash: Output(IsHandAnalyze, ExtraFiles)
ModCrash->>ModCrash: BuildAiAnalysisText(resultText)
ModCrash->>CrashAiAnalyzer: Start(aiLogText)
CrashAiAnalyzer->>ModMain: ShowCrashAiAnalysis(TrimLog(logText))
ModMain->>MyMsgAiAnalysis: new MyMsgAiAnalysis(converter)
MyMsgAiAnalysis->>CrashAiAnalyzer: Analyze(logText)
CrashAiAnalyzer->>Requester: Fetch(endpoint, FetchParam)
Requester-->>CrashAiAnalyzer: JSON response
CrashAiAnalyzer-->>MyMsgAiAnalysis: analysisText
MyMsgAiAnalysis-->>User: Display AI crash analysis
文件级改动
技巧与命令与 Sourcery 交互
自定义你的体验前往你的 控制面板 以:
获取帮助Original review guide in EnglishReviewer's GuideAdds configurable AI-based crash analysis using OpenAI-compatible APIs, integrates it into the crash dialog flow, and introduces a new settings page for AI tooling along with a dedicated AI analysis message dialog. Sequence diagram for AI-based crash analysis flowsequenceDiagram
actor User
participant ModCrash
participant CrashAiAnalyzer
participant ModMain
participant MyMsgAiAnalysis
participant Requester
User->>ModCrash: Output(IsHandAnalyze, ExtraFiles)
ModCrash->>ModCrash: BuildAiAnalysisText(resultText)
ModCrash->>CrashAiAnalyzer: Start(aiLogText)
CrashAiAnalyzer->>ModMain: ShowCrashAiAnalysis(TrimLog(logText))
ModMain->>MyMsgAiAnalysis: new MyMsgAiAnalysis(converter)
MyMsgAiAnalysis->>CrashAiAnalyzer: Analyze(logText)
CrashAiAnalyzer->>Requester: Fetch(endpoint, FetchParam)
Requester-->>CrashAiAnalyzer: JSON response
CrashAiAnalyzer-->>MyMsgAiAnalysis: analysisText
MyMsgAiAnalysis-->>User: Display AI crash analysis
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我在这里给出了一些高层反馈:
- 在 ModCrash.Output 中,Button2Action 逻辑现在依赖于字面文本“查看日志”(
button2 != "查看日志" ? null : ...);建议使用一个专门的布尔标志来跟踪 Button2 是否应当打开日志,以避免当标签文本发生变化或被以不同方式本地化时产生 bug。 - PageSetupAI.Reset 会调用两次 Reload()(一次是在 try 块中重置成功之后,另一次是在 catch 之后);你可以删除其中一次调用以避免重复工作。
- 在 CrashAiAnalyzer.Start 中,初始的
if (!Config.Tool.AI.Enabled) return;与在调用 Start 前外部的CrashAiAnalyzer.IsEnabled检查是重复的;建议将启用检查集中到一个地方,以简化控制流。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- In ModCrash.Output, the Button2Action logic now relies on the literal text "查看日志" (`button2 != "查看日志" ? null : ...`); consider using a dedicated boolean flag to track whether Button2 should open logs to avoid bugs if the label text changes or is localized differently.
- PageSetupAI.Reset calls Reload() twice (once in the try block after successful reset and again after the catch); you can remove one of these calls to avoid redundant work.
- In CrashAiAnalyzer.Start, the initial `if (!Config.Tool.AI.Enabled) return;` is redundant with the external `CrashAiAnalyzer.IsEnabled` check before calling Start; consider centralizing the enabled-check in one place to keep the control flow simpler.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进评审质量。
Original comment in English
Hey - I've left some high level feedback:
- In ModCrash.Output, the Button2Action logic now relies on the literal text "查看日志" (
button2 != "查看日志" ? null : ...); consider using a dedicated boolean flag to track whether Button2 should open logs to avoid bugs if the label text changes or is localized differently. - PageSetupAI.Reset calls Reload() twice (once in the try block after successful reset and again after the catch); you can remove one of these calls to avoid redundant work.
- In CrashAiAnalyzer.Start, the initial
if (!Config.Tool.AI.Enabled) return;is redundant with the externalCrashAiAnalyzer.IsEnabledcheck before calling Start; consider centralizing the enabled-check in one place to keep the control flow simpler.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In ModCrash.Output, the Button2Action logic now relies on the literal text "查看日志" (`button2 != "查看日志" ? null : ...`); consider using a dedicated boolean flag to track whether Button2 should open logs to avoid bugs if the label text changes or is localized differently.
- PageSetupAI.Reset calls Reload() twice (once in the try block after successful reset and again after the catch); you can remove one of these calls to avoid redundant work.
- In CrashAiAnalyzer.Start, the initial `if (!Config.Tool.AI.Enabled) return;` is redundant with the external `CrashAiAnalyzer.IsEnabled` check before calling Start; consider centralizing the enabled-check in one place to keep the control flow simpler.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
MoYuan-CN
left a comment
There was a problem hiding this comment.
在此 PR 被进一步讨论之前,需要先 Resolve 以下问题:
|
已撤销对于"Plain Craft Launcher 2\Pages\PageInstance\PageInstanceExport.xaml.cs"文件的更改 |
Big-Cake-jpg
left a comment
There was a problem hiding this comment.
怎么感觉这代码像是 AI 写的……
另外就是,我不认为 AI 分析 Minecraft 崩溃时能起到什么作用。高级用户会自行排查错误,用不着填 API Key 和 baseURL 花自己的钱让 AI 分析;普通用户也大概率不了解自行配置 AI 功能所需要的知识。社区也并没有多余资金用于提供这类服务。
如果 AI 能够有效分析 Minecraft 的错误日志而不是胡说八道,那 No AI Guess 这类模组也许就没有存在的必要了。
喵喵喵
Summary by Sourcery
添加可配置的 AI 驱动崩溃分析功能,用于 Minecraft 日志,并通过专用对话框和设置页面呈现结果。
新功能:
增强项:
Original summary in English
Summary by Sourcery
Add configurable AI-powered crash analysis for Minecraft logs and surface it through a dedicated dialog and settings page.
New Features:
Enhancements: