perf: 清理日志时同时清理vision与on_error - #314
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并提供了一些高层次的反馈:
- 当前 i18n 提示字符串里把
on_error和vision写死了,而代码使用的是DEBUG_ARTIFACT_DIRS;建议从该常量自动生成文案,或者让提示文本更通用一些,这样当调试目录集合变化时,就不需要在多个地方同步更新。 clear_debug_artifact_dir目前记录的日志是 "Failed to read debug dir" 和 "debug entry",但这个函数其实适用于任何 artifact 目录;建议把日志消息写得更通用一些,以便复用这个 helper 时不会引起困惑。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The i18n hint strings now hardcode `on_error` and `vision`, while the code uses `DEBUG_ARTIFACT_DIRS`; consider deriving the wording from that constant or keeping the hint text generic so you don’t need to update multiple places when the set of debug directories changes.
- `clear_debug_artifact_dir` logs "Failed to read debug dir" and "debug entry" but is actually suitable for any artifact directory; consider making the log messages more generic to avoid confusion when this helper is reused.
## Individual Comments
### Comment 1
<location path="src/i18n/locales/en-US.ts" line_range="130-131" />
<code_context>
autoClearLogsOnLaunch: 'Auto-clear Runtime Logs',
autoClearLogsOnLaunchHint:
- 'Automatically clear runtime logs and delete old log files every time the project is launched',
+ 'Automatically clear runtime logs and delete old log files along with debug screenshots in on_error and vision every time the project is launched',
},
</code_context>
<issue_to_address>
**suggestion:** Description mentions only screenshots while implementation deletes all artifacts in those dirs
Since the backend deletes all artifacts under `on_error` and `vision`, not just screenshots, the current wording can become misleading if other files are present now or in future. Please use a more general term (e.g. “debug artifacts” or “debug files”) so the label matches the actual behavior.
```suggestion
autoClearLogsOnLaunchHint:
'Automatically clear runtime logs and delete old log files along with debug artifacts in on_error and vision every time the project is launched',
```
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据这些反馈改进后续的代码评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The i18n hint strings now hardcode
on_errorandvision, while the code usesDEBUG_ARTIFACT_DIRS; consider deriving the wording from that constant or keeping the hint text generic so you don’t need to update multiple places when the set of debug directories changes. clear_debug_artifact_dirlogs "Failed to read debug dir" and "debug entry" but is actually suitable for any artifact directory; consider making the log messages more generic to avoid confusion when this helper is reused.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The i18n hint strings now hardcode `on_error` and `vision`, while the code uses `DEBUG_ARTIFACT_DIRS`; consider deriving the wording from that constant or keeping the hint text generic so you don’t need to update multiple places when the set of debug directories changes.
- `clear_debug_artifact_dir` logs "Failed to read debug dir" and "debug entry" but is actually suitable for any artifact directory; consider making the log messages more generic to avoid confusion when this helper is reused.
## Individual Comments
### Comment 1
<location path="src/i18n/locales/en-US.ts" line_range="130-131" />
<code_context>
autoClearLogsOnLaunch: 'Auto-clear Runtime Logs',
autoClearLogsOnLaunchHint:
- 'Automatically clear runtime logs and delete old log files every time the project is launched',
+ 'Automatically clear runtime logs and delete old log files along with debug screenshots in on_error and vision every time the project is launched',
},
</code_context>
<issue_to_address>
**suggestion:** Description mentions only screenshots while implementation deletes all artifacts in those dirs
Since the backend deletes all artifacts under `on_error` and `vision`, not just screenshots, the current wording can become misleading if other files are present now or in future. Please use a more general term (e.g. “debug artifacts” or “debug files”) so the label matches the actual behavior.
```suggestion
autoClearLogsOnLaunchHint:
'Automatically clear runtime logs and delete old log files along with debug artifacts in on_error and vision every time the project is launched',
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
close MaaEnd/MaaEnd#4771
close MaaEnd/MaaEnd#4531
opus5.0
Summary by Sourcery
扩展日志清理功能,在保留目录结构的前提下清理调试工件目录
Enhancements:
on_error和视觉调试工件目录save_on_error行为兼容Documentation:
on_error及视觉调试截图Original summary in English
Summary by Sourcery
Extend log cleanup to also clear debug artifact directories while preserving their structure
Enhancements:
Documentation: