fix(core): validate locate coordinate types strictly - #3068
Conversation
|
CI triage: all four PRs have the same 14-job failure fingerprint. On #3066, 12/14 failed jobs explicitly report that MIDSCENE_MODEL_NAME is unavailable; the remaining e2e-web/e2e-report checks are generic failures from the same model-backed workflow. The workflows inject repository secrets/variables on pull_request, and equivalent same-repository PR runs succeed, while newer external-fork runs are action_required. This is an external-fork trust/configuration gate, not evidence that the changed code failed. This branch is currently mergeable and only one commit behind main, so I am intentionally not force-pushing just to rerun the same restricted matrix. A maintainer can validate via a trusted branch or workflow_dispatch after reviewing the diff; switching to pull_request_target would not be an appropriate workaround. |
Summary
Problem
The shared locate-result parser used
Number(value)for arbitrary values. This allowed malformed model output such asnull,false, or an empty string to become finite coordinates and proceed into the grounding pipeline:Point responses with extra coordinates were also silently truncated because the parser only required at least two values.
Changes
Coordinate values now accept only finite numbers or complete decimal number strings. General JavaScript coercion is no longer used, and point responses must contain exactly two values.
This keeps compatibility with numeric strings while ensuring malformed model output reaches the existing semantic-retry path instead of becoming a real device coordinate.
Validation