refactor(runtime-host): fold the desktop E2E candidate into the real main - #3106
Conversation
…main Remove desktop-e2e-execution-candidate-main and its package export. Desktop boot always launches execution-candidate-main and passes --desktop-e2e 1 so the same startup path classifies failures and applies the FakeBackend composition, OAuth stubs, idle grace, and parent watch. Fixes apache#3085 Generated-by: Grok
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan includes up to 3 reviews per rolling hour; 1 remains after this review. 📝 WalkthroughProblem solvedDesktop E2E startup now uses The shared entrypoint applies the Desktop E2E composition:
Production composition remains unchanged. Design assessmentThis PR extends the existing candidate main. It does not create a parallel startup path. The change is the smallest coherent solution. The mode flag and its propagation through the CLI, launcher, connection layer, and Desktop boot are required to select the shared composition. The deleted ValidationReported validation includes:
Required-check status is not independently verified from the provided information. Review-relevant risksThe removed package export changes a public package contract. Material changes in public contracts require independent human review under repository policy. Desktop startup behavior now depends on mode-flag propagation and shared composition selection. A propagation or startup-classification regression could affect Desktop E2E behavior. Material changes in user-visible startup behavior require independent human review under repository policy. The person performing the merge must review the final diff. A maintainer makes the final determination. WalkthroughDesktop E2E startup now uses the standard runtime host candidate entrypoint. The ChangesDesktop E2E runtime host
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR consolidates desktop E2E startup onto the production candidate entrypoint while keeping production composition unchanged; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant DesktopApp
participant CandidateLauncher
participant ExecutionCandidateMain
participant DesktopE2eBackend
DesktopApp->>CandidateLauncher: Launch with desktopE2e enabled
CandidateLauncher->>ExecutionCandidateMain: Pass --desktop-e2e 1
ExecutionCandidateMain->>DesktopE2eBackend: Create desktop E2E dependencies
DesktopE2eBackend-->>ExecutionCandidateMain: Provide deterministic backend and OAuth behavior
ExecutionCandidateMain->>DesktopApp: Close runtime when parent exits
Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/runtime-host/src/__tests__/desktop-e2e-execution.test.ts (1)
51-51: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the duplicate version assertion.
Line 50 already asserts that
checkpoint.versionis2. Line 51 adds no coverage.Proposed simplification
- assert.ok(recorded[0]?.checkpoint.version === 2);As per path instructions, flag concrete code that can be deleted or simplified.
Source: Path instructions
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: cc6c16f9-9214-4ee3-b709-5000451dfa1e
📒 Files selected for processing (11)
apps/desktop/src/main/runtime-host-boot.tsapps/desktop/src/main/runtime-host-desktop-candidate.tspackages/runtime-host/package.jsonpackages/runtime-host/src/__tests__/candidate-cli.test.tspackages/runtime-host/src/__tests__/desktop-e2e-execution.test.tspackages/runtime-host/src/candidate-cli.tspackages/runtime-host/src/client/connect-or-spawn.tspackages/runtime-host/src/client/launcher.tspackages/runtime-host/src/desktop-e2e-execution-candidate-main.tspackages/runtime-host/src/desktop-e2e-execution.tspackages/runtime-host/src/execution-candidate-main.ts
💤 Files with no reviewable changes (2)
- packages/runtime-host/src/desktop-e2e-execution-candidate-main.ts
- packages/runtime-host/package.json
Included review availability: Your plan includes up to 3 reviews per rolling hour; 0 remain after this review.
Keep a single version assertion and a type-narrowing return so summary is checked without a second version check. Generated-by: Grok
|
The extra Replaced both with one version assertion and an early return in 21c8de9 so the summary check stays typed without a second version assertion. Generated-by: Grok |
|
Thanks for folding the E2E candidate into the real main — the drift was real and the deletion is thorough. I traced the full flag pipeline and checked for leftovers. Conclusion: PASS. One P2 (suggest a launcher-level test), optional P3 nits. Verified:
Findings:
AI-assisted review disclosure: this review was produced with AI assistance (pi review subagent on 中文摘要(AI 辅助审查)结论:PASS,无 P0/P1,可合并。删除彻底(旧 candidate 全仓 0 残留),flag 管道完整,新模块导出均有消费者;用显式 flag 而非 env 是正确的(env 会被父 shell 意外继承导致静默切 fake backend)。1 个 P2:launcher.ts:89 追加 |
Summary
desktop-e2e-execution-candidate-main.tswas a second copy of candidate startup, selected by module name from Desktop boot underMAKA_E2E=1. It already drifted from the real main (no startup-failure classification, no policy bootstrap).There is now one candidate entrypoint:
desktop-e2e-execution-candidate-main.tsand its@maka/runtime-host/desktop-e2e-execution-candidate-mainexport@maka/runtime-host/execution-candidate-mainand passesdesktopE2e: truewhen the isolated E2E profile is on--desktop-e2e 1; the real main applies FakeBackend +/compactcheckpoint, OAuth stubs,bootstrapRuntimePolicy: false,idleGraceMs: 500, and the Electron parent watchProduction composition is unchanged: the flag is only sent from Desktop E2E.
Fixes #3085
Verification
desktop-e2e-execution-candidate-maincallers or exportnpx biome checkon the changed files — cleannpm --workspace @maka/runtime-host run typecheck— cleannpm --workspace @maka/desktop run typecheck— cleannpm --workspace @maka/runtime-host run test:dist— 943/944. The one failure isowned Host exits promptly after its first connection closesunder full-suite load (failedvsconnectedwith a 2s election window). Isolated 3/3; not this changenpm --workspace @maka/desktop run test:dist— 862/862send-message+slash-command-menu— 5/5 (FakeBackend +/compactstill work)Not run: full desktop e2e suite
AI use
Select exactly one:
Tool(s) and scope:
Grok authored the fold and this PR description.
Checklist
Does this PR entail a change in behavior?