Skip to content

Run a worker from the desktop app - #1003

Merged
theatrus merged 8 commits into
mainfrom
desktop-worker
Oct 26, 2026
Merged

theatrus merged 8 commits into
mainfrom
desktop-worker

Conversation

@theatrus

@theatrus theatrus commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

The desktop app can run a worker for another PSF Guard server on macOS or Windows. Open Settings › Workers › Worker on this computer, enter the server address and worker token, then click Save worker settings and Start worker. The worker continues running in the menu bar or system tray after the app window closes.

The worker computer runs processing tasks; the server stores the catalog and results. Workers for this server lists connections, creates worker tokens and controls where tasks run. The desktop form configures this computer’s connection to a server.

Changes include:

  • Explicit labels for Worker token, Worker name, Task types, Concurrent tasks, Task files, and Temporary task folder. Help text explains blank fields and defaults. Both sides of each shared-folder mapping have visible labels.
  • Pause worker lets running tasks finish; a pending request may still return one task. Stop worker returns unfinished tasks to the server’s queue. The tray distinguishes waiting for a connection, waiting for tasks and a stopped worker.
  • Task files transfer through the server by default. Shared storage is optional. The server settings correctly describe the live previews already supported for worker stack builds.
  • Optional login startup, separate worker logs, and a local control port protected by a random secret. The app does not return saved tokens to the frontend. Unix settings files use mode 0600.
  • Single-instance handling brings the existing app window forward. Published Seiza 0.44.2 / seiza-stacking 0.51.2 prevents RC-Astro console windows on Windows; stacking output version remains 0.51.0, retaining valid cached stacks.

The Workers guide, design record, release notes, accessible labels and tests use the same terminology.

Screenshots

Browser fixtures simulate Tauri commands. These screenshots verify the rendered form; they do not demonstrate native tray or login behavior.

Desktop worker settings

Phone: labeled shared-folder mappings Server folder and folder on this computer, with visible labels on phone

Validation

  • cargo fmt --all -- --check.
  • Focused Rust tests with all features: tray menu 1 passed; worker settings 2 passed.
  • npm run lint, npm run build; focused desktop/server worker Vitest files: 11 passed.
  • scripts/e2e-local.mjs e2e/desktop-worker-settings.spec.ts e2e/worker-settings.spec.ts: 4 passed, Chromium and WebKit, including phone-width mapping fields, saved-token behavior, worker startup and token revocation. The desktop/phone screenshot cases were also rerun successfully after correcting the captures.
  • On the updated stacked Run the worker as a Windows service #1004 branch, workspace/all-targets/all-features Clippy passed; worker Rust tests: 74 passed, 2 ignored. Its additional service-status browser cases also passed.
  • git diff --check; screenshots visually inspected.

Native Windows tray/login behavior and bundled-app single-instance behavior were not exercised in this language pass. The original branch reported manual macOS tray connection, pause/resume, shutdown and duplicate-start checks at 7b9ffba; those checks were not repeated here.

Known limits

  • Pause cannot cancel a task request already waiting at the server.
  • Windows app updates stop the tray worker without disconnecting it from the server first. It starts again at the next login. Uninstalling the app leaves its login entry.
  • The macOS menu bar uses the full-color app icon.

theatrus and others added 4 commits October 25, 2026 18:35
…l controls

`psf-guard worker --config FILE` reads the worker's settings from a file
only its user can read, and `--tray` runs the desktop app's worker in the
macOS menu bar or the Windows system tray, with Tauri's tray and no
window. The worker keeps a status (connection, running tasks and their
progress, the latest problem) and can pause taking new tasks. A tray
worker serves its status, pause, resume and quit on a localhost port,
behind a secret in a file beside its settings, for the desktop app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t it at login

Settings › Run a worker in the desktop app saves the worker's settings,
starts it in the menu bar or the system tray, shows its connection and
running task, and pauses, restarts or stops it through its local
controls. "Start the worker when I log in" adds a LaunchAgent on macOS
and a Run entry on Windows. The tray exits when the worker is stopped on
purpose, and a second start leaves a running worker alone. Settings ›
Workers on a server now shows a new token on its own, for the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Open PSF Guard, and opening the app from the Dock or the Finder while the
  tray runs, start the app's executable directly. The main app now runs
  with tauri-plugin-single-instance, registered first, and loads the
  registry and starts its desktop server only after that check, so a
  second launch brings the window forward instead of starting a second
  server.
- The tray serves its controls on a thread of its own until it exits, so
  Stop and Restart wait for the worker to leave the server, and a worker
  that the server refused, or whose settings cannot run, shows why. Start
  quits such a tray before starting a new one.
- The status shows a lost connection until a claim succeeds again.
- The host name is read without starting `hostname`, which opened a
  console window on Windows.
- The worker's logs start `worker`, so the app's week of logs no longer
  counts them; the settings live in the local profile on Windows; the
  control client ignores system proxies; the control file is named after
  its settings file; --config and --tray refuse the other options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…indows

seiza-stacking 0.51.2 starts RC-Astro tools with CREATE_NO_WINDOW, so the
tray worker and the Windows service open no console window for each
rc-astro probe and run. It also brings 0.51.1's faster blind registration
for mosaics. Stacking output stays 0.51.0, so cached stacks remain valid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theatrus and others added 4 commits October 25, 2026 19:38
…s and optional shared storage

The desktop app's worker is the This computer section of Settings ›
Workers, not a tab of its own. Its labels are short: Server address,
Token, Name, Work, Tasks at once, Start at login, and Start, Pause,
Resume, Restart and Stop; the tray menu has Pause, Resume, Open PSF Guard
and Quit. Task files transfer through the server; shared storage is an
option under Files on this computer, and under Shared storage on a
server, whose messages now say "shared folder" rather than "exchange
folder". The guide describes transfer through the server as the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@theatrus theatrus changed the title Run a worker from the desktop app, in the menu bar or the system tray Run a worker from the desktop app Oct 26, 2026
@theatrus
theatrus merged commit 00b75db into main Oct 26, 2026
17 checks passed
@theatrus
theatrus deleted the desktop-worker branch October 26, 2026 04:36
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