Skip to content

refactor(core): simplify model JSON parsing#2690

Open
EAGzzyCSL wants to merge 4 commits into
mainfrom
zzy/json-repair
Open

refactor(core): simplify model JSON parsing#2690
EAGzzyCSL wants to merge 4 commits into
mainfrom
zzy/json-repair

Conversation

@EAGzzyCSL

Copy link
Copy Markdown
Collaborator

Summary

  • Unify model response JSON parsing around extract -> jsonrepair -> parse -> parsed-object post-processing.
  • Remove tuple-specific fallback parsing and collapse the old safe/normal parser split into parseModelResponseJsonObject.
  • Route Doubao and UI-TARS JSON parsing through the shared parser while leaving bbox normalization to their post-parse coordinate logic.
  • Move JSON parser unit coverage into a dedicated json.test.ts file.

Validation

  • pnpm --filter @midscene/core test -- tests/unit-test/json.test.ts tests/unit-test/utils.test.ts tests/unit-test/model-adapter/doubao.test.ts tests/unit-test/model-adapter/ui-tars.test.ts
  • pnpm --filter @midscene/core test -- --coverage tests/unit-test/json.test.ts

Notes

  • The commit hook ran its configured lint-staged/biome checks automatically during commit.

@EAGzzyCSL EAGzzyCSL marked this pull request as ready for review June 17, 2026 07:12
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5c9ce49
Status: ✅  Deploy successful!
Preview URL: https://6091c8e3.midscene.pages.dev
Branch Preview URL: https://zzy-json-repair.midscene.pages.dev

View logs

@EAGzzyCSL EAGzzyCSL force-pushed the zzy/json-repair branch 2 times, most recently from 56a6ab7 to 691cf5c Compare June 22, 2026 08:06
@EAGzzyCSL EAGzzyCSL enabled auto-merge (squash) June 23, 2026 08:30
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