Skip to content

fix: supervise packaged Windows sidecar recovery - #4485

Merged
BunsDev merged 1 commit into
mainfrom
fix/cave-58eoq-1-windows-sidecar-supervision
Aug 10, 2026
Merged

fix: supervise packaged Windows sidecar recovery#4485
BunsDev merged 1 commit into
mainfrom
fix/cave-58eoq-1-windows-sidecar-supervision

Conversation

@BunsDev

@BunsDev BunsDev commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • observe packaged Windows sidecar liveness after readiness and schedule bounded recovery through SidecarStartupControl
  • prevent duplicate/manual startup races and stop supervision before shutdown cancellation and process-job teardown
  • rotate auth across main, Quick Chat, and Notch navigation while preserving presentation state
  • cover crash recovery, failed revival, cooldown/refill, startup ownership, navigation cleanup, and release wiring

Validation

  • 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.rs
  • cargo test --lib sidecar_supervisor::tests (9 passed)
  • cargo test --lib (95 passed)
  • cargo check --lib
  • node src-tauri/release-runtime.test.mjs (24 passed)
  • pnpm lint
  • pnpm typecheck
  • pnpm check:tests-wired
  • git diff --check

Bead: cave-58eoq.1

Copilot AI lite review requested due to automatic review settings August 10, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_pending is never cleared when the supervisor observes RecoveryObservation::Recovered. On Windows, a scheduled recovery sets recovery_pending = true, and once the sidecar becomes live the observation returns Recovered, but the flag stays true forever. That can cause unnecessary re-revive attempts if liveness later reports Unknown (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.

@BunsDev
BunsDev merged commit 12d7c3f into main Aug 10, 2026
22 checks passed
@BunsDev
BunsDev deleted the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 02:57
@BunsDev
BunsDev restored the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 03:24
@BunsDev
BunsDev deleted the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 11:00
@BunsDev
BunsDev restored the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 11:01
@BunsDev
BunsDev deleted the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 11:43
@BunsDev
BunsDev restored the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 11:47
@BunsDev
BunsDev deleted the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 13:10
@BunsDev
BunsDev restored the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 13:29
@BunsDev
BunsDev deleted the fix/cave-58eoq-1-windows-sidecar-supervision branch August 10, 2026 16:41
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.

2 participants