Repository navigation
Conversation
This was referenced Oct 28, 2026
neriousy
force-pushed
the
desktop-update-lock
branch
from
November 4, 2026 16:22
706f379 to
6928334
Compare
This branch has not been deployed
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.
Issue for this PR
Closes #
Type of change
What does this PR do?
When the background service fails to boot (seen on Windows after an auto-update as
SQLiteError: database is locked), it stays alive and registered in a failed state by design. Every later launch of the same Desktop version reuses it and shows "Background service failed to start" again, so the existing Restart button can't recover. Users currently have to killopencode-cli.exeby hand.This makes the error page's existing Restart button recover from it. For local server startup failures, Restart now stops the registered service before relaunching:
BackgroundService.stopin the main process callsService.stopfrom the client with the same registration fileensure()uses. That stops the process and removesservice.json.AppRestartServiceRPC stops the service and then relaunches the app, so the next startup spawns a fresh service. If no service is registered, stopping does nothing and it just relaunches. If stopping fails, the app does not relaunch and the error is shown on the page.Platform.restartServiceis optional. The error page uses it only when the platform provides it and the error is markedlocalServerStartup. Every other error keeps the plain relaunch, so a healthy shared service (for example one serving TUI clients) is never killed after a renderer crash. Web is unchanged.Persistent terminals are cleared, not handed off. A service that failed to boot can't hand them off, and
opencode service restartbehaves the same way.This PR doesn't fix the root cause of the lock:
journal_mode = WALruns beforebusy_timeoutis set, so it has a 0 ms busy wait. That will be a separate PR.How did you verify your code works?
bun typecheckinpackages/appandpackages/desktopbun test srcinpackages/desktop;bun test src/shell/errorsinpackages/appScreenshots / recordings
No visual change; the Restart button behaves differently for local server startup failures.
Checklist