Repository navigation
fix(e2e): fabricate runtime-host health through the snapshot that owns it - #20762
Conversation
…rite Since #20003 the published snapshot owns runtime-host health, so a bare status seed no longer survives: main's status owner publishes `checking` for this unreachable synthetic host as soon as any runtime RPC touches it, the host reads `connecting`, and the Add Project dialog falls back to Local — so the host-scoped copy the test asserts never renders. Seed a snapshot pinned at the top sequence instead. applyRuntimeHostStatusSnapshot drops any later publication whose sequence is not higher, and setRuntimeEnvironmentStatus no-ops a snapshot-less write once a snapshot exists, so the bare seed could not have worked either way. Ablated: passes with the pinned snapshot, fails without it.
…host-seed-snapshot
…owns it Companion to the onboarding seed fix. Since #20003 the published snapshot owns runtime-host health, so writing `status: null` alone leaves the paired-web client's verified/ready snapshot in place: addRuntimeHost reads snapshot.transport 'ready' before it ever consults status, and the host still renders Connected while the test waits for Disconnected. Rewrite the snapshot coherently instead, pinned at the top sequence so the live status owner cannot restore the host mid-assertion. The disconnected leg uses transport 'unknown' rather than 'disconnected', because a dropped transport is unverifiable and renders as Connecting; only a never-reached host renders Disconnected. remoteControl is nulled because runtimeControlHealth answers 'available' on a ready control socket even with a null status. Ablated with ORCA_E2E_WEB_CLIENT=1 (the whole file is test.skip'd without it, so a run without that flag reports a passing skip): fails without the change, passes with it.
There was a problem hiding this comment.
ℹ️ No critical issues — both fixes are correct and the ablation evidence is convincing. Two optional cleanups below.
Reviewed changes
onboarding.spec.tsruntime seed — seeds a snapshot pinned atNumber.MAX_SAFE_INTEGERwithverification: 'verified'/transport: 'ready', arming the monotonic guard inapplyRuntimeHostStatusSnapshotagainst the status owner's latercheckingpublications. I traced the guard (runtime-status-snapshot.ts:20) and the snapshot-less no-op (runtime-status.ts:171); both claims hold, and the pairing-revision check would reject a mismatched publication anyway, so the seed cannot be clobbered.paired-web-add-project-unavailable-host.spec.tsfabrication — rewrites the snapshot coherently for both legs. Verified againstexecution-host-registry.ts:transport: 'unknown'reachesruntimeHealth(null, null, null)and yieldsdisconnected(whereas'disconnected'short-circuits toconnectingat line 173), andremoteControl: nullis load-bearing because a ready control socket would otherwise makeruntimeHealthansweravailable. Both legs can fail without the fix.
️ Nitpicks
const verified = current?.status ?? current?.snapshot?.status ?? nullis unreachable: theblockedbranch throws whencurrent.statusis falsy, and thedisconnectedbranch never readsverified. Dropping the fallback keeps the intent clear.- Both specs now hand-roll the same snapshot fabrication (pairing revision,
MAX_SAFE_INTEGER,checkedAt). A smalltests/e2e/helpersseed would keep the #20003 trap from being rediscovered by the next spec.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe onboarding E2E setup now seeds a verified ready snapshot with pairing metadata and Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The changes correctly seed the runtime health states required by the affected E2E flows without introducing an identified production or test-suite risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, mechanism, fixes, validation, and scope. However, it omits required template sections, including the linked issue, visual proof or an explicit N/A statement, testing checklist status, AI disclosure, review, boundary, notes, and checklist.
✨ 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 |
Electron UI validation (CDP, hidden renderer)Attached to Replayed the two spec fabrications against the real Add Project dialog:
Console: 4 errors, all No proven visible regression in the two test-only fixes. Remaining gaps: paired-web client was not launched ( |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Preserve paired runtime status metadata —
setOnlyRuntimeHostHealthnow spreads...currentbefore overridingsnapshot,checkedAt,status, andremoteControl, so the fabricated entry keepsappVersionandconnectionGenerationinstead of dropping them. The override order keeps every faked field authoritative, andaddRuntimeHostreads neither preserved field for health (execution-host-registry.ts:153-197), so both legs still render as asserted. - Comment correction on the
'unknown'transport — reworded to explain that an unavailable/unknown snapshot falls throughruntimeControlHealthtoruntimeHealth(null, null, null) → 'disconnected', whereas an explicit'disconnected'transport short-circuits to'connecting'. This matches the actual branches atexecution-host-registry.ts:167-186.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Review status: ready to mergeThe review/fix loop is clean. Commit Validation completed:
The final diff remains limited to the two requested E2E specs. No production, mobile, RPC, dependency, or performance-sensitive code was changed. |
…s it (stablyai#20762) * fix(e2e): seed the runtime host with a snapshot the host cannot overwrite Since stablyai#20003 the published snapshot owns runtime-host health, so a bare status seed no longer survives: main's status owner publishes `checking` for this unreachable synthetic host as soon as any runtime RPC touches it, the host reads `connecting`, and the Add Project dialog falls back to Local — so the host-scoped copy the test asserts never renders. Seed a snapshot pinned at the top sequence instead. applyRuntimeHostStatusSnapshot drops any later publication whose sequence is not higher, and setRuntimeEnvironmentStatus no-ops a snapshot-less write once a snapshot exists, so the bare seed could not have worked either way. Ablated: passes with the pinned snapshot, fails without it. * fix(e2e): fabricate paired-web host health through the snapshot that owns it Companion to the onboarding seed fix. Since stablyai#20003 the published snapshot owns runtime-host health, so writing `status: null` alone leaves the paired-web client's verified/ready snapshot in place: addRuntimeHost reads snapshot.transport 'ready' before it ever consults status, and the host still renders Connected while the test waits for Disconnected. Rewrite the snapshot coherently instead, pinned at the top sequence so the live status owner cannot restore the host mid-assertion. The disconnected leg uses transport 'unknown' rather than 'disconnected', because a dropped transport is unverifiable and renders as Connecting; only a never-reached host renders Disconnected. remoteControl is nulled because runtimeControlHealth answers 'available' on a ready control socket even with a null status. Ablated with ORCA_E2E_WEB_CLIENT=1 (the whole file is test.skip'd without it, so a run without that flag reports a passing skip): fails without the change, passes with it. * test(e2e): preserve paired runtime status metadata





Two E2E specs have been red on
mainsince #20003 landed. Both fail for the same reason, and neither is a product defect — the specs fabricate runtime-host health in a way that stopped working when #20003 moved ownership of that health.Mechanism
Since #20003 the published snapshot owns runtime-host health. Two consequences the specs predate:
setRuntimeEnvironmentStatus(runtime-status.ts:171-173) no-ops a snapshot-less write once a snapshot exists.applyRuntimeHostStatusSnapshot(runtime-status-snapshot.ts) drops any publication whosesequenceis not higher than the stored one.So a bare status seed either never lands, or is overwritten by the host's own status owner — which publishes
checkingfor an unreachable synthetic host as soon as any runtime RPC touches it. The host then readsconnecting, and the Add Project dialog falls back to Local.The two fixes
onboarding.spec.ts:422— seed a snapshot pinned at the top sequence, so the monotonic guard drops the host's latercheckingpublications.paired-web-add-project-unavailable-host.spec.ts— thedisconnectedleg wrotestatus: nullwhile leaving a verified/ready snapshot in place.addRuntimeHostreadssnapshot.transport === 'ready'before it consultsstatus, so the host still rendered Connected. The fabrication now rewrites the snapshot coherently and pins it.Two details in that second fix are load-bearing and verified in the product code rather than assumed:
transport: 'unknown', not'disconnected'— withverification: 'unavailable', the shared registry falls through to the no-status path and renders Disconnected. An explicit'disconnected'transport is treated as a reconnecting control channel and renders Connecting (execution-host-registry.ts:167-186).remoteControl: null—runtimeControlHealthanswersavailableon a ready control socket even with a null status (execution-host-registry.ts:91).Validation
Both fixes ablated individually, each with a syntactically valid revert so the spec actually executes in both arms:
onboarding.spec.ts:422paired-web-add-project-unavailable-hostRe-proved at the current head after merging main, since the earlier evidence was against a base 99 commits old.
One trap worth recording: the paired-web file is
test.skip'd behindORCA_E2E_WEB_CLIENT !== '1', so a run without that flag reports1 skippedand exits 0. My first run looked green and had verified nothing.Not addressed here: the other specs currently red on main (
quick-open-file-paths,terminal-attention,headless-paired-remote-terminal-retention-memory,native-chat-first-flush-race). Unrelated causes.