fix: supervise packaged Windows sidecar recovery - #4485
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Windows packaged-sidecar supervision and recovery so the desktop app can detect post-ready sidecar crashes, schedule bounded revival via the existing SidecarStartupControl owner, and keep auxiliary windows (Quick Chat / Notch) authenticated without losing their navigation/presentation state.
Changes:
- Start the sidecar supervisor on Windows after the initial startup worker is spawned.
- Extend the supervisor to coordinate with Windows
SidecarStartupControl(avoid duplicate startup races; add “scheduled” recovery state). - Refresh auxiliary window URLs during recovery and adjust Windows startup cleanup semantics; expand release-runtime wiring assertions.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src-tauri/src/tauri_setup.rs | Starts the supervisor alongside Windows sidecar startup. |
| src-tauri/src/sidecar_supervisor.rs | Adds Windows-compatible supervision/revival coordination and startup-in-progress gating. |
| src-tauri/src/sidecar_startup.rs | Refreshes auxiliary window URLs during recovery; switches Windows startup cleanup to stop_after_startup_attempt. |
| src-tauri/src/sidecar_lifecycle.rs | Exposes SidecarStartupControl liveness flags and adds Windows startup-attempt stop helper; stops supervisor before shutdown cancellation. |
| src-tauri/release-runtime.test.mjs | Updates wiring test to assert new Windows supervision/recovery behavior is present in the native host. |
Suppressed comments (1)
src-tauri/src/sidecar_supervisor.rs:188
recovery_pendingis never cleared when the supervisor observesRecoveryObservation::Recovered. On Windows, a scheduled recovery setsrecovery_pending = true, and once the sidecar becomes live the observation returnsRecovered, but the flag stays true forever. That can cause unnecessary re-revive attempts if liveness later reportsUnknown(or any non-Alive state) even though the sidecar is healthy.
RecoveryObservation::Recovered => {
// Forget any earlier crash history so an unrelated failure
// weeks into a session gets a full budget.
budget.recovered();
continue;
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SidecarStartupControlValidation
rustfmt --edition 2021 --check --config skip_children=true src-tauri/src/sidecar_lifecycle.rs src-tauri/src/sidecar_startup.rs src-tauri/src/sidecar_supervisor.rs src-tauri/src/tauri_setup.rscargo test --lib sidecar_supervisor::tests(9 passed)cargo test --lib(95 passed)cargo check --libnode src-tauri/release-runtime.test.mjs(24 passed)pnpm lintpnpm typecheckpnpm check:tests-wiredgit diff --checkBead:
cave-58eoq.1