Repository navigation
fix(core): reject negative DeepSeek coordinates - #3067
linhongyu510 wants to merge 2 commits into
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. |
|
Follow-up on the CI, same fingerprint as I noted before. The red checks here are the model-backed / device jobs ( I verified the same class of change on the sibling PR #3068 by running its |
quanru
left a comment
There was a problem hiding this comment.
I completed a standard review followed by a maintainability review on commit 30388e9572c4cbead493492fd132649f7446fc2f. I found no blocking issue in the change.
The sign-preserving parser keeps negative coordinates visible to validation without changing the existing supported separators. I also checked the actual adapter/codec path locally: negative values in both point positions and all four bbox positions were rejected, while supported point formats were preserved. These were focused source-level checks, not a full package or model-backed test run.
|
Thanks for the review and for checking the sign-preserving parser against the adapter/codec path locally, @quanru. Glad the change looks good on your end — happy to address anything else if it comes up. |
Merge current main into the contributor branch and update the added bbox validation test to use toPixelResult. The previous API caused all four new negative-bbox cases to fail on the PR merge snapshot. Validation: - pnpm run lint - pnpm exec nx build @midscene/core --parallel=1 - pnpm exec nx run @midscene/core:test -- tests/unit-test/model-adapter tests/unit-test/locate-result-codec.test.ts --pool.maxWorkers=2 (29 files, 384 tests passed) - pnpm exec tsc -p packages/core/tsconfig.json --noEmit --pretty false
|
|
|
Thanks for the contribution. We followed up with real-model testing using DeepSeek V4.1 Flash ( Across 24 calls covering normal controls, partially clipped controls, and missing targets, we did not observe any negative coordinates. For clipped targets, the model kept the bounding boxes within the screenshot, using The parser change is reasonable as a defensive measure, but we could not reproduce the model behavior it targets, so we are closing this PR for now. If a real DeepSeek response containing negative coordinates becomes available, we can revisit the fix. |
Summary
Problem
The DeepSeek coordinate parser previously extracted values with
/\d+/g. As a result, a model response such as[-10, 500]was silently interpreted as[10, 500], allowing malformed grounding output to become a valid click coordinate.The same issue affected bbox responses: a negative edge could lose its sign before the shared coordinate-range validation saw it.
Changes
The parser now preserves an optional sign while extracting integer values and rejects any negative coordinate before returning normalized values. Existing support for bracket variants and flexible separators is unchanged.
Regression tests cover negative values in both point positions and all four bbox positions.
Validation