Skip to content

Dev6#1560

Merged
runhey merged 2 commits into
runhey:devfrom
LGG686:dev6
May 19, 2026
Merged

Dev6#1560
runhey merged 2 commits into
runhey:devfrom
LGG686:dev6

Conversation

@LGG686
Copy link
Copy Markdown
Contributor

@LGG686 LGG686 commented May 15, 2026

Summary by Sourcery

将六道轮回的灵魂切换配置统一为一个配置项,并简化针对桐生歌姬(Kiryou Utahime)Boss 的魔物遭遇(Demon Encounter)灵魂选择逻辑。

Bug 修复:

  • 通过移除未使用的附加预设,并在遇到无效配置时记录日志而不是静默继续执行,修正魔物遭遇中的灵魂选择问题。

增强改进:

  • 将六道轮回的灵魂切换从两个独立配置合并为一个统一的 switch_soul_config
  • 通过移除附加的组/队伍字段并更新相关的动态字段隐藏规则,简化魔物遭遇中桐生歌姬(Kiryou Utahime)的配置。
Original summary in English

Summary by Sourcery

Unify Six Realms soul-switch configuration to a single config entry and simplify Demon Encounter soul selection for Kiryou Utahime bosses.

Bug Fixes:

  • Correct Demon Encounter soul selection by removing unused supplementary presets and logging invalid configurations instead of silently proceeding.

Enhancements:

  • Consolidate Six Realms soul switching from two separate configs into one unified switch_soul_config.
  • Simplify Demon Encounter Kiryou Utahime configuration by removing supplementary group/team fields and updating related dynamic field hiding.

AzurTian added 2 commits May 15, 2026 13:37
- 移除鬼灵歌姬御魂的补充配置字段
- 移除极鬼灵歌姬御魂的补充配置字段
- 更新隐藏字段列表以反映配置变更
- 删除周一特定的御魂切换逻辑
- 添加未知御魂配置的日志记录
- 删除重复的 switch_soul_config_1 和 switch_soul_config_2 配置项
- 将两个配置合并为单个 switch_soul_config 配置项
- 更新任务脚本中的配置引用以使用新的单一配置
- 移除重复的御魂切换逻辑代码
Copy link
Copy Markdown

@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 - 我发现了两个问题,并给出了一些整体反馈:

  • switch_soul_config_1/2 合并为单一的 switch_soul_config 可能会破坏已有配置;可以考虑在配置模型中增加字段别名或迁移/兼容层,以确保旧配置仍然能够被正确反序列化。
  • checkout_soul 中,你现在在第一次成功调用 run_switch_soul_by_name 后就直接 return;如果调用方还依赖于切换御魂之后的后续逻辑,可能需要避免这种提前返回,或者把该方法的返回行为说明得更清楚。
  • 移除 *_supplementary 鬼王(demon)配置字段以及与周一相关的逻辑,会在无提示的情况下改变行为;可以考虑是否需要一个回退或废弃路径,这样出现意料之外的空 group,team 值时,不仅仅是写个错误日志,而是能更明确地反馈给用户或调用方。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- Removing `switch_soul_config_1/2` in favor of a single `switch_soul_config` may break existing configs; consider adding field aliases or a migration/compat layer in the config model so old configurations still deserialize correctly.
- In `checkout_soul`, you now `return` after the first successful `run_switch_soul_by_name`; if callers rely on subsequent logic after soul switching, you may want to avoid the early return or make the method’s return behavior explicit.
- The removal of the `*_supplementary` demon config fields and logic for Monday changes behavior silently; consider whether you need a fallback or deprecation path so unexpected empty `group,team` values don’t just log an error but are surfaced more explicitly to the user or caller.

## Individual Comments

### Comment 1
<location path="tasks/SixRealms/script_task.py" line_range="34-38" />
<code_context>

     def run(self):
-        if self._config.switch_soul_config_1.enable:
+        if self._config.switch_soul_config.enable:
             self.ui_get_current_page()
             self.ui_goto(page_shikigami_records)
-            self.run_switch_soul(self._config.switch_soul_config_1.switch_group_team)
-        if self._config.switch_soul_config_1.enable_switch_by_name:
+            self.run_switch_soul(self._config.switch_soul_config.switch_group_team)
+        if self._config.switch_soul_config.enable_switch_by_name:
             self.ui_get_current_page()
             self.ui_goto(page_shikigami_records)
</code_context>
<issue_to_address>
**suggestion:** 考虑在两个标志都启用时避免对 `page_shikigami_records` 的重复跳转。

合并为单一的 `switch_soul_config` 之后,当 `enable``enable_switch_by_name` 都为 true 时,这条路径会连续两次调用 `ui_get_current_page()``ui_goto(page_shikigami_records)`。你可以改为只导航一次,然后依次调用 `run_switch_soul``run_switch_soul_by_name`,以避免多余的 UI 调用并降低潜在的不稳定性。
</issue_to_address>

