Repository navigation
refactor(core): assemble context and task prompts at model boundaries - #3429
Merged
Merged
Conversation
EAGzzyCSL
force-pushed
the
zzy/multimodal-input-boundaries
branch
from
November 25, 2026 06:16
297868b to
da34d11
Compare
quanru
approved these changes
Nov 25, 2026
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep the user's original instruction, reference images, and image conversion options together through the task and service layers. Pass supplemental context separately and assemble model-facing prompts at the model workflow boundary, including deepLocate's search-area step. Move Boolean, Assert, WaitFor, Number, and String demand formatting into the extraction workflow.
Previously, merging context or task-specific wording into prompts early made the same prompt field mean different things at different layers. Reports then needed a separate
promptDisplayfield to recover the original description.Why this change
aiQuerydemands are serialized as JSON. Remove the extra locatepromptDisplayfield.This is a data-flow refactor, not a model-quality or cache-hit-rate optimization. Public context options remain unchanged, and existing model-facing context formatting is preserved.
Validation
pnpm run lintpnpm exec nx test @midscene/core --output-style=static— 3,035 tests passed.pnpm exec nx test @midscene/core --output-style=static -- tests/unit-test/service-locate-deeplocate.test.ts tests/unit-test/locate-prompt-order.test.ts— 29 tests passed after aligning search-area context assembly.pnpm exec nx test @midscene/web --output-style=static -- tests/unit-test/page-task-executor-waitFor.test.ts— 2 tests passed.pnpm exec tsc -p packages/core/tsconfig.json --noEmit --pretty falsepnpm exec nx build @midscene/core --output-style=staticReal-model tests were not run. The initial core test run overlapped with a build and encountered two report CLI artifact-loading failures; rerunning after the build passed all tests.