Merged
Conversation
max_hit should only be restricted to PipelineTask
Contributor
Author
|
我不太清楚ocr batch部分到底是咋搞的, 大概改了下, 可以看要不要把这个检查max_hit的逻辑抽个小函数( |
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些总体反馈:
max_hit的检查和日志消息现在同时出现在recognize_list和prepare_batch_ocr中,形成了重复;建议将这部分逻辑集中抽取到PipelineTask中的一个小辅助函数里,以保持行为一致并减少重复。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- The `max_hit` check and log message are now duplicated in both `recognize_list` and `prepare_batch_ocr`; consider centralizing this logic into a small helper in `PipelineTask` to keep the behavior consistent and reduce repetition.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的审查。
Original comment in English
Hey - I've left some high level feedback:
- The
max_hitcheck and log message are now duplicated in bothrecognize_listandprepare_batch_ocr; consider centralizing this logic into a small helper inPipelineTaskto keep the behavior consistent and reduce repetition.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `max_hit` check and log message are now duplicated in both `recognize_list` and `prepare_batch_ocr`; consider centralizing this logic into a small helper in `PipelineTask` to keep the behavior consistent and reduce repetition.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
MistEO
reviewed
Mar 9, 2026
Contributor
Author
There was a problem hiding this comment.
在TaskBase上搞个函数? 我改改
Contributor
Author
|
好像不对, 日志现在这样改会打印两次( |
fix duplicated log
MistEO
reviewed
Mar 9, 2026
Member
|
果然第二次改完没让 AI review,看来下次还得多让 AI 瞅瞅( |
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.
max_hit should only be restricted to PipelineTask
https://github.com/MaaEnd/MaaEnd/actions/runs/22839301359?pr=1112
Summary by Sourcery
将
max_hit的跟踪和限制仅应用于PipelineTask的识别流程,而不是共享的TaskBase实现。Bug Fixes:
PipelineTask中达到max_hit时才跳过识别尝试,从而避免对其他任务类型施加意外的限制。Enhancements:
PipelineTask中达到max_hit以及发生识别命中时,记录 debug 和 info 日志消息,以提高可观测性。Original summary in English
Summary by Sourcery
Limit max_hit tracking and enforcement to PipelineTask recognition flow instead of the shared TaskBase implementation.
Bug Fixes:
Enhancements: