Skip to content

Keep slow dev renderer startup recoverable - #3536

Merged
sawka merged 3 commits into
mainfrom
cosmos/recover-dev-renderer-init
Oct 5, 2026
Merged

sawka merged 3 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: 66ff37eb-fa77-4aae-adeb-4f99a1ed9144

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

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
@augmentcode

augmentcode Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

PR Fixer Agent🔧

👋 I've got this PR.
I'll handle review feedback, CI failures, and merge conflicts.

GitHub updates from this session use the repository's bot account.

@augmentcode

augmentcode Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

PR Fixer Agent🔧

Merged current main (bc6de9a1) into this branch and pushed merge commit 985af013. There were no conflicts; the original renderer change remains unchanged, and the staged whitespace check passed.

This brings in the Go 1.26.8 module/CI alignment from #3537 and removes the retired TestDriver workflows via #3535. The previous failures were in Go-backed generation and the TestDriver build, so these updates address the likely cause and remove the obsolete job.

The new CodeQL checks are running; there are no failures reported on the new head yet. CI success is not confirmed. I'll monitor for failures. The PR itself has not been merged.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying waveterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 985af01
Status: ✅  Deploy successful!
Preview URL: https://a990fb25.waveterm.pages.dev
Branch Preview URL: https://cosmos-recover-dev-renderer.waveterm.pages.dev

View logs

@sawka
sawka merged commit 9f1c967 into main Oct 5, 2026
8 checks passed
@sawka
sawka deleted the cosmos/recover-dev-renderer-init branch October 5, 2026 17:14
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