Repository navigation
Conversation
The daemon called launchctl, pmset, caffeinate, osascript, sw_vers and the macOS Installer directly. On any other system those calls failed at run time: `dispatchqd install` stopped the running daemon and then failed at launchctl, and every notification and wake attempt logged an error. newPlatform now supplies these services, with one file per system. platform_darwin.go wires the existing macOS implementations without change. platform_other.go wires none. The daemon skips a missing service, and the dashboard endpoints for a missing dialog, terminal, uninstaller or update service answer "not available". `dispatchqd install` and `uninstall` refuse before they stop anything. The engine keeps its reference-counted sleep guard and gets the inhibitor injected. system.Hold holds `caffeinate -i` on macOS, and a later Linux platform can use it for systemd-inhibit. A hold that fails is now retried by the next run that starts, not only after all runs end. POST /api/update/relaunch now answers 503 without an update service, the same as the other update endpoints. This prepares Linux support and follows the "small interfaces around operating-system operations" direction of docs/windows/PLAN.md (danielmaier42#151). macOS behavior does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linux gets its own platform wiring (platform_linux.go): - `dispatchqd install` writes a systemd user service with Restart=always, KillMode=mixed and TimeoutStopSec=60. On stop, systemd signals only the daemon, which winds down its runs within its 30-second grace, as under launchd. The unit pins DISPATCHQ_HOME, because the user manager does not read the shell profile. The unit folder comes from the manager's own environment. - Runs hold a logind sleep lock through systemd-inhibit (system.Hold). - Desktop notifications go through notify-send (notify.FreeDesktop). - Folder and save dialogs use kdialog on KDE Plasma and zenity elsewhere. They start through `systemd-run --user --wait --pipe`, so they get the session's current display even when the daemon started first at login. - "Continue in terminal" starts xdg-terminal-exec, Konsole, GNOME Terminal or x-terminal-emulator as a transient user unit, so a service restart does not close it. An unread secret environment file is now removed after two minutes on every system. - The data directory is $XDG_DATA_HOME/dispatchq (~/.local/share/dispatchq). - Wake from sleep, self-update and the uninstaller are not offered: they need root or a package that does not exist yet. The API reports the platform in /api/health and names the system in the feedback footer. Without an update service, /api/update says "unavailable". `dispatchq uninstall` explains the manual steps off macOS. The run system prompt no longer names a macOS fallback path, because DISPATCHQ_HOME is always set for a run. scripts/pkgtest tests the macOS installer script and now builds on macOS only. cmd/dispatchqapp/main_other.go gets its missing package comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dashboard reads the daemon's platform from /api/health. On macOS every text stays as it was. Elsewhere it says "this computer" instead of "this Mac", shows "Ctrl+" instead of "⌘", names the file manager and a terminal instead of Finder and Terminal, and leaves out macOS-only rows: System Settings for notifications, and the uninstaller. The New task and Refresh shortcuts are only shown where a native menu handles them. Settings → About shows a link to the releases when the system cannot install updates. The sidebar search label is cut, not wrapped, when "Ctrl+K" makes it longer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new build-test-linux job runs vet, build, race tests and golangci-lint on ubuntu-latest, so Linux-only files are checked too. The macOS job only compiles darwin files. README gets a "Linux (preview)" section and the Linux paths. The plan and the state of the port live in docs/linux/PLAN.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of danielmaier42#159: `dispatchq run-now` builds its own engine and never got a sleep inhibitor. Before the platform layer, the engine started `caffeinate` itself, so a manual run on macOS lost its sleep protection. system.DefaultSleepInhibitor now supplies the platform's sleep hold to both the daemon and the CLI's run-now engine. The code is the same as in danielmaier42#151, so the Windows branch merges onto it without conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review of danielmaier42#159 found that the CLI's run-now engine got no sleep hold. danielmaier42#159 now takes it from system.DefaultSleepInhibitor. On Linux that hold was still set only in the daemon's platform wiring, so a manual run could be suspended. sleep_linux.go now returns the systemd-inhibit hold, and both the daemon and run-now use it. The run-now regression test now also fails on Linux without the fix. The fallback platform's build tag also excludes Windows, as in danielmaier42#151. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
The shared platform layer and Windows implementation have now landed on Could you please rebase this PR onto the latest |
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.
The second of the Linux PRs. It builds on #159: the first commit here is #159, so please review that one first. After #159 is merged, this PR shows only its own three commits. The plan and the state of the port are in
docs/linux/PLAN.md. On macOS nothing changes, apart from one sentence in the run system prompt (see below).What changes
On Linux the daemon, the CLI and the dashboard now work as a real installation. There is no window yet (PR 3) and no package yet (PR 4).
dispatchqd installwrites a systemd user service. It starts at login and restarts a daemon that exits. On stop, systemd signals only the daemon, which winds down its runs within its 30 s grace, as under launchd.systemd-inhibit), the counterpart ofcaffeinate.notify-send. Pushover, ntfy and webhooks work as before.kdialogon KDE Plasma,zenityelsewhere.xdg-terminal-exec), else Konsole, GNOME Terminal orx-terminal-emulator.~/.local/share/dispatchq(XDG).DISPATCHQ_HOMEstill overrides it.The dashboard asks the daemon for its platform. On macOS every text stays as it is. On Linux it says "this computer", shows Ctrl+ shortcuts, and leaves out macOS-only rows.
Changes that also reach macOS
~/Library/Application Support/dispatchqas the fallback data directory. It now says thatDISPATCHQ_HOMEis always set for a run, which the daemon guarantees.build-test-linuxjob.scripts/pkgtest(the macOS installer script test) now builds on macOS only.Verified on a real system
Ubuntu, KDE Plasma (Wayland), systemd 259:
dispatchqd install→ the service is enabled and active.systemd-analyze verifyaccepts the unit. The running daemon hasDISPATCHQ_HOMEfrom the unit.--notifyran for 8 s. During the run logind listedDispatchQ sleep:idle Running a queued task block, and after the run the lock was gone. The failure notification went out on the session bus asNotify("DispatchQ", …, "DispatchQ ✗ Linux e2e failed", …).kill -9of the daemon → systemd started a new one about 5 s later (NRestarts=1).kdialogstarted through the samesystemd-run --user --wait --pipepath opened on the desktop, and its exit status came back.dispatchqd uninstall→ the unit file is gone, the service is not found, the port is free, and the daemon logged a clean stop. The error log stayed empty for the whole test.Checks
go vet,go test ./... -race, golangci-lint v2.12.2main_other.gofinding is fixed)darwin/arm64: build, vet, test compile, golangci-lint v2.12.2/code-review)Open, for discussion
docs/linux/PLAN.mdand gets tested before a release.🤖 Generated with Claude Code