feat: 迷失之地-利用绝区零交互机制, 减少迷失之地开局重复交互的可能性 - #2353
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
ChangesLostVoid 交互状态与代码质量优化
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py`:
- Around line 672-683: The condition for setting the one-time flag
`ao_fei_li_ya_talked` depends on accurate name identification
(`self.interact_target.name == LostVoidInteractNPC.AO_FEI_LI_YA.value`), but the
comment explicitly states that name identification is unreliable in this
scenario, creating a logical conflict that breaks the one-time behavior. Reorder
the conditional logic to check and handle the `SCGMDYJY` special case first,
then restructure the flag-setting logic so that `ao_fei_li_ya_talked` is set
primarily based on the `not self.ao_fei_li_ya_talked` condition rather than
depending heavily on the unreliable AO name check, thereby weakening the name
validation dependency for the one-time interaction path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a205340f-e019-4e3f-a807-bf9fcc6a135e
📒 Files selected for processing (1)
src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py
|
对于垃圾电脑这个移动真的有效吗? 我不清楚,cai先生如果实测没问题,那就没问题。 只是这个可能大规模用户使用时会出现很多意想不到的事情。 因你这个按时间移动本质上不是什么更完美的算法 |
所以要大家测测啊:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py`:
- Line 680: In the line where is_frame_with_all(frame_result) is called in the
lost_void_run_level.py file, the unpacked variables with_distance and with_entry
are not being used, which triggers the Ruff RUF059 warning. Replace these unused
variable names with underscore placeholders (such as _ or _unused) to explicitly
indicate that these values are intentionally ignored. Only keep with_interact as
a named variable since it is actually used in the code.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 512ecb53-84f8-49bf-9be0-1a58e91262f1
📒 Files selected for processing (1)
src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py (1)
69-89: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
is_frame_with存在可达的TypeError路径当
target_type走默认值None时,Line 87 的in target_type会直接抛异常;且前面构建的target_type_set没有被使用。建议统一用集合做匹配并在空目标时直接返回False。建议修复
def is_frame_with(self, frame_result: DetectFrameResult | None = None, - target_type: list[str] | str = None) -> bool: + target_type: list[str] | str | None = None) -> bool: @@ - target_type_set = set() + target_type_set: set[str] = set() if isinstance(target_type, str): target_type_set.add(target_type) elif isinstance(target_type, list): target_type_set.update(target_type) + else: + return False for result in frame_result.results: - if result.detect_class.class_name in target_type: + if result.detect_class.class_name in target_type_set: return True return False🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py` around lines 69 - 89, `LostVoidDetector.is_frame_with` has a reachable `TypeError` when `target_type` is left as the default `None`, because the membership check still uses `target_type` instead of the prepared set. Update the method to use `target_type_set` for class-name matching in the loop, and add an early `False` return when `target_type` is empty or not provided. Keep the fix localized to `is_frame_with` and preserve the existing `frame_result` fallback behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py`:
- Line 70: The function signature in lost_void_detector.py has a mismatch
between the default value and the type annotation for target_type: it defaults
to None but is only annotated as list[str] | str. Update the affected method
signature and any related type hints so target_type explicitly includes None,
using list[str] | str | None for the parameter and str | None where the return
or related annotation applies, keeping the annotation aligned with the existing
behavior.
In
`@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py`:
- Around line 523-527: The repeat-interaction early return in LostVoidRunLevel
should not send control back without changing state, because the same target can
be re-detected and retried indefinitely. In the current current_interact_target
/ target_key / interacted_target_key_list flow, add a small escape action before
returning round_fail('重复交互对象'), or make the repeated target part of the later
ignore/filter logic used by the non-combat detection path so it won’t be
selected again.
- Around line 405-414: 在 lost_void_run_level.py 的这段强制刷新逻辑里,先通过
agent_context.team_info 取到 team_info 并校验是否为空,再调用 request_check_all_agents();当前在
LostVoidRunLevel 相关流程中直接解引用 team_info 会导致未初始化时崩溃,而后续又把 team_info is None
视为合法分支。请把空值检查前移到 agent_context.team_info/request_check_all_agents 之前,并保留对
team_info.agent_list 的后续判空逻辑。
---
Outside diff comments:
In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py`:
- Around line 69-89: `LostVoidDetector.is_frame_with` has a reachable
`TypeError` when `target_type` is left as the default `None`, because the
membership check still uses `target_type` instead of the prepared set. Update
the method to use `target_type_set` for class-name matching in the loop, and add
an early `False` return when `target_type` is empty or not provided. Keep the
fix localized to `is_frame_with` and preserve the existing `frame_result`
fallback behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 22f8862b-cdc5-4492-bfa9-f794ebac8a00
📒 Files selected for processing (2)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.pysrc/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py (1)
69-89: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
is_frame_with存在可达的TypeError路径当
target_type走默认值None时,Line 87 的in target_type会直接抛异常;且前面构建的target_type_set没有被使用。建议统一用集合做匹配并在空目标时直接返回False。建议修复
def is_frame_with(self, frame_result: DetectFrameResult | None = None, - target_type: list[str] | str = None) -> bool: + target_type: list[str] | str | None = None) -> bool: @@ - target_type_set = set() + target_type_set: set[str] = set() if isinstance(target_type, str): target_type_set.add(target_type) elif isinstance(target_type, list): target_type_set.update(target_type) + else: + return False for result in frame_result.results: - if result.detect_class.class_name in target_type: + if result.detect_class.class_name in target_type_set: return True return False🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py` around lines 69 - 89, `LostVoidDetector.is_frame_with` has a reachable `TypeError` when `target_type` is left as the default `None`, because the membership check still uses `target_type` instead of the prepared set. Update the method to use `target_type_set` for class-name matching in the loop, and add an early `False` return when `target_type` is empty or not provided. Keep the fix localized to `is_frame_with` and preserve the existing `frame_result` fallback behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py`:
- Line 70: The function signature in lost_void_detector.py has a mismatch
between the default value and the type annotation for target_type: it defaults
to None but is only annotated as list[str] | str. Update the affected method
signature and any related type hints so target_type explicitly includes None,
using list[str] | str | None for the parameter and str | None where the return
or related annotation applies, keeping the annotation aligned with the existing
behavior.
In
`@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py`:
- Around line 523-527: The repeat-interaction early return in LostVoidRunLevel
should not send control back without changing state, because the same target can
be re-detected and retried indefinitely. In the current current_interact_target
/ target_key / interacted_target_key_list flow, add a small escape action before
returning round_fail('重复交互对象'), or make the repeated target part of the later
ignore/filter logic used by the non-combat detection path so it won’t be
selected again.
- Around line 405-414: 在 lost_void_run_level.py 的这段强制刷新逻辑里,先通过
agent_context.team_info 取到 team_info 并校验是否为空,再调用 request_check_all_agents();当前在
LostVoidRunLevel 相关流程中直接解引用 team_info 会导致未初始化时崩溃,而后续又把 team_info is None
视为合法分支。请把空值检查前移到 agent_context.team_info/request_check_all_agents 之前,并保留对
team_info.agent_list 的后续判空逻辑。
---
Outside diff comments:
In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py`:
- Around line 69-89: `LostVoidDetector.is_frame_with` has a reachable
`TypeError` when `target_type` is left as the default `None`, because the
membership check still uses `target_type` instead of the prepared set. Update
the method to use `target_type_set` for class-name matching in the loop, and add
an early `False` return when `target_type` is empty or not provided. Keep the
fix localized to `is_frame_with` and preserve the existing `frame_result`
fallback behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 22f8862b-cdc5-4492-bfa9-f794ebac8a00
📒 Files selected for processing (2)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.pysrc/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py
🛑 Comments failed to post (3)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py (1)
70-70: 📐 Maintainability & Code Quality | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
sed -n '65,95p' src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.pyRepository: OneDragon-Anything/ZenlessZoneZero-OneDragon
Length of output: 1351
将参数类型显式包含
None
target_type参数的默认值为None,但类型注解中缺少| None,会导致类型提示与实际行为不符。请修改为list[str] | str | None和str | None。🧰 Tools
🪛 Ruff (0.15.18)
[warning] 70-70: PEP 484 prohibits implicit
OptionalConvert to
T | None(RUF013)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py` at line 70, The function signature in lost_void_detector.py has a mismatch between the default value and the type annotation for target_type: it defaults to None but is only annotated as list[str] | str. Update the affected method signature and any related type hints so target_type explicitly includes None, using list[str] | str | None for the parameter and str | None where the return or related annotation applies, keeping the annotation aligned with the existing behavior.Sources: Coding guidelines, Linters/SAST tools
src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py (2)
405-414: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
先校验
team_info再解引用。Line 407 已直接调用
agent_context.team_info.request_check_all_agents(),但 Line 413 又把team_info is None当作可能情况处理;如果队伍信息尚未初始化,这里会先崩溃。建议修改
agent_context = self.ctx.auto_battle_context.agent_context + team_info = agent_context.team_info + if team_info is None: + log.info('战斗上下文暂无队伍信息,跳过代理人类型优先级追加') + return self.round_success(status='非战斗区域') + log.info('追加代理人类型优先级前,强制刷新一次战斗上下文队伍信息') - agent_context.team_info.request_check_all_agents() + team_info.request_check_all_agents() self.screenshot() agent_context._last_check_agent_time = 0 agent_context.check_agent_related(self.last_screenshot, self.last_screenshot_time) team_info = agent_context.team_info📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.agent_context = self.ctx.auto_battle_context.agent_context team_info = agent_context.team_info if team_info is None: log.info('战斗上下文暂无队伍信息,跳过代理人类型优先级追加') return self.round_success(status='非战斗区域') log.info('追加代理人类型优先级前,强制刷新一次战斗上下文队伍信息') team_info.request_check_all_agents() self.screenshot() agent_context._last_check_agent_time = 0 agent_context.check_agent_related(self.last_screenshot, self.last_screenshot_time) team_info = agent_context.team_info if team_info is None or team_info.agent_list is None or len(team_info.agent_list) == 0: log.info('战斗上下文强制刷新后仍暂无队伍信息,跳过代理人类型优先级追加')🧰 Tools
🪛 Ruff (0.15.18)
[warning] 406-406: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
[warning] 414-414: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py` around lines 405 - 414, 在 lost_void_run_level.py 的这段强制刷新逻辑里,先通过 agent_context.team_info 取到 team_info 并校验是否为空,再调用 request_check_all_agents();当前在 LostVoidRunLevel 相关流程中直接解引用 team_info 会导致未初始化时崩溃,而后续又把 team_info is None 视为合法分支。请把空值检查前移到 agent_context.team_info/request_check_all_agents 之前,并保留对 team_info.agent_list 的后续判空逻辑。
523-527: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
重复对象返回上游前需要改变当前位置或忽略条件。
这里直接
round_fail('重复交互对象')会回到非战斗画面识别,但后续检测只使用had_been_list,没有消费这个target_key;如果该交互标记仍在画面里,可能反复锁定同一对象直到超时。建议在返回前执行一次脱离移动,或把该对象纳入后续检测的忽略策略。一种局部修复方式
target_key = self.get_interact_target_key(current_interact_target) if self.region_type != LostVoidRegionType.ENTRY and target_key in self.interacted_target_key_list: + self.interact_target = current_interact_target + self.move_after_interact() log.info('当前层已交互过 %s,本次不再交互,返回上游继续处理', target_key) return self.round_fail('重复交互对象')📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.if current_interact_target is not None: target_key = self.get_interact_target_key(current_interact_target) if self.region_type != LostVoidRegionType.ENTRY and target_key in self.interacted_target_key_list: self.interact_target = current_interact_target self.move_after_interact() log.info('当前层已交互过 %s,本次不再交互,返回上游继续处理', target_key) return self.round_fail('重复交互对象')🧰 Tools
🪛 Ruff (0.15.18)
[warning] 526-526: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
[warning] 526-526: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py` around lines 523 - 527, The repeat-interaction early return in LostVoidRunLevel should not send control back without changing state, because the same target can be re-detected and retried indefinitely. In the current current_interact_target / target_key / interacted_target_key_list flow, add a small escape action before returning round_fail('重复交互对象'), or make the repeated target part of the later ignore/filter logic used by the non-combat detection path so it won’t be selected again.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py (1)
805-821: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
with_interact不能判断“右侧是否还有第二个 NPC”。这里的布尔值只表示画面里还存在任意一个
CLASS_INTERACT,并不能区分“只有当前 NPC 剩余的感叹号”还是“右侧还有第二个目标”。这样兜底的move_s很可能不会触发,首次交互后会过早进入move_w + move_a分支,和注释里描述的 fallback 条件不一致。建议修改
- with_interact = self.ctx.lost_void.detector.is_frame_with(frame_result, LostVoidDetector.CLASS_INTERACT) - if not with_interact: + interact_count = sum( + 1 + for result in frame_result.results + if result.detect_class.class_name == LostVoidDetector.CLASS_INTERACT + ) + if interact_count < 2: # 如果开局右边只有一个npc, 交互完正常后退 default_move_back = True else:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py` around lines 805 - 821, `with_interact` 只能说明当前帧还有交互目标,不能用来判断“右侧是否还有第二个 NPC”,导致 `LostVoidRunLevel` 这里的分支判断和注释里的兜底条件不一致。请在 `lost_void_run_level.py` 中围绕 `detect_to_go()` 和 `detector.is_frame_with()` 的结果,改成能区分“仅剩当前 NPC 的交互提示”与“仍有第二个目标”的判断逻辑,再据此决定是否走默认后退还是进入 `move_w + move_a` 分支,避免提前进入贴贴/左转路径。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py`:
- Around line 69-70: `is_frame_with` is still checking the raw `target_type`
instead of the normalized set, which can cause a membership test on `None` when
the argument is omitted. Update `LostVoidDetector.is_frame_with` to use the
already-built `target_type_set` for the comparison, and adjust `get_result_by_x`
so its `target_type` parameter is typed as `str | None` to match the intended
usage and avoid null-handling issues.
In
`@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py`:
- Around line 395-415: `append_agent_type_priority()`
缺少从“追加代理人类型优先级”返回到后续流程的回流节点,导致成功后 `execute()` 无法继续。请在 `lost_void_run_level.py`
中围绕 `append_agent_type_priority` / `@operation_node(name='追加代理人类型优先级')` 补上对应的
`@node_from(from_name='追加代理人类型优先级')` 跳转,确保成功返回后能继续进入 `非战斗画面识别` 或其对应的下一步节点,而不是让
`_get_next_node()` 直接结束。
---
Outside diff comments:
In
`@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py`:
- Around line 805-821: `with_interact` 只能说明当前帧还有交互目标,不能用来判断“右侧是否还有第二个 NPC”,导致
`LostVoidRunLevel` 这里的分支判断和注释里的兜底条件不一致。请在 `lost_void_run_level.py` 中围绕
`detect_to_go()` 和 `detector.is_frame_with()` 的结果,改成能区分“仅剩当前 NPC
的交互提示”与“仍有第二个目标”的判断逻辑,再据此决定是否走默认后退还是进入 `move_w + move_a` 分支,避免提前进入贴贴/左转路径。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a3253465-714e-4092-a406-5c283b406a14
📒 Files selected for processing (2)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.pysrc/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py (1)
805-821: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
with_interact不能判断“右侧是否还有第二个 NPC”。这里的布尔值只表示画面里还存在任意一个
CLASS_INTERACT,并不能区分“只有当前 NPC 剩余的感叹号”还是“右侧还有第二个目标”。这样兜底的move_s很可能不会触发,首次交互后会过早进入move_w + move_a分支,和注释里描述的 fallback 条件不一致。建议修改
- with_interact = self.ctx.lost_void.detector.is_frame_with(frame_result, LostVoidDetector.CLASS_INTERACT) - if not with_interact: + interact_count = sum( + 1 + for result in frame_result.results + if result.detect_class.class_name == LostVoidDetector.CLASS_INTERACT + ) + if interact_count < 2: # 如果开局右边只有一个npc, 交互完正常后退 default_move_back = True else:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py` around lines 805 - 821, `with_interact` 只能说明当前帧还有交互目标,不能用来判断“右侧是否还有第二个 NPC”,导致 `LostVoidRunLevel` 这里的分支判断和注释里的兜底条件不一致。请在 `lost_void_run_level.py` 中围绕 `detect_to_go()` 和 `detector.is_frame_with()` 的结果,改成能区分“仅剩当前 NPC 的交互提示”与“仍有第二个目标”的判断逻辑,再据此决定是否走默认后退还是进入 `move_w + move_a` 分支,避免提前进入贴贴/左转路径。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py`:
- Around line 69-70: `is_frame_with` is still checking the raw `target_type`
instead of the normalized set, which can cause a membership test on `None` when
the argument is omitted. Update `LostVoidDetector.is_frame_with` to use the
already-built `target_type_set` for the comparison, and adjust `get_result_by_x`
so its `target_type` parameter is typed as `str | None` to match the intended
usage and avoid null-handling issues.
In
`@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py`:
- Around line 395-415: `append_agent_type_priority()`
缺少从“追加代理人类型优先级”返回到后续流程的回流节点,导致成功后 `execute()` 无法继续。请在 `lost_void_run_level.py`
中围绕 `append_agent_type_priority` / `@operation_node(name='追加代理人类型优先级')` 补上对应的
`@node_from(from_name='追加代理人类型优先级')` 跳转,确保成功返回后能继续进入 `非战斗画面识别` 或其对应的下一步节点,而不是让
`_get_next_node()` 直接结束。
---
Outside diff comments:
In
`@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py`:
- Around line 805-821: `with_interact` 只能说明当前帧还有交互目标,不能用来判断“右侧是否还有第二个 NPC”,导致
`LostVoidRunLevel` 这里的分支判断和注释里的兜底条件不一致。请在 `lost_void_run_level.py` 中围绕
`detect_to_go()` 和 `detector.is_frame_with()` 的结果,改成能区分“仅剩当前 NPC
的交互提示”与“仍有第二个目标”的判断逻辑,再据此决定是否走默认后退还是进入 `move_w + move_a` 分支,避免提前进入贴贴/左转路径。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a3253465-714e-4092-a406-5c283b406a14
📒 Files selected for processing (2)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.pysrc/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py
🛑 Comments failed to post (2)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py (1)
69-70: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash set -euo pipefail file='src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py' echo '--- outline ---' ast-grep outline "$file" --view expanded || true echo '--- relevant lines ---' sed -n '1,180p' "$file" | cat -n echo '--- search for usages of is_frame_with / get_result_by_x ---' rg -n "is_frame_with\(|get_result_by_x\(" src || trueRepository: OneDragon-Anything/ZenlessZoneZero-OneDragon
Length of output: 8558
is_frame_with仍在使用原始target_type。
target_type_set已经构造出来,但后面的判断没有用它;is_frame_with()省略参数时会在None上做成员测试报错。顺手把get_result_by_x的target_type改成str | None。🧰 Tools
🪛 Ruff (0.15.18)
[warning] 70-70: PEP 484 prohibits implicit
OptionalConvert to
T | None(RUF013)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py` around lines 69 - 70, `is_frame_with` is still checking the raw `target_type` instead of the normalized set, which can cause a membership test on `None` when the argument is omitted. Update `LostVoidDetector.is_frame_with` to use the already-built `target_type_set` for the comparison, and adjust `get_result_by_x` so its `target_type` parameter is typed as `str | None` to match the intended usage and avoid null-handling issues.Sources: Coding guidelines, Linters/SAST tools
src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py (1)
395-415: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash set -euo pipefail # 1) Inspect the target file around the relevant sections sed -n '360,460p' src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py printf '\n===== NEXT =====\n' sed -n '720,840p' src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py # 2) Find all node_from usages for the new node and the upstream loop node printf '\n===== NODE LINKS =====\n' rg -n "`@node_from`\(from_name='追加代理人类型优先级'|`@node_from`\(from_name='非战斗画面识别'|`@node_from`\(from_name='更新优先级'" src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py # 3) Inspect the decorators / framework contract for node_from and operation_node printf '\n===== DECORATORS =====\n' rg -n "def node_from|def operation_node|class .*Operation" src/zzz_od -g '*.py' # 4) Inspect detector.is_frame_with semantics printf '\n===== DETECTOR SEMANTICS =====\n' rg -n "def is_frame_with|class .*Detector|CLASS_INTERACT" src/zzz_od -g '*.py'Repository: OneDragon-Anything/ZenlessZoneZero-OneDragon
Length of output: 21980
🏁 Script executed:
#!/bin/bash set -euo pipefail printf '===== LOST VOID DETECTOR =====\n' sed -n '1,170p' src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py printf '\n===== OPERATION FLOW CONTRACT =====\n' rg -n "node_from|operation_node|success=False|status=" src/zzz_od/operation src/zzz_od/application -g '*.py' | sed -n '1,220p' printf '\n===== NODE FROM DEFINITIONS =====\n' rg -n "def node_from|class .*OperationNode|class .*Node" src/zzz_od -g '*.py'Repository: OneDragon-Anything/ZenlessZoneZero-OneDragon
Length of output: 30037
🏁 Script executed:
#!/bin/bash set -euo pipefail printf '===== OPERATION EDGE / NODE DEFINITIONS =====\n' python3 - <<'PY' from pathlib import Path paths = [ "src/one_dragon/base/operation/operation_edge.py", "src/one_dragon/base/operation/operation_node.py", "src/one_dragon/base/operation/operation.py", "src/one_dragon/base/operation/operation_round_result.py", ] for p in paths: path = Path(p) if path.exists(): print(f"\n--- {p} ---") with path.open("r", encoding="utf-8") as f: for i, line in enumerate(f, 1): if i <= 260: print(f"{i:4d}: {line.rstrip()}") else: break PYRepository: OneDragon-Anything/ZenlessZoneZero-OneDragon
Length of output: 18456
🏁 Script executed:
#!/bin/bash set -euo pipefail sed -n '470,520p' src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.pyRepository: OneDragon-Anything/ZenlessZoneZero-OneDragon
Length of output: 2646
🏁 Script executed:
#!/bin/bash set -euo pipefail sed -n '260,420p' src/one_dragon/base/operation/operation.pyRepository: OneDragon-Anything/ZenlessZoneZero-OneDragon
Length of output: 5449
🏁 Script executed:
#!/bin/bash set -euo pipefail rg -n "def _execute_one_round|_node_edges_map|current_node|next_node|edge_list|ignore_status|round_success|round_fail" src/one_dragon/base/operation/operation.py sed -n '420,620p' src/one_dragon/base/operation/operation.pyRepository: OneDragon-Anything/ZenlessZoneZero-OneDragon
Length of output: 14410
补上
追加代理人类型优先级的回流边
append_agent_type_priority()现在成功后只返回status='非战斗区域',但没有任何@node_from(from_name='追加代理人类型优先级')接回非战斗画面识别。按当前框架,_get_next_node()会直接返回None,execute()随即结束,首次补完优先级后流程就断了。🧰 Tools
🪛 Ruff (0.15.18)
[warning] 403-403: Docstring contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF002)
[warning] 406-406: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
[warning] 414-414: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py` around lines 395 - 415, `append_agent_type_priority()` 缺少从“追加代理人类型优先级”返回到后续流程的回流节点,导致成功后 `execute()` 无法继续。请在 `lost_void_run_level.py` 中围绕 `append_agent_type_priority` / `@operation_node(name='追加代理人类型优先级')` 补上对应的 `@node_from(from_name='追加代理人类型优先级')` 跳转,确保成功返回后能继续进入 `非战斗画面识别` 或其对应的下一步节点,而不是让 `_get_next_node()` 直接结束。
只交互了一次的时候,with_interact代表有第二个交互的npc;奥菲利亚一定是第一个交互的npc |
|
这个pr还有用吗 |
|
在老迷失之地有用,矩阵里面有个boss连打模式也有用,矩阵其他模式因为右边只有一个npc所以没用
…---原始邮件---
发件人: ***@***.***>
发送时间: 2026年7月30日(周四) 下午3:00
收件人: ***@***.***>;
抄送: "Josh ***@***.******@***.***>;
主题: Re: [OneDragon-Anything/ZenlessZoneZero-OneDragon] feat: 迷失之地-利用绝区零交互机制, 减少迷失之地开局重复交互的可能性 (PR #2353)
ShadowLemoon left a comment (OneDragon-Anything/ZenlessZoneZero-OneDragon#2353)
这个pr还有用吗
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
那得解决下冲突 |
|
和 #2584 有冲突吗 |
无关 |
# Conflicts: # src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py
|
好了
…---原始邮件---
发件人: ***@***.***>
发送时间: 2026年7月30日(周四) 下午4:01
收件人: ***@***.***>;
抄送: "Josh ***@***.******@***.***>;
主题: Re: [OneDragon-Anything/ZenlessZoneZero-OneDragon] feat: 迷失之地-利用绝区零交互机制, 减少迷失之地开局重复交互的可能性 (PR #2353)
ShadowLemoon left a comment (OneDragon-Anything/ZenlessZoneZero-OneDragon#2353)
那得解决下冲突
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
conflict fix plz |
# Conflicts: # src/zzz_od/application/hollow_zero/lost_void/operation/lost_void_run_level.py
解决了 |
大家可以先测一测
Summary by CodeRabbit
Bug Fixes