Merge:'fix/patches-4.2.6-above'| 小型更新合集#234
Conversation
静态图也会卡到超时
什么也吸不到...
Reviewer's Guide此 PR 更新了若干自动化流水线和 CI 行为,澄清了一个与 Agent 初始化相关的注释,新增了基于浏览器的色彩范围选择开发工具,并进行了一些仓库清理(新增默认流水线配置并移除 Node 工具链)。 色彩范围选择器的图片分析与复制流程时序图sequenceDiagram
actor User
participant Page as BrowserPage
participant App as ColorRangeToolJS
participant Canvas as HTMLCanvas
User->>Page: 打开色彩范围提取页面
Page->>App: 加载脚本与事件监听
User->>Page: 点击或拖拽PNG到drop_area
Page->>App: drop/click事件
App->>App: 创建FileReader并读取文件
App->>Page: FileReader.onload回调
Page->>App: 传入图片数据URL
App->>Page: 创建Image对象
Page->>App: Image.onload回调
App->>Canvas: 设置宽高并drawImage
App->>Canvas: getImageData
App->>App: 遍历像素(跳过非完全不透明)
App->>App: 计算RGB_HSV_GRAY最小值与最大值
App->>Page: 更新results_container显示各格式lower与upper
User->>Page: 点击复制按钮
Page->>App: copyText调用
App->>Page: 创建隐藏textarea并执行复制
App->>Page: 移除textarea
App->>Page: 更新toast文本并滑入显示
Page-->>User: 展示复制成功toast提示
Note over App,Canvas: HSV计算中使用rgbToHsv辅助函数并映射到0-179和0-255范围
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience前往你的 dashboard 以:
Getting HelpOriginal review guide in EnglishReviewer's GuideThis PR updates several automation pipelines and CI behavior, clarifies an agent initialization comment, adds a browser-based color range picker dev tool, and performs some repository housekeeping (new default pipeline config and Node tooling removal). Sequence diagram for the color range picker image analysis and copy flowsequenceDiagram
actor User
participant Page as BrowserPage
participant App as ColorRangeToolJS
participant Canvas as HTMLCanvas
User->>Page: 打开色彩范围提取页面
Page->>App: 加载脚本与事件监听
User->>Page: 点击或拖拽PNG到drop_area
Page->>App: drop/click事件
App->>App: 创建FileReader并读取文件
App->>Page: FileReader.onload回调
Page->>App: 传入图片数据URL
App->>Page: 创建Image对象
Page->>App: Image.onload回调
App->>Canvas: 设置宽高并drawImage
App->>Canvas: getImageData
App->>App: 遍历像素(跳过非完全不透明)
App->>App: 计算RGB_HSV_GRAY最小值与最大值
App->>Page: 更新results_container显示各格式lower与upper
User->>Page: 点击复制按钮
Page->>App: copyText调用
App->>Page: 创建隐藏textarea并执行复制
App->>Page: 移除textarea
App->>Page: 更新toast文本并滑入显示
Page-->>User: 展示复制成功toast提示
Note over App,Canvas: HSV计算中使用rgbToHsv辅助函数并映射到0-179和0-255范围
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough总体概述本次更改涉及 GitHub Actions 工作流配置优化、代码注释更新,以及多个游戏管道流程配置的调整。工作流步骤通过环境变量集中化提交信息,注释反映 AgentServer 模式的配置限制,管道配置涉及节点启用状态、执行顺序、识别逻辑和错误处理的多项修改。 变更内容
代码审查工作量评估🎯 3 (中等) | ⏱️ ~25 分钟 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Hey - 我发现了两个问题,并给出了一些高层次的反馈:
- 在新的颜色范围选择器 HTML 中,被注入的 Kaspersky 脚本和样式表 URL 看起来与该工具无关,可能会引入不稳定因素或安全警告;建议移除这些外部资源,并将任何必需的资源本地托管或通过可信任的 CDN 提供。
- 在颜色范围选择器的图像分析循环中(
if (a < 255) continue;;),双分号是一个小的拼写错误,而且当前的 alpha 阈值逻辑会跳过所有半透明像素;如果你的意图只是排除完全透明的区域,建议将条件改为类似if (a === 0) continue;,以提高可读性。
给 AI 代理的提示
请根据这次代码审查中的评论进行修改:
## Overall Comments
- 在新的颜色范围选择器 HTML 中,被注入的 Kaspersky 脚本和样式表 URL 看起来与该工具无关,可能会引入不稳定因素或安全警告;建议移除这些外部资源,并将任何必需的资源本地托管或通过可信任的 CDN 提供。
- 在颜色范围选择器的图像分析循环中(`if (a < 255) continue;;`),双分号是一个小的拼写错误,而且当前的 alpha 阈值逻辑会跳过所有半透明像素;如果你的意图只是排除完全透明的区域,建议将条件改为类似 `if (a === 0) continue;`,以提高可读性。
## Individual Comments
### Comment 1
<location path="Devtools/[Devtools]color_range_picker_v2-HSVfixed.html" line_range="6" />
<code_context>
+ <script type="text/javascript" src="https://gc.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js?attr=7zVFCnJdYTPjwPemot87xaPkQyk5vEDqzWI0H_8Tnp_Wsv853I4OFeoHaJMfjqcsvtB1IMO-ER1cEZ5WMHY02PJeTjf3iBTdYXXy8klM9f8gwayocN7WRWEMY9qhGRwtTQI9Zld8ZXBZioAS5LCHHvwIdHDdTiyk324Y2djI-nMn0FnINE31VgaIpFjKWpm0lZSAG36NnO74ccbR_BZmohcIuOQIVgW9XNfVNCit_wt4Hu5Gpq1FlSOBpjLKdU14GhLEYOBHFjbcFCtqlS4zL-EEX0EHj2bFPZqH2BKsV2jyfcsUDhTqbMxxSl0kmyrOSZ8jEcD_yKa8mT9Dl-e-rw" charset="UTF-8"></script><link rel="stylesheet" crossorigin="anonymous" href="https://gc.kis.v2.scr.kaspersky-labs.com/E3E8934C-235A-4B0E-825A-35A08381A191/abn/main.css?attr=aHR0cHM6Ly9jb250cmlidXRpb24udXNlcmNvbnRlbnQuZ29vZ2xlLmNvbS9kb3dubG9hZD9jPUNneGlZWEprWDNOMGIzSmhaMlVTVEJJSmRHVnRjRjlrWVhSaEdqOEtNREJtTXpkaU9XTmtPVGc1T0RFek1tTXdNREEyTkRsa01USmlPV0kzT0dNMk1EWTJZemN4WVdWaU5USmtOamd3TkJJTEVnY1FzUHVsd01ZYUdBRSZmaWxlbmFtZT1jb2xvcl9yYW5nZV9waWNrZXJfZml4ZWQuaHRtbCZvcGk9MTAzMTM1MDUw"/><style>
</code_context>
<issue_to_address>
**🚨 issue (security):** 避免在本地开发工具页面中提交第三方注入的 Kaspersky 脚本/CSS。
这些由 Kaspersky 托管的资源看起来更像是杀毒软件注入的,而不是有意添加的。它们会引入不必要的外部依赖和潜在的跟踪行为,所以请将它们移除,并在此页面上仅保留本地可控的资源。
</issue_to_address>
### Comment 2
<location path="Devtools/[Devtools]color_range_picker_v2-HSVfixed.html" line_range="329-337" />
<code_context>
+ return { h: Math.round(h * 179), s: Math.round(s * 255), v: Math.round(v * 255) };
+ }
+
+ function copyText(text, btn) {
+ const textarea = document.createElement('textarea');
+ textarea.value = text;
+ document.body.appendChild(textarea);
+ textarea.select();
+ document.execCommand('copy');
+ document.body.removeChild(textarea);
+ showToast(text);
</code_context>
<issue_to_address>
**suggestion:** 考虑使用现代的 Clipboard API 来替代已弃用的 `document.execCommand('copy')`。
`execCommand('copy')` 已被弃用,并且在所有浏览器中可能都无法可靠工作。优先在可用时使用 `navigator.clipboard.writeText(text)`,并在此基础上保留该 textarea 方案作为回退,同时对剪贴板/权限失败场景进行显式处理。
```suggestion
async function copyText(text, btn) {
const fallbackCopy = () => {
const textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.top = '-9999px';
document.body.appendChild(textarea);
textarea.focus();
textarea.select();
let success = false;
try {
success = document.execCommand('copy');
} catch (err) {
success = false;
}
document.body.removeChild(textarea);
return success;
};
let copied = false;
if (navigator.clipboard && navigator.clipboard.writeText) {
try {
await navigator.clipboard.writeText(text);
copied = true;
} catch (err) {
// fall back to textarea method
copied = fallbackCopy();
}
} else {
copied = fallbackCopy();
}
if (copied) {
showToast(text);
} else {
console.error('Failed to copy text to clipboard:', text);
showToast('Failed to copy to clipboard');
}
}
```
</issue_to_address>帮我变得更有用!请对每条评论点 👍 或 👎,我会根据反馈改进后续的审查。
Original comment in English
Hey - I've found 2 issues, and left some high level feedback:
- In the new color range picker HTML, the injected Kaspersky script and stylesheet URLs look unrelated to the tool and could introduce instability or security warnings; consider removing those external resources and hosting any required assets locally or via trusted CDNs.
- In the image analysis loop of the color range picker (
if (a < 255) continue;;), the double semicolon is a minor typo and the alpha-threshold logic currently skips any semi-transparent pixel; if your intent is only to exclude fully transparent areas, consider changing the condition to something likeif (a === 0) continue;for clarity.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the new color range picker HTML, the injected Kaspersky script and stylesheet URLs look unrelated to the tool and could introduce instability or security warnings; consider removing those external resources and hosting any required assets locally or via trusted CDNs.
- In the image analysis loop of the color range picker (`if (a < 255) continue;;`), the double semicolon is a minor typo and the alpha-threshold logic currently skips any semi-transparent pixel; if your intent is only to exclude fully transparent areas, consider changing the condition to something like `if (a === 0) continue;` for clarity.
## Individual Comments
### Comment 1
<location path="Devtools/[Devtools]color_range_picker_v2-HSVfixed.html" line_range="6" />
<code_context>
+ <script type="text/javascript" src="https://gc.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js?attr=7zVFCnJdYTPjwPemot87xaPkQyk5vEDqzWI0H_8Tnp_Wsv853I4OFeoHaJMfjqcsvtB1IMO-ER1cEZ5WMHY02PJeTjf3iBTdYXXy8klM9f8gwayocN7WRWEMY9qhGRwtTQI9Zld8ZXBZioAS5LCHHvwIdHDdTiyk324Y2djI-nMn0FnINE31VgaIpFjKWpm0lZSAG36NnO74ccbR_BZmohcIuOQIVgW9XNfVNCit_wt4Hu5Gpq1FlSOBpjLKdU14GhLEYOBHFjbcFCtqlS4zL-EEX0EHj2bFPZqH2BKsV2jyfcsUDhTqbMxxSl0kmyrOSZ8jEcD_yKa8mT9Dl-e-rw" charset="UTF-8"></script><link rel="stylesheet" crossorigin="anonymous" href="https://gc.kis.v2.scr.kaspersky-labs.com/E3E8934C-235A-4B0E-825A-35A08381A191/abn/main.css?attr=aHR0cHM6Ly9jb250cmlidXRpb24udXNlcmNvbnRlbnQuZ29vZ2xlLmNvbS9kb3dubG9hZD9jPUNneGlZWEprWDNOMGIzSmhaMlVTVEJJSmRHVnRjRjlrWVhSaEdqOEtNREJtTXpkaU9XTmtPVGc1T0RFek1tTXdNREEyTkRsa01USmlPV0kzT0dNMk1EWTJZemN4WVdWaU5USmtOamd3TkJJTEVnY1FzUHVsd01ZYUdBRSZmaWxlbmFtZT1jb2xvcl9yYW5nZV9waWNrZXJfZml4ZWQuaHRtbCZvcGk9MTAzMTM1MDUw"/><style>
</code_context>
<issue_to_address>
**🚨 issue (security):** Avoid committing third-party injected Kaspersky script/CSS for a local devtool page.
These Kaspersky-hosted resources appear to be AV-injected rather than intentional. They introduce unnecessary external dependencies and potential tracking, so please remove them and keep only locally controlled assets on this page.
</issue_to_address>
### Comment 2
<location path="Devtools/[Devtools]color_range_picker_v2-HSVfixed.html" line_range="329-337" />
<code_context>
+ return { h: Math.round(h * 179), s: Math.round(s * 255), v: Math.round(v * 255) };
+ }
+
+ function copyText(text, btn) {
+ const textarea = document.createElement('textarea');
+ textarea.value = text;
+ document.body.appendChild(textarea);
+ textarea.select();
+ document.execCommand('copy');
+ document.body.removeChild(textarea);
+ showToast(text);
</code_context>
<issue_to_address>
**suggestion:** Consider using the modern Clipboard API instead of the deprecated `document.execCommand('copy')`.
`execCommand('copy')` is deprecated and may not work reliably in all browsers. Prefer `navigator.clipboard.writeText(text)` when available, with a fallback to this textarea approach and explicit handling of clipboard/permission failures.
```suggestion
async function copyText(text, btn) {
const fallbackCopy = () => {
const textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.top = '-9999px';
document.body.appendChild(textarea);
textarea.focus();
textarea.select();
let success = false;
try {
success = document.execCommand('copy');
} catch (err) {
success = false;
}
document.body.removeChild(textarea);
return success;
};
let copied = false;
if (navigator.clipboard && navigator.clipboard.writeText) {
try {
await navigator.clipboard.writeText(text);
copied = true;
} catch (err) {
// fall back to textarea method
copied = fallbackCopy();
}
} else {
copied = fallbackCopy();
}
if (copied) {
showToast(text);
} else {
console.error('Failed to copy text to clipboard:', text);
showToast('Failed to copy to clipboard');
}
}
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
assets/resource/pipeline/Global.json (1)
1-603:⚠️ Potential issue | 🔴 Critical确认:Pipeline 加载失败,Global_null 节点未定义
Global_null被引用于assets/resource/default_pipeline.json但在任何 pipeline JSON 文件中均未定义。需修复:
- 在相应的 pipeline 文件中定义
Global_null节点,或- 在
default_pipeline.json中修正指向该节点的所有引用🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@assets/resource/pipeline/Global.json` around lines 1 - 603, The pipeline fails because the node identifier "Global_null" is referenced but not defined; locate all references to "Global_null" (e.g., in default_pipeline.json) and either add a new node definition named "Global_null" in the pipeline JSON (use the same structure as existing nodes like "Global_Index") or update those references to point to an existing defined node (for example replace with "Global_Index" or another appropriate node); ensure the new/updated node includes required fields (recognition/action/next/doc or a minimal stub) and validate the JSON after changes.
🧹 Nitpick comments (2)
assets/resource/pipeline/Global.json (1)
584-595: 新增 OCR 识别"0%"加载状态在
Global_WaitingForLoading的any_of中新增 OCR 条款识别"0%"文本。建议:
expected字段建议使用数组格式以保持一致性:♻️ 建议修改
{ "recognition": "OCR", "roi": [ 1213, 658, 30, 20 ], - "expected": "0%", + "expected": ["0%"], "only_rec": true }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@assets/resource/pipeline/Global.json` around lines 584 - 595, Add a new OCR clause inside the Global_WaitingForLoading any_of array that recognizes the "0%" loading text (use the shown recognition "OCR" and roi values) and change the clause's expected field from a string ("0%") to an array format (e.g., ["0%"]) to match the existing expected-field convention; update the same clause name/structure as the existing any_of entries so it is treated consistently with other OCR checks.assets/resource/pipeline/PVP.json (1)
886-902:PVP_BackPVEPage重构:简化退出流程移除了原有的点击动作和复杂的导航链(
PVP_BackHomePage2→PVP_PVEBookSwipe→PVP_TouchPVEBook→PVP_FinBackMapPage),改为直接路由到通用复位节点Global_BackToQC1。注意:
doc仍为"找到图钉-点击返回主页",但节点已不包含action,仅作为识别节点。建议更新doc描述以反映实际行为:📝 建议更新文档描述
- "doc": "找到图钉-点击返回主页" + "doc": "识别图钉后,跳转到通用卡带复位流程"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@assets/resource/pipeline/PVP.json` around lines 886 - 902, The node PVP_BackPVEPage was converted to a recognition-only node (no "action" and it now routes directly to Global_BackToQC1) but its "doc" still says "找到图钉-点击返回主页"; update the "doc" for PVP_BackPVEPage to accurately describe its behavior (e.g., "识别图钉并路由至通用复位节点 Global_BackToQC1(无点击动作)") so maintainers understand this is only a detection node and not performing clicks or the previous navigation chain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@assets/resource/pipeline/Global.json`:
- Around line 1-603: The pipeline fails because the node identifier
"Global_null" is referenced but not defined; locate all references to
"Global_null" (e.g., in default_pipeline.json) and either add a new node
definition named "Global_null" in the pipeline JSON (use the same structure as
existing nodes like "Global_Index") or update those references to point to an
existing defined node (for example replace with "Global_Index" or another
appropriate node); ensure the new/updated node includes required fields
(recognition/action/next/doc or a minimal stub) and validate the JSON after
changes.
---
Nitpick comments:
In `@assets/resource/pipeline/Global.json`:
- Around line 584-595: Add a new OCR clause inside the Global_WaitingForLoading
any_of array that recognizes the "0%" loading text (use the shown recognition
"OCR" and roi values) and change the clause's expected field from a string
("0%") to an array format (e.g., ["0%"]) to match the existing expected-field
convention; update the same clause name/structure as the existing any_of entries
so it is treated consistently with other OCR checks.
In `@assets/resource/pipeline/PVP.json`:
- Around line 886-902: The node PVP_BackPVEPage was converted to a
recognition-only node (no "action" and it now routes directly to
Global_BackToQC1) but its "doc" still says "找到图钉-点击返回主页"; update the "doc" for
PVP_BackPVEPage to accurately describe its behavior (e.g., "识别图钉并路由至通用复位节点
Global_BackToQC1(无点击动作)") so maintainers understand this is only a detection
node and not performing clicks or the previous navigation chain.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ce747cd8-fba7-4aba-bab2-d84bbd12cbc0
⛔ Files ignored due to path filters (5)
.gitignoreis excluded by none and included by noneDevtools/[Devtools]color_range_picker_v2-HSVfixed.htmlis excluded by none and included by noneassets/resource/default_pipeline.jsonis excluded by none and included by nonepackage-lock.jsonis excluded by!**/package-lock.jsonand included by nonepackage.jsonis excluded by none and included by none
📒 Files selected for processing (10)
.github/workflows/install.ymlagent/main.pyassets/resource/pipeline/Collect_Launcher.jsonassets/resource/pipeline/Collect_Navigation.jsonassets/resource/pipeline/Daily.jsonassets/resource/pipeline/Equip.jsonassets/resource/pipeline/Fishing.jsonassets/resource/pipeline/Global.jsonassets/resource/pipeline/PVP.jsonassets/resource/pipeline/StartGame.json
Summary by Sourcery
提升全局自动化的健壮性和开发者工具体验,同时清理未使用的 Node 产物,并加强 CI 对提交元数据的处理。
New Features:
Enhancements:
Build:
CI:
Chores:
Original summary in English
Summary by Sourcery
Improve global automation robustness and developer tooling, while cleaning up unused Node artifacts and hardening CI commit metadata handling.
New Features:
Enhancements:
Build:
CI:
Chores:
Summary by CodeRabbit
发布说明
问题修复
功能改进