Skip to content

fix(ui): recover hardware after daemon ownership loss (v0.3.10)#94

Merged
DevVig merged 2 commits into
mainfrom
fix/daemon-self-recovery
Jul 23, 2026
Merged

fix(ui): recover hardware after daemon ownership loss (v0.3.10)#94
DevVig merged 2 commits into
mainfrom
fix/daemon-self-recovery

Conversation

@DevVig

@DevVig DevVig commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • supervise the app-owned daemon and restart it when a surviving UI loses an older overlapping process daemon
  • preserve reachable standalone/headless services and suppress recovery during clean shutdown
  • align all release versions at v0.3.10 and make clean macOS Tauri release builds deterministic under the current Rust toolchain

Why

During login, update, or direct relaunch overlap, a newer UI process can attach to the older UI process daemon. When the older UI exits it correctly terminates its child, but the surviving UI previously reconnected forever without starting a replacement. That made a macOS-visible Codex Micro appear not detected and removed Claim/Retry from the menu.

How to validate

  • npm test -- --run (35 passed)
  • npm run build
  • cargo test --workspace --all-targets (88 passed)
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --manifest-path apps/microbridge-ui/src-tauri/Cargo.toml --all-targets (12 passed)
  • cargo clippy --manifest-path apps/microbridge-ui/src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • build a clean v0.3.10 .app with the bundled v0.3.10 daemon
  • launch two isolated app instances against one socket, confirm instance A owns the daemon, exit A, and confirm instance B starts a replacement daemon within the bounded interval and rediscovers codex-micro-usb
  • confirm the installed v0.3.9 app reports codex-micro-usb, device_connected: true, and hardware control enabled

Screenshots / GIF

No visual change; this restores the existing Detected / Claim / Retry / Release surfaces after daemon loss.

Risk / rollout notes

  • Recovery is disabled when legacy migration rolls back to a restored service.
  • A reachable explicit Homebrew/headless daemon remains authoritative.
  • The shutdown flag prevents the supervisor from spawning an orphan during app exit.
  • Release publication remains tag-driven; signed/notarized assets and Homebrew promotion follow only after this PR merges.

DevVig added 2 commits July 22, 2026 22:42
Supervise the app-owned daemon so updater, login, and relaunch overlap cannot leave a surviving menu bar UI permanently offline. Stop recovery during shutdown and preserve restored legacy-service ownership.
Align app, daemon, protocol client, and package versions for the daemon recovery release. Keep clean macOS Tauri release builds deterministic by skipping the redundant debuginfo strip pass that corrupts proc-macro dylibs under the current toolchain.
Copilot AI review requested due to automatic review settings July 23, 2026 02:43
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3d87b38e-172f-4be8-bb17-468ed1b7adb6

📥 Commits

Reviewing files that changed from the base of the PR and between b1bfc52 and 67a2680.

⛔ Files ignored due to path filters (3)
  • Cargo.lock is excluded by !**/*.lock
  • apps/microbridge-ui/package-lock.json is excluded by !**/package-lock.json
  • apps/microbridge-ui/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • Cargo.toml
  • adapters/claude/hooks/microbridge-permission.mjs
  • adapters/sdk/package.json
  • apps/microbridge-ui/package.json
  • apps/microbridge-ui/src-tauri/Cargo.toml
  • apps/microbridge-ui/src-tauri/src/lib.rs
  • apps/microbridge-ui/src-tauri/tauri.conf.json
  • docs/releases/v0.3.10.md

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

@DevVig
DevVig merged commit e01bfd4 into main Jul 23, 2026
8 checks passed
@DevVig
DevVig deleted the fix/daemon-self-recovery branch July 23, 2026 02:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves Microbridge UI resilience by supervising the app-owned bundled daemon and restarting it when a surviving UI process loses ownership of an overlapping process’s daemon, while avoiding interference with reachable standalone/headless daemons and aligning the repository for the v0.3.10 release.

Changes:

  • Add a bundled-daemon supervisor loop in the Tauri UI to recover from daemon ownership loss and suppress recovery during shutdown.
  • Align Rust/Tauri/Node adapter versions to v0.3.10 and add v0.3.10 release notes.
  • Adjust the Tauri Rust release profile to make clean macOS builds deterministic under the current toolchain.

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/releases/v0.3.10.md Adds v0.3.10 release notes documenting daemon recovery and hardware status behavior.
Cargo.toml Bumps workspace version to 0.3.10.
Cargo.lock Updates workspace crate versions to 0.3.10.
apps/microbridge-ui/src-tauri/tauri.conf.json Bumps Tauri app version to 0.3.10.
apps/microbridge-ui/src-tauri/src/lib.rs Implements daemon supervision/recovery logic and shutdown suppression.
apps/microbridge-ui/src-tauri/Cargo.toml Bumps UI crate version and disables release stripping for deterministic macOS builds.
apps/microbridge-ui/src-tauri/Cargo.lock Updates UI workspace lockfile versions to 0.3.10.
apps/microbridge-ui/package.json Bumps UI npm package version to 0.3.10.
apps/microbridge-ui/package-lock.json Updates lockfile version fields to 0.3.10.
adapters/sdk/package.json Bumps adapter SDK version to 0.3.10.
adapters/claude/hooks/microbridge-permission.mjs Bumps reported adapter_version to 0.3.10.
Files not reviewed (1)
  • apps/microbridge-ui/package-lock.json: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +114 to +122
let Some(state) = app.try_state::<AppState>() else {
return;
};
if state.shutting_down.load(Ordering::Acquire) {
return;
}
if daemon_is_reachable() {
continue;
}
Comment on lines +123 to +125
let Ok(mut child_slot) = state.bundled_daemon.lock() else {
continue;
};
Comment on lines 2364 to 2368
.run(|app, event| {
if matches!(event, tauri::RunEvent::Exit) {
if let Some(state) = app.try_state::<AppState>() {
state.shutting_down.store(true, Ordering::Release);
if let Ok(mut guard) = state.bundled_daemon.lock() {
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