Skip to content

test(evals): reconcile the cold-reload history-tail claim with the intended transcript load - #4792

Merged
yomgui merged 12 commits into
devfrom
e2e/history-tail-after-reload-claim
Sep 11, 2026
Merged

yomgui merged 12 commits into
devfrom
e2e/history-tail-after-reload-claim

Conversation

@yomgui

@yomgui yomgui commented Sep 10, 2026

Copy link
Copy Markdown
Member

Root cause

Triage cluster 7/K follow-on (reports/e2e-red-2026-09-09/triage.md, "Dismiss-then-notSee races" → #4724 → #4742 → #4780 → this). Once #4780 let streamed-markdown-answer test 3 (v1 keeps long tool-rich history…) pass its Find-anchor and conversation-switch steps, the lane reached the last step, cold reload keeps the bounded history tail ordered…, for the first time and failed on expect(await orderedHistory()).toEqual(retainedHistory): the reloaded surface shows all 150 Settled history rows while the spec expected the 97-row tail of the engine's ?limit=140 page.

The claim is stale, not a regression. It was written by 4d0e30ab6 (#4614, Sep 8) when the session snapshot was fetched with limit: 140. de965e2b1 (#4695, Sep 9, "load the whole transcript when opening a session") deliberately dropped that limit — the PR description states OpenCode pages limit as the newest n messages with no "load older" path, so any longer conversation opened mid-way; cursor-based "load older" + virtualization are named as a follow-up, not part of the fix. Confirmed in code: session-surface.tsx:1283 now calls composeNativeSessionSnapshot* with { signal } only (comment "No limit…"); the remaining limit: 140 calls live in global-queue-drainer.ts and are status-only probes that never render messages. #4695's own journey session-full-history-on-open asserts the same 150-of-150 behaviour on a cold open.

What changed

evals/specs/streamed-markdown-answer.e2e.test.ts, one step (spec only, no product change):

  • Renamed to cold reload restores the whole ordered transcript, the reading position and old and new tool links.
  • expect(await orderedHistory()).toEqual(world.history) replaces the bounded-tail expectation; the retainedHistory derivation (and its < world.history.length check, which after fix(app): load the whole transcript when opening a session #4695 only described the raw API) is gone.
  • The engine's ?limit=140 page stays as the negative witness: it is still 140 long and still lacks world.history[0], while the reopened surface must show that row — this is exactly the product decision fix(app): load the whole transcript when opening a session #4695 made, stated in a comment.
  • Unchanged: expectReadingPosition() after user.reload() (anchor restore ≤ 2 px, neighbour session's saved scroll untouched), the single-occurrence checks for the prompt/closing sentinel, the palette target checks for old and new tools, and notSee(/Something went wrong/).

Stacked on origin/e2e/find-reading-anchor (#4780, which already carries #4724 and #4742) via a merge commit be8612285 on top of origin/dev; their files are untouched here. Once #4780 lands this PR reduces to d73d91cdf.

Proof (Daytona, sha d73d91cdf7b132a1f314ee3962ea740806c5621a, OPENWORK_EVAL_REF pinned — sandbox log HEAD is now at d73d91cd test(evals): expect the whole transcript…)

pnpm evals:e2e streamed-markdown-answer --daytona

Placement line: {"command":"evals:e2e","lane":"e2e","daytona":true,"placement":"daytona","engine":"legacy","surface":"legacy","case":null,"vision":"defer","files":["streamed-markdown-answer"],"passed":2,"failed":2,"skipped":0,"skips":[],"consented":["OPENWORK_EVAL_E2E_TESTS"],"verdict":"failed"}

→ passed 2 / failed 2 / skipped 0.

  • × test 1 sending clears the composer… — Timed out after 500ms seeing composer with the draft still present after send; triage Cluster 1/B, owned by fix(app): keep a brand-new session sendable while its first snapshot loads #4757, unchanged here.
  • × test 2 a streaming answer renders as markdown… — Target remained visible: "Preparing the formatted response."; Cluster 1/B (fix(app): keep a brand-new session sendable while its first snapshot loads #4757), unchanged here.
  • ✓ test 3 v1 keeps long tool-rich history… — 419 s, all 8 steps green (test-run.json, run 2026-09-10T14-16-07-566Z, gitSha d73d91cd…, outcome: passed):
    1. PASS the live cache retains history older than the native 140-message snapshot (17.2 s)
    2. PASS sending from older history reveals the exact latest user row above the composer without Jump to latest (1.5 s)
    3. PASS new tool output becomes accessible without losing old targets while text grows (48.8 s)
    4. PASS passive streamed output does not jump away from the history being read (56.3 s)
    5. PASS settled history and the advancing answer never disappear or duplicate (0.5 s)
    6. PASS choose a reading message inside the retained history tail (0.9 s)
    7. PASS switching conversations preserves the reading position, full cached history and scoped targets (28.3 s)
    8. PASS cold reload restores the whole ordered transcript, the reading position and old and new tool links (14.6 s) — the re-expressed step; anchor restored after user.reload(), 150/150 rows, both tool targets present.
  • ✓ test 4 CONT-01 restores the exact cumulative prefix… (82.7 s).

Verdict for this PR's claim: Passed (observable passing assertion for the cold-reload step including the anchor restore). File-level verdict for streamed-markdown-answer remains Incomplete because of tests 1–2 (#4757). All 7 sandboxes from this run (…-28574) were deleted by the testkit (verified with daytona sandbox list).

The "Starting OpenWork — reload to try again" stall #4780 saw right after user.reload() did not reproduce in this run (step 8 completed in 14.6 s), so there is no screenshot to attach.

Also: git diff --check origin/dev...HEAD clean. pnpm --dir evals typecheck exits 2 with 389 errors, all in packages/email / apps/app (--jsx, TS2835 extension rules) and none in evals/specs; a clean origin/dev control worktree produced the identical 389 errors — pre-existing, not touched.

Noticed, not touched

  1. Tests 1–2 of this file remain red on the Cluster 1/B claims (composer draft after send; notSee of "Preparing the formatted response") — fix(app): keep a brand-new session sendable while its first snapshot loads #4757's scope.
  2. Step 1's title the live cache retains history older than the native 140-message snapshot still reads as if the cache were what saves the older rows; after fix(app): load the whole transcript when opening a session #4695 the renderer simply fetches everything. Its assertions are still true, so I left the wording alone.
  3. pnpm --dir evals typecheck has been red on dev for reasons outside evals/ (see above); worth a separate owner if it is meant to gate anything.
  4. fix(app): persist the reading anchor chosen through Find in the retained history tail #4780's items 2–3 (post-jumpToLatest smoothJump window; redundant probe.eventually waits in the palette specs) still stand.

…on dismiss

Base UI keeps a dialog popup mounted (and partially opaque) until its exit
animation or transition finishes, so the restart prompt and the command
palette stayed visible for 100-200 ms after Keep working / Escape. Hide the
popup with display:none as soon as it is closed; Base UI then unmounts it on
the next frame.
…Find opens or closes

The find bar's clearance toggled padding-top on the scroll container. A padding
change on the scroller is a scroll-anchoring suppression trigger, so the
transcript shifted 48px under the reader with no scroll event and the persisted
reading anchor stayed 48px stale. Render the clearance inside the content
column instead; the browser anchors it and the controller re-saves the anchor.
…ong-history journey

`de965e2b1` (#4695) deliberately fetches the session snapshot without a
`limit`, so a cold open renders every message instead of the newest 140.
The step written by #4614 still expected the bounded 97-row tail after
`user.reload()` and failed once #4780 let the lane reach it.

Re-express the claim as `toEqual(world.history)`, keep the reading-anchor
restore and the tool-link checks, and keep the engine's `?limit=140` page as
the negative witness: it still lacks the oldest turn that the reopened
surface must show.
@vercel

vercel Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 11, 2026 7:09pm UTC
openwork-den Ready Ready Preview Sep 11, 2026 7:09pm UTC
openwork-diagnostics Ready Ready Preview Sep 11, 2026 7:09pm UTC
openwork-landing Ready Ready Preview, v0 Sep 11, 2026 7:09pm UTC

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (4431 ms), confidentiality-review (2888 ms), spec-provenance-review (29281 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 3
  • Distinct heads in retained window: 3
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 3/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

diff-warden[bot]
diff-warden Bot previously approved these changes Sep 10, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (d73d91cdf7b132a1f314ee3962ea740806c5621a). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit 25b21f5ae796594f53acc56d85f9b1e99032408c · selected evidence

Open review report

@yomgui yomgui changed the title test(evals)/fix(app): reconcile the cold-reload history-tail claim with the intended transcript load test(evals): reconcile the cold-reload history-tail claim with the intended transcript load Sep 10, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: 25b21f5
Status:🚫  Build failed.

View logs

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (f6c8e773fdce0d78e8058ce22603556c990f1824). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui

yomgui commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

Resync against origin/dev 0b219dc4e (merge commits, no rebase)

Merge sha: f6c8e773fdce0d78e8058ce22603556c990f1824 (Merge origin/e2e/find-reading-anchor into e2e/history-tail-after-reload-claim, signed G). Merged the updated #4780 (5a5ac9d34, which carries the updated #4742 3a20e25f3 and origin/dev), so origin/dev is contained and a separate git merge origin/dev is a no-op. No conflicts; this branch's only own change is the spec step (cold reload restores the whole ordered transcript…, toEqual(world.history)).

Premise re-check (#4838 4462762b4, #4846 eaef65ce9). Neither changed this step of streamed-markdown-answer (#4846 only migrated savedScroll to the owner-qualified key). The claim this PR re-expresses — a cold reload shows the whole transcript, not a bounded tail — is still what dev intends (#4838: "uncapped full-history read… never treat the preview as complete history… no permanent history truncation"). So the re-expression is not redundant. But its timing premise changed: #4838 mounts groups near the reading anchor first and fills the rest in background batches, so a one-shot orderedHistory() right after expectReadingPosition() is no longer guaranteed to see all 150 rows.

Proof at f6c8e773f (OPENWORK_EVAL_REF pinned; sandbox log HEAD is now at f6c8e773):

OPENWORK_EVAL_REF=f6c8e773fdce0d78e8058ce22603556c990f1824 pnpm evals:e2e streamed-markdown-answer --daytona

{"placement":"daytona","engine":"legacy","files":["streamed-markdown-answer"],"passed":1,"failed":3,"skipped":0,"verdict":"failed"}

test 3 step trace (gitSha f6c8e773f): PASS steps 1–6 (incl. #4742's two browseHistory claims and #4780's choose a reading message inside the retained history tail), then

  • FAIL step 7 switching conversations preserves the reading position, full cached history and scoped targets — expected [ 'Settled history 086.', …(64) ] to deeply equal [ 'Settled history 001.', …(149) ].
  • Step 8 (this PR's claim) not reached.

This is the second run to fail step 7 this way on a dev-resynced head (#4780's run at 5a5ac9d34: rows 082–150; here 086–150 — the batch boundary moves, the pattern does not). At the pre-resync heads (b3bd4205d, d73d91cdf) step 7 passed and step 8 was the first red; the spec text of step 7 is unchanged. Attribute to #4838 first: the transcript re-mounts progressively around the saved anchor (~130) after a session switch, and the spec reads the history once, immediately.

Verdict for this PR's claim: Incomplete — no observable assertion for step 8 on the merged head; blocked on step 7.

What this PR should become (decision needed, not made here): step 7's "full cached history" and step 8's "whole ordered transcript" are the same claim under dev's loading model — eventually true, not instantly. Two honest options: (a) re-express both reads as settle-reads on orderedHistory() (the spec already expresses expectReadingPosition and keyboard browsing settles… that way), which is exactly the spec-only re-expression this PR exists for, and prove it at the resulting head; or (b) have #4838's restore report the anchor settled only once every group is mounted, and keep the one-shot reads. I did not touch the assertion in this resync (no loosening / no waits without a decision).

Other tests, none this PR's claim: × test 1 expected '\n' to be '' (#4757 cluster); × test 2 step 2 Target remained visible: {"text":"Preparing the formatted response."} (same on every dev-resynced head today; dev control at 0b219dc4e queued); ✓ CONT-01. All 7 sandboxes deleted.

Also: evals tsc --noEmit → 0 errors in streamed-markdown-answer.e2e.test.ts (409 pre-existing errors elsewhere in den-api/email/other specs, unchanged by this PR); git diff --check origin/dev...HEAD clean.

#4747 revert check (#4870): this branch does not contain 561b5c03a (git merge-base --is-ancestor false) and git diff origin/dev...HEAD -- apps/app/src/react-app/shell/desktop-runtime-boot.ts is empty against dev 858414c41. No in-branch revert needed.

@yomgui

yomgui commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

Dev control for the test 2 red — OPENWORK_EVAL_REF=0b219dc4e5f2868c258dbe960d58c657dbe8d99b pnpm evals:e2e streamed-markdown-answer --daytona from a clean detached origin/dev worktree (sandbox log HEAD is now at 0b219dc4): passed 1 / failed 3 / skipped 0. Test 2 fails the same way on clean dev — step 1 finished blocks render as markdown… PASS, step 2 live reasoning can be inspected before any reload while the answer is still streaming FAIL Target remained visible: {"text":"Preparing the formatted response."} — so it is pre-existing on dev 0b219dc4e, not introduced by this branch. It is a new signature relative to the pre-dev base (there test 2 never got past the first send), so attribute it to today’s chat batch (#4838/#4844/#4845/#4846) first. Also on clean dev: test 3 fails at step 1 (Target remained visible: {"placeholder":"Search actions, settings, and sessions…"}) — the #4724 dismiss race, i.e. #4724 is still needed; test 1 expected '\n' to be '' (#4757 cluster); CONT-01 passes. All 7 control sandboxes deleted.

Pick up #4888 so ci-tests.yml's packaged Fast module step finds its test file.

Signed-off-by: Guillaume Loret <[email protected]>

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (25b21f5ae796594f53acc56d85f9b1e99032408c). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui
yomgui merged commit df08f97 into dev Sep 11, 2026
28 of 29 checks passed
@yomgui
yomgui deleted the e2e/history-tail-after-reload-claim branch September 11, 2026 19:25

This branch was successfully deployed

4 active deployments
Preview – openwork-den — 25b21f5a Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-landing — 25b21f5a Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-app — 25b21f5a Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-diagnostics — 25b21f5a Deployed Sep 11, 2026 by vercel[bot]
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