Skip to content

Keep slow dev renderer startup recoverable - #3536

Open
augmentcode[bot] wants to merge 2 commits into
mainfrom
cosmos/recover-dev-renderer-init
Open

augmentcode[bot] wants to merge 2 commits into
mainfrom
cosmos/recover-dev-renderer-init

Conversation

@augmentcode

@augmentcode augmentcode Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The five-second development timeout rejected initializeTab before it could send wave-init. A late renderer ready IPC still resolved the original handshake, but startup had already been abandoned, leaving a hidden/blank renderer.

  • Keep five seconds as a one-shot diagnostic threshold for both initPromise and waveReadyPromise; reveal the window/DevTools and continue waiting instead of treating slowness as fatal.
  • Target DevTools at the awaited renderer, preserve promise rejection propagation, and abort development waits on window closure, renderer destruction, or renderer-process loss.
  • Remove timers/listeners on completion or failure. Production waiting and IPC/hot-spare behavior are unchanged.

A larger fixed timeout would only move the race. A live renderer that never signals readiness still remains pending with diagnostics available; automatic crash recovery and production timeouts are outside this fix.

The final diff is one production-source file, +39/-20 lines. The oversized 212-line mocked Electron test harness was removed following review; it was disproportionate to this change. The main-process fix is byte-for-byte unchanged from the version verified in Electron.

Validation

  • Actual task electron:linuxquickdev, as codespace, with isolated app data and sandbox intact: naturally crossed the diagnostic threshold at 19.923s, sent normal wave-init at 20.128s, and completed the wave-ready wait at 20.332s. Vite was ready at 13.840s; mapped-window timing was not treated as app readiness.
  • Inspected rendered app pixels and an integrated terminal executing printf 'WAVE_RUNTIME_OK\n', producing the marker and returning a prompt. No runtime delay injection was needed.
  • task check:ts: 17 existing errors in three preview fixture files. A read-only compiler comparison against the exact unchanged main-process source produced identical diagnostics; the fix adds none.
  • git diff --check: passed, including after removal of the test harness. Confirmed the runtime-verified main-process source did not change in that follow-up.
  • The initial 14 mocked test cases passed during implementation, but are not part of the final PR. Electron was not rerun merely for deleting that test-only file.
  • Task-generated lockfile metadata churn excluded. No backend/wsh rebuild or dependency upgrade. Task processes and private scratch logs/data cleaned up.

Original investigation, tradeoffs, checks, and timing report · Rendered app screenshot · Terminal verification screenshot

Cosmos evidence links require VFS permissions. The linked report is a historical record of the original local-validation stage, including the test harness subsequently removed; this PR description reflects the final scope. Raw runtime logs are not uploaded. The upstream first-load delay remains unproven. Other operating systems, production packaging, and the full test suite were not run.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 39940a81-c248-478a-b53f-03b10279289d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sawka
sawka marked this pull request as ready for review October 2, 2026 00:26

This branch has not been deployed

No deployments
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