Skip to content

test: 式舆防卫战/快捷手册 fixture + vision_hint 断言 - #19

Merged
DoctorReid merged 4 commits into
mainfrom
feat/screen-onboarding-vision-hint
Jul 19, 2026
Merged

test: 式舆防卫战/快捷手册 fixture + vision_hint 断言#19
DoctorReid merged 4 commits into
mainfrom
feat/screen-onboarding-vision-hint

Conversation

@DoctorReid

@DoctorReid DoctorReid commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

对应主仓 #2517「画面建档 + skill 方法论 + analyze_screen vision_hint」的测试配套。

  • 式舆防卫战选关主界面 + 子态 fixture(screens/式舆防卫战/*.webp)
  • 快捷手册 目标/作战 TAB fixture(screens/快捷手册/*.webp)
  • analyze_screen vision_hint 字段断言(test_schemas / test_backend_context / test_http_routes / test_mcp_app)

主仓 PR:OneDragon-Anything/ZenlessZoneZero-OneDragon#2517

新增 9 子态(选关主界面-3of5/4of5、弱点编队、预备编队选队、战斗画面、一层结束、入口前可交互、挑战结果-下一防线/S评级)+ 快捷手册 2 TAB;删 3 重复(选关主界面/作战/目标 = 新版同图);战斗结束.webp 重命名挑战结果-下一防线.webp。
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

本次变更新增或更新多张 WebP 界面资源,并为 vision_hint 在分析结果、HTTP 路由及 MCP 工具中的默认值与透传行为补充测试。

Changes

界面资源

Layer / File(s) Summary
界面图片资源更新
screens/式舆防卫战/*.webp, screens/快捷手册/*.webp
新增或整体替换式舆防卫战、快捷手册相关的 WebP 静态图片素材。

vision_hint 测试覆盖

Layer / File(s) Summary
vision_hint 行为验证
test/zzz_od/backend/test_backend_context.py, test/zzz_od/backend/test_http_routes.py, test/zzz_od/backend/test_mcp_app.py, test/zzz_od/backend/test_schemas.py
补充 vision_hint 在成功、失败、默认值、显式赋值及工具透传场景下的测试断言。

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

小兔挥耳看新图,
WebP 星光铺满途。
提示字段轻轻跳,
成功失败都照顾。
测试萝卜咔嚓嚼,
素材新鲜蹦蹦舞。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次新增截图 fixture 和 vision_hint 断言的主要改动。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/screen-onboarding-vision-hint

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@test/zzz_od/backend/test_backend_context.py`:
- Line 109: Update the assertion for result.vision_hint in the backend context
test to validate non-empty content rather than only non-None presence, using the
production contract’s expected capability-boundary hint value when available.
Keep the success-path assertion focused on the output generated by analyze().

In `@test/zzz_od/backend/test_http_routes.py`:
- Line 103: 更新相关 HTTP 路由测试及其 mock 配置,让 mock 返回具体的非空 vision_hint,并将断言从默认 None
改为验证响应 JSON 保留该提示值;同时保留字段存在性验证。
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d714974a-92f7-45fc-9e2c-66d5cb8b689a

📥 Commits

Reviewing files that changed from the base of the PR and between aee1c29 and 3a99724.

📒 Files selected for processing (15)
  • screens/式舆防卫战/一层结束-阶段切换.webp
  • screens/式舆防卫战/入口前可交互.webp
  • screens/式舆防卫战/弱点编队界面.webp
  • screens/式舆防卫战/战斗画面.webp
  • screens/式舆防卫战/挑战结果-S评级.webp
  • screens/式舆防卫战/挑战结果-下一防线.webp
  • screens/式舆防卫战/选关主界面-3of5.webp
  • screens/式舆防卫战/选关主界面-4of5.webp
  • screens/式舆防卫战/预备编队选队.webp
  • screens/快捷手册/作战TAB.webp
  • screens/快捷手册/目标TAB.webp
  • test/zzz_od/backend/test_backend_context.py
  • test/zzz_od/backend/test_http_routes.py
  • test/zzz_od/backend/test_mcp_app.py
  • test/zzz_od/backend/test_schemas.py

assert result.success is True
assert [t.text for t in result.ocr_texts] == ["体力", "设定"]
assert result.ocr_texts[0].width == 3
assert result.vision_hint is not None # success 时带能力边界提示

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

断言具体提示内容,避免测试退化为存在性检查。

is not None 允许空字符串或任意错误提示通过,无法验证 analyze() 是否生成了预期的能力边界提示。请断言生产契约规定的具体值,至少改为验证非空内容。

🤖 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 `@test/zzz_od/backend/test_backend_context.py` at line 109, Update the
assertion for result.vision_hint in the backend context test to validate
non-empty content rather than only non-None presence, using the production
contract’s expected capability-boundary hint value when available. Keep the
success-path assertion focused on the output generated by analyze().

assert resp.status_code == 200
data = json.loads(resp.body.decode("utf-8"))
assert data["success"] is True
assert data["vision_hint"] is None # HTTP 显式补字段(P11 对称);mock 未设 → None

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

补充 HTTP 层的非空 vision_hint 透传断言。

当前只验证默认 None 和字段存在;即使路由丢弃或错误序列化非空提示,测试仍会通过。请让 mock 返回具体提示,并断言响应 JSON 中保留该值。

🤖 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 `@test/zzz_od/backend/test_http_routes.py` at line 103, 更新相关 HTTP 路由测试及其 mock
配置,让 mock 返回具体的非空 vision_hint,并将断言从默认 None 改为验证响应 JSON 保留该提示值;同时保留字段存在性验证。

@DoctorReid
DoctorReid merged commit 41dcf7f into main Jul 19, 2026
1 check passed
@DoctorReid
DoctorReid deleted the feat/screen-onboarding-vision-hint branch July 19, 2026 17:47
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.

1 participant