feat(desktop): reliable launch and startup feedback #755

Merged
dries merged 11 commits from factory/desktop-launch-feedback into main 2026-09-29 10:52:53 +02:00
Owner

Makes the desktop (-gui) app launch reliably and report what is wrong when it can't start.

Changes

  • WebView: the desktop window loads the backend URL directly instead of proxying it.
  • Logging: the log is also written to a file, not only stderr.
  • Fatal startup errors: a native dialog shows the error instead of the app exiting silently.
  • Missing opencode.db: ocman starts without it instead of exiting.
  • Doctor: new GET /api/doctor returns structured prerequisite checks. An onboarding setup panel and banner are built on it.
  • Frontend: a global banner appears when the backend is unreachable, and boot errors are never shown blank.
  • GUI lifecycle: single-instance lock, graceful shutdown on Cmd+Q, and a prompt when MCP is unavailable.
  • Version: the git describe version is stamped into the binary, the app bundle and the About panel.

Verification

  • go vet ./... passes, and golangci-lint run reports 0 issues.
  • go test . ./internal/... passes.
  • Frontend: tsc -b and pnpm lint pass. vitest run: 291 files, 2741 tests passed.
  • The platform-branching, host-helpers and settings-rows guard scripts pass.
  • The branch merges cleanly into current main (checked with git merge-tree).
Makes the desktop (`-gui`) app launch reliably and report what is wrong when it can't start. ## Changes - **WebView:** the desktop window loads the backend URL directly instead of proxying it. - **Logging:** the log is also written to a file, not only stderr. - **Fatal startup errors:** a native dialog shows the error instead of the app exiting silently. - **Missing opencode.db:** ocman starts without it instead of exiting. - **Doctor:** new `GET /api/doctor` returns structured prerequisite checks. An onboarding setup panel and banner are built on it. - **Frontend:** a global banner appears when the backend is unreachable, and boot errors are never shown blank. - **GUI lifecycle:** single-instance lock, graceful shutdown on Cmd+Q, and a prompt when MCP is unavailable. - **Version:** the `git describe` version is stamped into the binary, the app bundle and the About panel. ## Verification - `go vet ./...` passes, and `golangci-lint run` reports 0 issues. - `go test . ./internal/...` passes. - Frontend: `tsc -b` and `pnpm lint` pass. `vitest run`: 291 files, 2741 tests passed. - The platform-branching, host-helpers and settings-rows guard scripts pass. - The branch merges cleanly into current `main` (checked with `git merge-tree`).
The Wails asset server proxy presented Host "wails" (421 from the host
allowlist), a wails:// Origin (403 on every POST), an X-Forwarded-For
header, and could not carry WebSocket upgrades. The wails:// start page
now probes the loopback backend with a 10s timeout and redirects the
WebView to it, or shows an error page with retry when it is down.

Without the Wails runtime script on the http origin, the frontend tags
the desktop shell via the native external message handler and posts
drag itself so the title bar still moves the window.
A missing OpenCode database now logs a warning and starts with the
opencode platform disabled, recording a startup issue on the server.
/api/projects serves remote projects (or []) without a local DB, and
/api/sessions returns [] instead of null.
build(desktop): stamp git-describe version into binary, bundle and About panel
Some checks failed
CI / Frontend (pull_request) Successful in 13m1s
CI / Backend (pull_request) Failing after 14m6s
CI / Playwright E2E (pull_request) Successful in 16m38s
CI / Semantic Tag (pull_request) Has been skipped
CI / Coverage Results (pull_request) Failing after 30s
ea48eeffbe
fix(plugins): skip stale outbox claims so a reply is not posted twice
All checks were successful
CI / Frontend (pull_request) Successful in 13m19s
CI / Backend (pull_request) Successful in 15m45s
CI / Playwright E2E (pull_request) Successful in 16m0s
CI / Coverage Results (pull_request) Successful in 29s
CI / Semantic Tag (pull_request) Successful in 10s
266a26d516

Coverage ratchet: ✅ pass

Suite Baseline This PR Δ
frontend 82.90% 83.03% +0.13 ✅
go 84.80% 84.70% -0.10 ✅

Tolerance: -0.1%. Baseline stored on gh-pages.

<!-- coverage-ratchet --> ### Coverage ratchet: ✅ pass | Suite | Baseline | This PR | Δ | | |---|---|---|---|---| | frontend | 82.90% | 83.03% | +0.13 | ✅ | | go | 84.80% | 84.70% | -0.10 | ✅ | _Tolerance: -0.1%. Baseline stored on `gh-pages`._
dries merged commit 1e446d8299 into main 2026-09-29 10:52:53 +02:00
dries deleted branch factory/desktop-launch-feedback 2026-09-29 10:52:54 +02:00
Sign in to join this conversation.
No description provided.