fix(cache): keep polling for a replay's destination path until its timeout
Merged
AM
21d ago+33+33+01234567890123456789-2-2-0123456789
What and why
endScreeninstep-cache.tsstopped polling whenEND_PATH_DELAYS_MSran out (~5 s), soEND_PATH_TIMEOUT_MS(15 s) never applied and a navigation that commits after 5 s handed off asend-mismatch.- It now repeats the last delay until the timeout, the same line
pollSettleduses. - Trade-off: a replay whose route never matches hands off after up to 15 s instead of 5 s, and that wait counts against the step's
timeout. 15 s is the bound the constant already documents.
Issue
Fixes #1356
Verified
Ran it locally: yes
- Scratch project, scripted executor (no model): a button whose navigation commits 8 s after the tap. Recorded once, then
e2e run --strict-cacheon the same entry with each build:
| main | this branch | |
|---|---|---|
--strict-cache replay | REPLAY_STALE (end-mismatch) at 5.69 s | Cache 1 replayed, 8.37 s |
- New unit test in
step-cache.test.ts("keeps looking past the backoff…"): fails on main (expected undefined to be 'passed'), passes here. pnpm bench:ab -- tests-agent/control-inventory.e2e.ts --config e2e.agent.config.ts(Linux, Node 26, committed recordings replayed, no model calls, 12 pairs, then 10 with a second seed): every test ran the same steps with the same outcome on both builds; suite timesame(-0.8%, 95% CI -2.6% to +1.5%; a second seed -1.2%, -4.4% to +1.7%). Theevents navigationcounter read 8-10 on this branch in one run and 10 in the other; it read 9-10 on main in another bench, so it varies on main too (most likely the initial page load event racingapp.open).
Checklist
- Changeset added (
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only. - Breaking change: title carries
!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md). - Docs updated in the same PR: the
docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it. (No page describes this wait.) - Contract change: emitted
.d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures. - Engine contract change (
e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.
Written with AI help (Claude Opus 5.5, OpenAI Sol 6.1, DeepSeek V4.1 Flash); the runs above are real.