### Comment 2
<location path="tasks/DemonEncounter/script_task.py" line_range="68-69" />
<code_context>
-                else:
-                    group, team = getattr(self.conf.demon_soul_config, f'{self.boss_type}_supplementary').split(",")
-                self.run_switch_soul_by_name(group, team)
+            return
+        logger.error(f'Unknown switch soul conf: group[{group}], team[{team}]')

     def execute_boss(self):
</code_context>
<issue_to_address>
**question (bug_risk):** 移除周一的补充御魂切换逻辑会改变行为;请确认这是有意为之。

此前,当 `datetime.now().weekday() == 0` 时,代码会进行第二次切换,切到 `*_supplementary` 御魂(对普通和最佳鬼王都是如此)。现在在第一次 `run_switch_soul_by_name` 后就直接返回,因此不会再执行补充切换。如果玩家依赖这种“周一双阶段切换”的行为,他们的体验会发生变化。如果这是有意的,则无需改动;否则建议在保留新配置结构的前提下,重新引入周一特有的补充切换逻辑。
</issue_to_address>

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

Hey - I've found 2 issues, and left some high level feedback:

  • Removing switch_soul_config_1/2 in favor of a single switch_soul_config may break existing configs; consider adding field aliases or a migration/compat layer in the config model so old configurations still deserialize correctly.
  • In checkout_soul, you now return after the first successful run_switch_soul_by_name; if callers rely on subsequent logic after soul switching, you may want to avoid the early return or make the method’s return behavior explicit.
  • The removal of the *_supplementary demon config fields and logic for Monday changes behavior silently; consider whether you need a fallback or deprecation path so unexpected empty group,team values don’t just log an error but are surfaced more explicitly to the user or caller.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Removing `switch_soul_config_1/2` in favor of a single `switch_soul_config` may break existing configs; consider adding field aliases or a migration/compat layer in the config model so old configurations still deserialize correctly.
- In `checkout_soul`, you now `return` after the first successful `run_switch_soul_by_name`; if callers rely on subsequent logic after soul switching, you may want to avoid the early return or make the method’s return behavior explicit.
- The removal of the `*_supplementary` demon config fields and logic for Monday changes behavior silently; consider whether you need a fallback or deprecation path so unexpected empty `group,team` values don’t just log an error but are surfaced more explicitly to the user or caller.

## Individual Comments

### Comment 1
<location path="tasks/SixRealms/script_task.py" line_range="34-38" />
<code_context>

     def run(self):
-        if self._config.switch_soul_config_1.enable:
+        if self._config.switch_soul_config.enable:
             self.ui_get_current_page()
             self.ui_goto(page_shikigami_records)
-            self.run_switch_soul(self._config.switch_soul_config_1.switch_group_team)
-        if self._config.switch_soul_config_1.enable_switch_by_name:
+            self.run_switch_soul(self._config.switch_soul_config.switch_group_team)
+        if self._config.switch_soul_config.enable_switch_by_name:
             self.ui_get_current_page()
             self.ui_goto(page_shikigami_records)
</code_context>
<issue_to_address>
**suggestion:** Consider avoiding double navigation to `page_shikigami_records` when both flags are enabled.

With the merged `switch_soul_config`, when both `enable` and `enable_switch_by_name` are true, this path calls `ui_get_current_page()` and `ui_goto(page_shikigami_records)` twice in succession. You could instead navigate once and then run both `run_switch_soul` and `run_switch_soul_by_name` to avoid redundant UI calls and reduce potential flakiness.
</issue_to_address>

### Comment 2
<location path="tasks/DemonEncounter/script_task.py" line_range="68-69" />
<code_context>
-                else:
-                    group, team = getattr(self.conf.demon_soul_config, f'{self.boss_type}_supplementary').split(",")
-                self.run_switch_soul_by_name(group, team)
+            return
+        logger.error(f'Unknown switch soul conf: group[{group}], team[{team}]')

     def execute_boss(self):
</code_context>
<issue_to_address>
**question (bug_risk):** Removal of Monday supplementary soul switching changes behavior; confirm this is intended.

Previously, when `datetime.now().weekday() == 0`, the code did a second switch to a `*_supplementary` soul (for both normal and best demons). Now it returns after the first `run_switch_soul_by_name`, so the supplementary switch never occurs. If players depended on this two-stage Monday behavior, their experience will change. If that’s intentional, no action needed; if not, consider reintroducing the Monday-specific supplementary switch while keeping the new config structure.
</issue_to_address>

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.

Comment on lines +34 to +38
if self._config.switch_soul_config.enable:
self.ui_get_current_page()
self.ui_goto(page_shikigami_records)
self.run_switch_soul(self._config.switch_soul_config_1.switch_group_team)
if self._config.switch_soul_config_1.enable_switch_by_name:
self.run_switch_soul(self._config.switch_soul_config.switch_group_team)
if self._config.switch_soul_config.enable_switch_by_name:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: 考虑在两个标志都启用时避免对 page_shikigami_records 的重复跳转。

