Conversation
… Added parameters for `refresh_image` and `getimg` in the action's JSON schema and updated the OCR logic to conditionally capture a new screenshot based on these parameters. Updated documentation to reflect these changes.
… parameter structure by removing redundant fields and improved error handling. Updated ROI values in the JSON configuration for CreditShopping actions to reflect new naming conventions.
…ion functions for ROI, ROIOffset, and Expected parameters to streamline input validation and ensure default values are set correctly. Updated OCR function call to utilize these new normalization methods.
…tailed logs for parameter normalization and OCR attempts, including fallback mechanisms for error scenarios. Improved context validation to ensure robustness during OCR execution.
…on results. Removed redundant parameters and updated logging to reflect the new structure. Adjusted JSON configurations for CreditShopping actions to align with the simplified parameter model. Updated documentation to clarify changes in action behavior and parameter usage.
…ognition parameters. Enhanced error handling and logging for context validation and OCR execution. Updated documentation to reflect changes in parameter requirements and action behavior.
…meters in JSON configuration. Removed redundant override logic and enhanced the OCR execution process. Updated action parameters to include detailed recognition settings for improved accuracy in CreditShopping actions.
…plified the override structure by directly using recognition configurations and added compatibility for nested recognition formats. Updated documentation to clarify parameter expectations.
…s. Deleted associated files and references in the pipeline JSON, streamlining the codebase. Updated documentation to reflect the removal of this action and its parameters.
…ctionality into CreditShopping pipeline JSON configurations for item recognition. Update action parameters to utilize OCR results for enhanced user feedback.
… OCR functionality into CreditShopping pipeline JSON configurations for item recognition. Update action parameters to utilize OCR results for enhanced user feedback." This reverts commit 761cf37.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: overflow65537 <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: overflow65537 <[email protected]> Co-authored-by: overflow65537 <[email protected]>
…ing mutex and context caching
Closed
Contributor
There was a problem hiding this comment.
你好——我这边有一些整体性的反馈:
- 那些硬编码的节点和流水线名称(例如 "BuyFirstOCR", "BuyFirstOCR_CanNotAfford", "BlacklistOCR", "CreditShoppingReserveCreditOCRInternal")以及默认的预留阈值
300,如果能在包里定义为具名常量,会更易维护,也更不容易出错。 - 在
reserveCreditRecognition.Run中,所有解析/识别失败(parseReserveCreditThreshold,RunRecognition,extractReserveCredit)都会让识别返回(nil, false);建议区分配置错误(例如错误的 JSON)与短暂的 OCR 问题,要么回退到一个安全的默认值,要么以更清晰的失败模式暴露出来,避免配置错误悄悄地让预留逻辑失效。
给 AI 代理的提示词
Please address the comments from this code review:
## Overall Comments
- The hard-coded node and pipeline names (e.g. "BuyFirstOCR", "BuyFirstOCR_CanNotAfford", "BlacklistOCR", "CreditShoppingReserveCreditOCRInternal") and the default reserve threshold `300` would be easier to maintain and less error‑prone if defined as named constants in the package.
- In `reserveCreditRecognition.Run`, all parse/recognition failures (`parseReserveCreditThreshold`, `RunRecognition`, `extractReserveCredit`) cause the recognition to return `(nil, false)`; consider distinguishing configuration errors (e.g. bad JSON) from transient OCR issues and either falling back to a safe default or surfacing a clearer failure mode so misconfiguration doesn’t silently disable the reserve logic.帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进之后的评审。
Original comment in English
Hey - I've left some high level feedback:
- The hard-coded node and pipeline names (e.g. "BuyFirstOCR", "BuyFirstOCR_CanNotAfford", "BlacklistOCR", "CreditShoppingReserveCreditOCRInternal") and the default reserve threshold
300would be easier to maintain and less error‑prone if defined as named constants in the package. - In
reserveCreditRecognition.Run, all parse/recognition failures (parseReserveCreditThreshold,RunRecognition,extractReserveCredit) cause the recognition to return(nil, false); consider distinguishing configuration errors (e.g. bad JSON) from transient OCR issues and either falling back to a safe default or surfacing a clearer failure mode so misconfiguration doesn’t silently disable the reserve logic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The hard-coded node and pipeline names (e.g. "BuyFirstOCR", "BuyFirstOCR_CanNotAfford", "BlacklistOCR", "CreditShoppingReserveCreditOCRInternal") and the default reserve threshold `300` would be easier to maintain and less error‑prone if defined as named constants in the package.
- In `reserveCreditRecognition.Run`, all parse/recognition failures (`parseReserveCreditThreshold`, `RunRecognition`, `extractReserveCredit`) cause the recognition to return `(nil, false)`; consider distinguishing configuration errors (e.g. bad JSON) from transient OCR issues and either falling back to a safe default or surfacing a clearer failure mode so misconfiguration doesn’t silently disable the reserve logic.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Pull request overview
该 PR 旨在恢复并优化基于 Go 的信用点商店处理逻辑,通过自定义 Action/Recognition 动态下发 OCR 匹配参数,替代当前低代码实现的性能与优先级问题。
Changes:
- 在 Go 侧新增
CreditShoppingParseParams自定义动作与CreditShoppingReserveRecognition自定义识别,并注册到 agent。 - 重构信用商店相关 pipeline:将大量按物品拆分的 OCR 节点改为通过 attach 关键字聚合生成正则 expected,并新增“保留信用点阈值”输入项。
- 更新信用商店相关资源与多语言文案,并同步 MaaEnd 测试集子模块版本。
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/MaaEndTestset | 更新测试集子模块版本以覆盖新信用商店行为 |
| assets/tasks/preset/QuickDaily.json | 预设中将 CreditShoppingReserve 从开关改为阈值输入结构 |
| assets/tasks/preset/DailyFull.json | 同上,更新全量日常预设的 CreditShoppingReserve 配置 |
| assets/tasks/CreditShopping.json | 重构选项结构(attach 关键字、Reserve 输入项、Force 新增 Exit 等)与默认值 |
| assets/resource/pipeline/CreditShopping/Shopping.json | 接入自定义动作/识别;调整购物流程节点顺序;新增 ReserveCredit 自定义识别节点 |
| assets/resource/pipeline/CreditShopping/Reflash.json | 刷新按钮 OCR 期望文本从正则改为固定英文 |
| assets/resource/pipeline/CreditShopping/ItemFocus.json | 删除按物品拆分的 OCR 节点文件(改由 attach + Go 覆盖生成 expected) |
| assets/resource/pipeline/CreditShopping/Item.json | 重构可买/不可买识别与 BuyFirst/Blacklist OCR 逻辑(expected 作为占位待 Go 覆盖) |
| assets/resource/pipeline/CreditShopping/ClaimCredit.json | 领取信用按钮 OCR 期望文本从正则改为固定英文 |
| assets/resource/pipeline/CreditShopping/BuyItemFocus.json | 补充/调整购买确认页的各物品 OCR 识别节点与 focus 文案键 |
| assets/resource/pipeline/CreditShopping/BuyItem.json | 调整购买确认页识别 ROI/expected;更新 next 列表 |
| assets/misc/locales/zh_tw.json | 新增/调整信用商店相关选项与物品文案(含 Reserve 阈值输入项) |
| assets/misc/locales/zh_cn.json | 同上(简中) |
| assets/misc/locales/ko_kr.json | 同上(韩语) |
| assets/misc/locales/ja_jp.json | 同上(日语) |
| assets/misc/locales/en_us.json | 同上(英文) |
| agent/go-service/register.go | 在 Go 服务中注册 creditshopping 组件 |
| agent/go-service/creditshopping/reserve_recognition.go | 新增“信用点低于阈值”自定义识别实现 |
| agent/go-service/creditshopping/register.go | 注册自定义 Action/Recognition 到 agent server |
| agent/go-service/creditshopping/creditshopping.go | 新增参数解析自定义动作:从节点 attach 聚合关键词并 OverridePipeline 生成 expected |
MistEO
reviewed
Mar 23, 2026
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.
低代码版目前的问题:
运行速度过慢
低代码版需要多次识别(一个物品进行识别16次OCR,如果是白名单,折扣购买和黑名单购买,那则需要48次)
即使经过优化也和GO逻辑中的一次识别有巨大差距
严重逻辑错误
低代码中的识别物品是or逻辑,会导致物品选择的优先级会使用代码的顺序,而非是折扣力度
Summary by Sourcery
恢复并集成基于 Go 的积分商城处理逻辑,用其替换低代码实现,以获得更快速、基于配置驱动的处理流水线。
新功能:
增强改进:
Original summary in English
Summary by Sourcery
Restore and integrate the Go-based credit shop handling, replacing the low-code implementation with a faster, configuration-driven pipeline.
New Features:
Enhancements:
Original summary in English
Summary by Sourcery
恢复并集成基于 Go 的积分商城处理逻辑,用其替换低代码实现,以获得更快速、基于配置驱动的处理流水线。
新功能:
增强改进:
Original summary in English
Summary by Sourcery
Restore and integrate the Go-based credit shop handling, replacing the low-code implementation with a faster, configuration-driven pipeline.
New Features:
Enhancements: