Skip to content

refactor(core): restructure Jev integration and planning delegation - #3295

Merged
yuyutaotao merged 6 commits into
mainfrom
zzy/jev-model
Oct 23, 2026
Merged

yuyutaotao merged 6 commits into
mainfrom
zzy/jev-model

Conversation

@EAGzzyCSL

@EAGzzyCSL EAGzzyCSL commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Refactor the existing Jev integration into dedicated System One calling, localization, boolean insight, and planning modules. Jev derives planning choices from the available Action Space: simple actions are planned directly, while complex actions are delegated to the default model with an advisory suggestion.

When Planning and Locate both use Jev with the same model name and Base URL, simple single-target actions return an action choice and target box in one request. Execution reuses the coordinates instead of making another localization request. This optimization uses the Planning request configuration and is disabled for deepThink; different models or providers retain separate localization.

  • Separate callGenerativeAI and callSystemOneAI while sharing retries, cancellation, recording, and usage accounting. Preserve SIWC authentication and token refresh.
  • Select capability fallbacks using explicit task types; distinguish boolean insight from arbitrary extraction schemas. Keep internal planning advice separate from user context.
  • Add supportedBySystemOne action metadata, prefixed dynamic choices, and a fallback when the Choice limit is exceeded. Forward support metadata through the system-input action helper.
  • Reuse the bounding-box codec with edge-coordinate semantics. Preserve input image dimensions and bytes rather than automatically resizing or padding; document screenshotShrinkFactor and provider Base URL conventions in both languages.
  • Accept both JPEG MIME aliases on the native TypeSafe image-encoding path and fix test typing.

Validation

For the latest changes:

  • pnpm run lint — passed with one existing unused-suppression warning.
  • pnpm exec nx test @midscene/core jev task-executor-concurrency bbox-locate-cache — 83 passed.
  • pnpm exec nx test @midscene/core task-executor-concurrency — 25 passed after refining the matching-model conditions.
  • pnpm exec tsc -p packages/core/tsconfig.json --noEmit --pretty false — passed.
  • pnpm exec nx build @midscene/core — passed before the final condition-only refinement.

Earlier validation of the refactor:

  • pnpm exec nx test @midscene/core — 2,453 passed, 8 skipped.
  • pnpm exec nx test @midscene/shared env — 175 passed.
  • pnpm exec nx test @midscene/web web-actions-navigation proxy-deps-resolution — 16 passed.
  • pnpm exec nx test doc model-config — 19 passed.

Manual live-model reports confirm planning coordinates are reused without a separate Locate model request. Jev can still prematurely mark unfinished tasks complete; this change does not add completion verification.

Separate generative and System One requests and resolve model fallbacks by task type.

Add Jev localization, boolean insight, and action-aware planning with default-model delegation.

Update model configuration documentation and regression tests.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: 88a00ef
Status: ✅  Deploy successful!
Preview URL: https://707e5167.midscene.pages.dev
Branch Preview URL: https://zzy-jev-model.midscene.pages.dev

View logs

@yuyutaotao
yuyutaotao merged commit 66e8f39 into main Oct 23, 2026
18 of 19 checks passed
@yuyutaotao
yuyutaotao deleted the zzy/jev-model branch October 23, 2026 09:35
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.

2 participants