合并为单一的 switch_soul_config 之后,当 enableenable_switch_by_name 都为 true 时,这条路径会连续两次调用 ui_get_current_page()ui_goto(page_shikigami_records)。你可以改为只导航一次,然后依次调用 run_switch_soulrun_switch_soul_by_name,以避免多余的 UI 调用并降低潜在的不稳定性。

Original comment in English

suggestion: Consider avoiding double navigation to page_shikigami_records when both flags are enabled.

With the merged switch_soul_config, when both enable and enable_switch_by_name are true, this path calls ui_get_current_page() and ui_goto(page_shikigami_records) twice in succession. You could instead navigate once and then run both run_switch_soul and run_switch_soul_by_name to avoid redundant UI calls and reduce potential flakiness.

Comment on lines +68 to +69
return
logger.error(f'Unknown switch soul conf: group[{group}], team[{team}]')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

question (bug_risk): 移除周一的补充御魂切换逻辑会改变行为;请确认这是有意为之。

此前,当 datetime.now().weekday() == 0 时,代码会进行第二次切换,切到 *_supplementary 御魂(对普通和最佳鬼王都是如此)。现在在第一次 run_switch_soul_by_name 后就直接返回,因此不会再执行补充切换。如果玩家依赖这种“周一双阶段切换”的行为,他们的体验会发生变化。如果这是有意的,则无需改动;否则建议在保留新配置结构的前提下,重新引入周一特有的补充切换逻辑。

Original comment in English

question (bug_risk): Removal of Monday supplementary soul switching changes behavior; confirm this is intended.

Previously, when datetime.now().weekday() == 0, the code did a second switch to a *_supplementary soul (for both normal and best demons). Now it returns after the first run_switch_soul_by_name, so the supplementary switch never occurs. If players depended on this two-stage Monday behavior, their experience will change. If that’s intentional, no action needed; if not, consider reintroducing the Monday-specific supplementary switch while keeping the new config structure.

@github-actions
Copy link
Copy Markdown

Change Summary

  • Six Realms 将原有的 switch_soul_config_1 + switch_soul_config_2 双配置合并为单一的 switch_soul_config
  • DemonEncounter 删除 demon_kiryou_utahime_supplementary / best_demon_kiryou_utahime_supplementary 字段
  • DemonEncounter 删除每周一 Kiryou Utahime 的"二次切换 supplementary"逻辑(原逻辑:周一额外再切换一次)
  • DemonEncounter checkout_soul() 新增无效配置的 error 日志(原逻辑:空 group/team 时静默 continue)

Reconstructed Intent

点击此处展开 这次改动最可能是为了:
  1. 六道轮回:用户实际只需要一个灵魂切换配置,将双配置简化为单配置,降低配置复杂度
  2. 鬼灵歌姬:之前每周一在一次灵魂切换后还会根据 supplementary 字段做第二次切换——这个行为本身可能就是 bug 或很少被真正使用,移除以简化逻辑
  3. 错误处理:当 group 或 team 解析失败时,原来静默 continue,现在改为记录错误

Observed Constraints

点击此处展开
  1. Six Realms 旧配置丢失风险:switch_soul_config_2 在旧配置文件中仍然存在,但代码已不再读取。任何依赖 switch_soul_config_2 的用户在升级后会被静默忽略
  2. DemonEncounter 原 Monday 行为被删除:原来每周一 Kiryou Utahime 会执行两次灵魂切换(一次 primary,一次 supplementary),现在只执行一次。如果有用户依赖这个"二次切换"行为,他们不会得到任何警告
  3. 无效配置处理:空字符串 split 后 group="", team="" 会走 if group and team: 分支被跳过,原 PR 现在改为 logger.error,但仍然 return(未阻止后续流程)

Intent Alignment

  • 基本一致。代码行为与推断的意图对齐:六道双配置合并为单配置,鬼灵歌姬移除 supplementary 字段和相关切换逻辑,新增无效配置错误日志。

Release Risk

  • 风险等级:
  • 六道配置降级静默失效:用户若依赖 switch_soul_config_2,升级后不会触发任何报错,soul switch 直接失效。维护者应考虑在 Release Notes 中明确告知用户只剩一个配置可用,或提供配置迁移逻辑
  • DemonEncounter Monday 行为变更:原来每周一 Kiryou Utahime 会二次切换,现在只有一次。如果有用户依赖该行为(尚未知是否为有意设计),会被无声影响

Validation Gaps

点击此处展开
  • 没有看到配置迁移逻辑(switch_soul_config_2switch_soul_config 的值迁移)
  • 没有看到对原 switch_soul_config_2.enable 用户的数据升级路径说明
  • DemonEncounter 二次切换逻辑被完全删除,缺乏该行为是否为 bug 或是否为用户所需功能的确认记录
  • checkout_soul()logger.error 后仍然 return,未阻止后续流程继续——这是否为有意设计需确认

Generated by PR Review Intent for issue #1560 · ● 65.3K ·

@github-actions
Copy link
Copy Markdown

Findings

  • 未发现未通过项

Generated by PR Review Checklist for issue #1560 · ● 159K ·

@runhey runhey merged commit f797875 into runhey:dev May 19, 2026
11 checks passed
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.

3 participants