Skip to content

fix: max hit#1193

Merged
MistEO merged 4 commits intomainfrom
fix/max_hit
Mar 9, 2026
Merged

fix: max hit#1193
MistEO merged 4 commits intomainfrom
fix/max_hit

Conversation

@neko-para
Copy link
Contributor

@neko-para neko-para commented Mar 9, 2026

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:

  • Ensure recognition attempts are skipped when max_hit is reached only within PipelineTask, preventing unintended limits on other task types.

Enhancements:

  • Log debug and info messages when max_hit is reached and when recognition hits occur within PipelineTask for better observability.

max_hit should only be restricted to PipelineTask
@neko-para neko-para requested a review from MistEO March 9, 2026 06:49
@neko-para
Copy link
Contributor Author

我不太清楚ocr batch部分到底是咋搞的, 大概改了下, 可以看要不要把这个检查max_hit的逻辑抽个小函数(

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些总体反馈:

  • max_hit 的检查和日志消息现在同时出现在 recognize_listprepare_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.

Sourcery 对开源项目免费——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的审查。
Original comment in English

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是不是也挪出来?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在TaskBase上搞个函数? 我改改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦确实, 是得挪

@neko-para
Copy link
Contributor Author

好像不对, 日志现在这样改会打印两次(

fix duplicated log
@MistEO MistEO merged commit 6dae13f into main Mar 9, 2026
14 checks passed
@MistEO MistEO deleted the fix/max_hit branch March 9, 2026 11:54
@MistEO
Copy link
Member

MistEO commented Mar 10, 2026

果然第二次改完没让 AI review,看来下次还得多让 AI 瞅瞅(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants