Skip to content

fix(gui): replace tokio interval with gpui timer to prevent panic - #701

Open
clifinger wants to merge 1 commit into
AprilNEA:masterfrom
clifinger:fix/gui-tokio-panic
Open

fix(gui): replace tokio interval with gpui timer to prevent panic#701
clifinger wants to merge 1 commit into
AprilNEA:masterfrom
clifinger:fix/gui-tokio-panic

Conversation

@clifinger

Copy link
Copy Markdown
Contributor

Summary

The recent commit a2613f5684f4 added a tokio::time::interval to the GUI's background loop, but openlogi-desktop runs its async block on GPUI's executor (smol), not a Tokio reactor. This causes an immediate panic on startup: there is no reactor running, must be called from the context of a Tokio 1.x runtime.

This PR replaces the Tokio interval with GPUI's native cx.background_executor().timer(), which correctly yields on the GPUI executor.

Changes

  • crates/openlogi-desktop/src/main.rs: swapped tokio::time::interval for gpui::Timer to avoid Tokio dependency in the UI loop.

Testing

  • Verified on Ubuntu 26.04. The app now launches successfully and connects to the agent without panicking.

Fixes # (no issue, observed locally)

@clifinger
clifinger requested a review from AprilNEA as a code owner August 20, 2026 04:53
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

Replaces the Tokio interval in the desktop background loop with a GPUI executor timer, avoiding startup panic when the GUI runs without a Tokio reactor.

  • Creates a one-shot GPUI timer for periodic camera scans.
  • Re-arms the timer whenever its select branch fires.
  • Preserves scanning while using the GUI application's native executor.

Confidence Score: 5/5

The PR appears safe to merge, with the replacement timer remaining periodically re-armed on the GPUI executor.

The GPUI timer task can be polled by the existing select loop, and every completed timer is unconditionally replaced before control returns to that loop.

Important Files Changed

Filename Overview
crates/openlogi-desktop/src/main.rs Replaces the Tokio-dependent camera scan interval with a correctly re-armed GPUI timer; no actionable defect was identified.

Reviews (1): Last reviewed commit: "fix(gui): replace tokio interval with gp..." | Re-trigger Greptile

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