fix:修复pipeline版本为v5,修复每日探索开启加成识别错误#54
Open
21dczhang wants to merge 2 commits intoMaaXYZ:mainfrom
Open
Conversation
There was a problem hiding this comment.
嗨——我在这里给出了一些高层次的反馈:
- 在
main()中使用Path.is_relative_to会将兼容性限制在 Python 3.9 及以上;如果你需要支持更早版本的 Python,可以改为使用基于relative_to的 try/except,或者手动进行前缀检查来替代。 - 基于正则的
rebuild_json_with_comments逻辑相当复杂,并且在 JSON 结构演变时(例如有嵌套对象或重复键名)可能会比较脆弱;建议将这个函数单独抽离出来,并使用各种边界情况的 JSONC 示例对其进行单元测试,以确保在引入新的字段或格式时仍能按预期工作。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- In `main()`, the use of `Path.is_relative_to` limits compatibility to Python 3.9+; if you need to support older Python versions, replace it with a try/except using `relative_to` or manual prefix checking.
- The regex-based `rebuild_json_with_comments` logic is quite complex and may be brittle when JSON shape evolves (e.g., nested objects or repeated key names); consider isolating and unit-testing this function with a variety of edge-case JSONC samples to ensure it behaves as expected when new fields or formats are introduced.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've left some high level feedback:
- In
main(), the use ofPath.is_relative_tolimits compatibility to Python 3.9+; if you need to support older Python versions, replace it with a try/except usingrelative_toor manual prefix checking. - The regex-based
rebuild_json_with_commentslogic is quite complex and may be brittle when JSON shape evolves (e.g., nested objects or repeated key names); consider isolating and unit-testing this function with a variety of edge-case JSONC samples to ensure it behaves as expected when new fields or formats are introduced.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `main()`, the use of `Path.is_relative_to` limits compatibility to Python 3.9+; if you need to support older Python versions, replace it with a try/except using `relative_to` or manual prefix checking.
- The regex-based `rebuild_json_with_comments` logic is quite complex and may be brittle when JSON shape evolves (e.g., nested objects or repeated key names); consider isolating and unit-testing this function with a variety of edge-case JSONC samples to ensure it behaves as expected when new fields or formats are introduced.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.
Summary by Sourcery
引入迁移脚本并更新流水线资源,使流水线 JSON 定义与基于 v5.x JumpBack 的格式保持一致。
新功能:
migrate_pipeline_v5.py工具,用于将旧版流水线 JSON 中的is_sub/interrupt字段转换为 v5.1 [JumpBack] 前缀格式,同时保留注释、顺序和缩进。问题修复:
改进优化:
next/on_error),以便通过全局收集的is_sub节点支持跨文件的 JumpBack 行为。Original summary in English
Summary by Sourcery
Introduce a migration script and updated pipeline resources to align pipeline JSON definitions with the v5.x JumpBack-based format.
New Features:
Bug Fixes:
Enhancements: