Skip to content

fix(core): recheck a numeric read while its value is loading - #3440

Open
quanru wants to merge 5 commits into
mainfrom
fix/core-read-loading-numbers
Open

quanru wants to merge 5 commits into
mainfrom
fix/core-read-loading-numbers

Conversation

@quanru

@quanru quanru commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

A numeric question immediately after an action can return null while its content is loading. This change removes the explicit aiWaitFor from the repository's weather test. The user can tap Search and ask for the temperature directly. The test now checks the exact answer, 72.

A live aiNumber extraction answers the original question, including counts and arithmetic, and reports whether missing evidence is visibly loading. Only a pending read takes a fresh screenshot. Additional observations start no earlier than 3 and 15 seconds from the first read, including elapsed inference time. Three pending observations fail the last reported task. A visible zero, an ordinary missing value, saved observations and reference-image queries take one observation. The standard planner is independent of this change (#3398).

Matched browser evaluation

Base 51c3046c4, head 2243cf0e8. Two runs per model on GPT-6.1 Terra and GPT-6.2 Sol, with fresh Puppeteer contexts. The independent oracle checks the returned number, actual visible field and a single triggering action. Across 132 final runs, the primary groups were:

Case Main, explicit wait Main, wait removed PR, wait removed
Original repository weather page 4/4 4/4 4/4
Weather results delayed by 12 s 4/4 0/4 4/4
Separate delayed billing fixture 4/4 0/4 4/4
Held-out parcel page, loading skeleton 4/4 0/4 4/4
Held-out parcel page, previous count labelled stale 4/4 0/4 4/4
Held-out parcel page, silent loading 4/4 0/4 0/4

For the four asynchronous cases with loading cues, the PR used 52 model calls for 16 successful tasks, compared with 68 calls for 16 successes with the handwritten wait. These are controlled latency variants. The unchanged weather fixture succeeded on main as well. The comparison does not estimate production-wide wait coverage or wall-clock speedup.

An early prototype returned the wrong answer on all four sum questions, and two of four empty-list questions. The final prompt preserved counting and arithmetic. On main and the final PR, list counts, empty-list counts, sums and held-out averages all passed 16/16 with one numeric observation per question. Each ready-zero and missing-value control used a single observation on the PR. All four permanently pending reads stopped after three. Keep an explicit wait for a silent transition or an independently required business outcome.

Validation

  • pnpm run lint
  • pnpm --filter @midscene/core exec tsc --noEmit -p tsconfig.json
  • pnpm --filter @midscene/core exec rstest run tests/unit-test/number-readiness.test.ts tests/unit-test/insight-extract-prompt.test.ts (22 passed)
  • NX_DAEMON=false pnpm exec nx build @midscene/web --output-style=static
  • pnpm --filter @midscene/core sync-report-template
  • AI_TEST_TYPE=web pnpm --filter @midscene/web exec rstest run tests/ai/web/puppeteer/ai-number.test.ts (passed using local Chrome and GPT-6.2 Sol)
  • CI=true pnpm --filter @midscene/core exec rstest run --pool.maxWorkers 2 (3,082 passed, 8 skipped). An earlier full run under benchmark load timed out in the report CLI process test. That suite passed 4/4 in isolation, then the full run passed.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2243cf0
Status: ✅  Deploy successful!
Preview URL: https://8e9213f9.midscene.pages.dev
Branch Preview URL: https://fix-core-read-loading-number.midscene.pages.dev

View logs

@quanru
quanru marked this pull request as ready for review November 25, 2026 09:24
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