fix(mobile-mcp): reject out-of-range normalized coordinates - #6656
Conversation
When coordinate normalization is enabled, throw ActionableError if coordinate values exceed the [0, scale] range. This catches the common model mistake of passing screenshot pixel coordinates instead of normalized coordinates (e.g. y=1175 on a 900x2000 device when the valid range is 0-1000).
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Thanks for the PR, @LaZzyMan!
Unfortunately the PR body doesn't follow the PR template. The template requires specific headings — What this PR does, Why it's needed, Reviewer Test Plan (with How to verify, Evidence Before/After, Tested on), Risk & Scope, Linked Issues, and a Chinese translation. The current body uses Summary, Context, and Test plan which don't match.
Could you update the PR description to follow the template? This helps reviewers evaluate efficiently and ensures we have the reproduction/evidence we need.
中文说明
感谢 PR,@LaZzyMan!
PR 描述没有遵循 PR 模板。模板要求使用特定的标题——What this PR does、Why it's needed、Reviewer Test Plan(包含 How to verify、Evidence Before/After、Tested on)、Risk & Scope、Linked Issues,以及中文翻译。当前使用的是 Summary、Context、Test plan,与模板不匹配。
请按照模板更新 PR 描述,方便 reviewer 高效评估,也确保提供必要的复现和证据信息。
— Qwen Code · qwen3.7-max
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Summary
[0, scale]with an ActionableErrory=1175on a 900x2000 device when the valid range is 0-1000)distanceparameterContext
In a production trace, the model repeatedly passed
y=1175(exceeding the 0-1000 normalized range) because it confused screenshot pixel coordinates with normalized coordinates. The click silently mapped to device pixely=2350(off-screen), and the model wasted 3 attempts before self-correcting.Test plan
coord-norm.test.tstests passmobile_click_on_screen_at_coordinateswithy=1175returns ActionableError instead of silently clicking off-screen