Skip to content

feat(desktop): add Windows native pywebview + pystray harness#5494

Open
whoxllm wants to merge 2 commits into
odysseus-dev:devfrom
whoxllm:desktop/windows-native-harness
Open

feat(desktop): add Windows native pywebview + pystray harness#5494
whoxllm wants to merge 2 commits into
odysseus-dev:devfrom
whoxllm:desktop/windows-native-harness

Conversation

@whoxllm

@whoxllm whoxllm commented Jul 12, 2026

Copy link
Copy Markdown

Summary

Adds an optional native Windows desktop harness (odysseus-desktop.py) that wraps the existing backend. It starts uvicorn (app:app) as a managed subprocess (health-checked against /api/health, auto-restart), embeds the existing web UI in a native pywebview window, adds a system-tray icon (start/stop/open/quit, close-to-tray), creates a per-user Start Menu shortcut on first launch, and sets an AppUserModelID so the taskbar shows the Odysseus icon instead of generic Python. On first launch it initializes its own data dir + DB and lets the web UI's "Create Admin Account" screen handle the admin — a single launch command, no separate setup step.

It does not touch app.py or any core route. The whole change is 3 new files + 3 deps in requirements-optional.txt (opt-in, so the core/Docker install is unaffected).

Working example (standalone build you can run today): https://github.com/whoxllm/odysseus-desktop

Target branch

  • This PR targets dev, not main.

Linked Issue

Closes #5561

Type of Change

  • New feature (non-breaking — adds new behaviour)

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app (docker compose up or uvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.

How to Test

On Windows (Python 3.11+, Git):

git clone -b desktop/windows-native-harness https://github.com/whoxllm/odysseus.git
cd odysseus
python -m venv venv
venv\Scripts\python.exe -m pip install -r requirements.txt -r requirements-optional.txt
venv\Scripts\python.exe odysseus-desktop.py

The harness creates its data dir + DB, starts the backend, and opens a native window to Create Admin Account. A boat icon appears in the tray; Odysseus appears in the Start Menu.

Visual / UI changes

This is OS integration (native window, tray, Start Menu, taskbar icon), not a change to the web frontend/CSS — no static/ rendering is altered. Screenshots of the desktop experience below.

Disclosure: built with Claude Code (AI-assisted). Not a bulk auto-generated PR — issue #5561 was opened first per the guideline, the commits carry Co-Authored-By: Claude (matching this project's own convention), and it's a single focused feature I've run and verified end-to-end.

(Screenshots: Start Menu entry with the boat icon, and the Create Admin Account window — attached in a comment.)

@github-actions github-actions Bot added the needs work PR description incomplete — please update before review label Jul 12, 2026
@whoxllm
whoxllm force-pushed the desktop/windows-native-harness branch from f19e853 to df42f9c Compare July 13, 2026 05:25
whoxllm and others added 2 commits July 16, 2026 00:37
odysseus-desktop.py wraps the existing backend as a native Windows app:
- starts uvicorn (app:app) as a managed subprocess, health-checked against
  /api/health with auto-restart,
- embeds the existing web UI in a native pywebview window (no browser tab),
- system-tray icon with start/stop/open/quit and close-to-tray,
- creates a per-user Start Menu shortcut on first launch (plus a tray action
  to recreate it), and
- sets an explicit AppUserModelID so the taskbar shows the Odysseus icon
  instead of the generic Python host icon.

No changes to app.py or core routes. The three new deps (pywebview, pystray,
pillow) go in requirements-optional.txt so the core/Docker install is
unaffected. Includes a PyInstaller spec for building a standalone .exe.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…aunch)

On first launch odysseus-desktop.py now creates the data dirs and initializes
the DB (reusing setup.py's create_dirs/init_database), but does NOT create an
admin — the web UI's 'Create Admin Account' screen handles that in-app. This
means the harness is launch-and-go: no separate 'setup.py install' step and no
'start the server with uvicorn' terminal hint that reads like the install
didn't finish. Idempotent and best-effort; the backend also self-initializes
core.database on import.

The optional desktop deps (pywebview/pystray/pillow) stay in
requirements-optional.txt so the core install is unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@whoxllm
whoxllm force-pushed the desktop/windows-native-harness branch from df42f9c to 799dd98 Compare July 17, 2026 20:22
@github-actions github-actions Bot added ready for review Description complete — ready for maintainer review and removed needs work PR description incomplete — please update before review labels Jul 17, 2026
@whoxllm

whoxllm commented Jul 17, 2026

Copy link
Copy Markdown
Author
Odysseus-desktop_install Screenshot 2026-07-12 134926

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Windows desktop app (tray + Start Menu) — working example + a branch ready to merge

1 participant