Repository navigation
test(e2e): make the cold-hydration spec check its own captured snapshot - #17031
Conversation
`adds no tab when the host workspace snapshot stalls across a relaunch` replays the bytes it reads off the relay, but only ever waited for the snapshot FILE to exist -- never for it to carry the tabs the test had just seeded. A capture that missed the baseline produced a failure that reads as a product regression and is not one: an empty `session.tabsByWorktreePath` places nothing, so it reports nothing unplaced, so `remote-workspace-snapshot-apply.ts` marks the target hydrated and `hydrateTabsSession` replaces the worktree's tabs with none. That is exactly the observed `baseline=3 duringStall=3 afterHydration=0`, and it is correct behaviour for a host snapshot that genuinely holds no tabs. Assert the precondition where it belongs -- on the capture, before the relaunch that consumes it -- so an empty or unparseable fixture names itself instead of surfacing later as a tab count the product appears to have lost. No assertion is weakened: `afterHydration` still has to equal the baseline, and no retry, sleep, or timeout was added.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe test now parses the persisted SSH workspace snapshot before the relaunch scenario. It returns Merge Risk: 🔵 Low · up to The PR only adds earlier validation to an E2E snapshot, leaving production behavior unchanged. It is mergeable with explicit owner awareness that remote snapshots must continue using tabsByWorktreePath so the test validates the intended captured tabs. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, change, rationale, scope, and verification limitations. However, it omits several required template sections, including What Changed, Linked Issue with an issue number, Visual Proof or an explicit N/A statement, Testing checkboxes, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Complete the required template sections. Add a valid linked issue after “Fixes #”, provide Visual Proof or write “N/A” with a reason, document testing and platform coverage, complete the required checkboxes, and address the remaining required sections.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review — looks right, no changes requestedTest-only, so the bar is higher rather than lower. Verified against current The precondition does what it claimsThe e2e itself needs Docker, but the added logic is pure over the captured bytes, so I ran it directly across the cases that matter, with each gate ablated alone:
That is the proof asked for: an empty capture fails only with the fix (last column is green throughout), and a good capture never fires — including the legitimate superset case where the snapshot holds other worktrees' tabs. One honest note on the two assertionsThey are not two independent gates. Everything the No changes requested. |
Review — verified, no defects foundReviewed at head The precondition was verified in both directionsI copied
That last row matters: the assertion cannot flake on extra tabs. Assert #1 throws before assert #2, so the It cannot red a healthy run on id-space groundsI checked the concern that the relay might re-key tab ids on persist. It does not: Sequencing is also safe: tabs are seeded → No assertion was weakenedThe diff is strictly additive (+34/−0): nothing deleted, reordered, or loosened, and no retry, sleep, Live evidence
Gates
The condition this guards against happened live todayWhile running the Docker-SSH lane on a separate branch that deliberately does not include this PR, the spec failed like this:
To be precise about what this shows: One caveat, not a blocker
No defects found. This is a sound spec-precondition fix. |
…hot (stablyai#17031) `adds no tab when the host workspace snapshot stalls across a relaunch` replays the bytes it reads off the relay, but only ever waited for the snapshot FILE to exist -- never for it to carry the tabs the test had just seeded. A capture that missed the baseline produced a failure that reads as a product regression and is not one: an empty `session.tabsByWorktreePath` places nothing, so it reports nothing unplaced, so `remote-workspace-snapshot-apply.ts` marks the target hydrated and `hydrateTabsSession` replaces the worktree's tabs with none. That is exactly the observed `baseline=3 duringStall=3 afterHydration=0`, and it is correct behaviour for a host snapshot that genuinely holds no tabs. Assert the precondition where it belongs -- on the capture, before the relaunch that consumes it -- so an empty or unparseable fixture names itself instead of surfacing later as a tab count the product appears to have lost. No assertion is weakened: `afterHydration` still has to equal the baseline, and no retry, sleep, or timeout was added.
Fixes the
ssh-cold-hydration-gap-tab-seedingspec so it checks its own precondition instead of failing downstream.ELI5
This test captures a session snapshot, relaunches, replays the snapshot, and then checks that the tabs came back. If the capture happened to be empty, the test still sailed through the replay and only fell over much later, on
afterHydration=0— which reads exactly like the product losing your tabs. It wasn't. The test just never looked at what it had captured.Now it asserts the captured snapshot before the relaunch that replays it, so an empty or unparseable capture fails right there and names itself.
Why the old failure was not a product bug
Traced through product code: an empty session places nothing, therefore reports nothing unplaced, therefore marks hydrated and replaces the worktree's tabs with none. That reproduces the observed
baseline=3 duringStall=3 afterHydration=0exactly — and it is correct behaviour for a genuinely empty host snapshot.Before / after
afterHydration=0, indistinguishable from a real tab-loss regressionWhat this is NOT
afterHydrationexpectation is untouched.Context
This spec accounts for 1 of 29 failures on the
e2e / ssh docker watcher isolationlane. The dominant failure on that lane (6 of 7) is a separate staleconnectDockerRemotefork, fixed by #17017.Not verified
Docker is dead on the authoring machine (
docker psreturns EOF;docker desktop restartfails withcontext deadline exceeded), so nothing was run locally — this rests on CI logs and source reading.pnpm tc, lint, the quality gate, and the ratchets are green.