omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Regression (4.0.2→4.0.3): publicPluginManifest() strips __sourceDir, breaking third-party plugins that locate their own files

Open redglover opened this issue 2 months ago • 5 comments

What happened

Upgrading from Omarchy 4.0.2 to 4.0.3 broke the third-party Omarchy Spotify plugin (quickshell.spotify). Every helper script the plugin spawns now runs with a broken path, e.g.:

omarchy-shell[1314]: WARN: Process failed to start, likely because the binary
could not be found. Command: QList("/scripts/keyring-store.sh", "d420a117…")

The path should have been /home/<user>/.config/omarchy/plugins/quickshell.spotify/scripts/keyring-store.sh. The /…plugins/quickshell.spotify prefix is gone — the plugin resolved it from manifest.__sourceDir, which is now empty.

User-visible effects for that plugin: fresh login broken (pkce.sh), OAuth refresh-token persistence broken (keyring-store.sh — silently drops the rotated token, so the session dies on next restart), local playback broken (configure-spotifyd.sh, playback-runtime.sh), and Spotify Connect device control broken (spotify-connect-device.py).

Root cause

4.0.3 added publicPluginManifest() in /usr/share/omarchy/shell/shell.qml and routed the plugin-facing manifest through it:

// shell.qml (4.0.3-1), lines 316-324
function publicPluginManifest(manifest) {
  if (!manifest) return null
  if (manifest.__isFirstParty) return manifest
  var copy = JSON.parse(JSON.stringify(manifest))
  delete copy.__sourceDir          // <-- line 320
  delete copy.__isFirstParty
  delete copy.__hostCapabilities
  return copy
}

It is now applied at every point where a third-party plugin receives its manifest — services (line 930), scoped registry API (754), bar config (222), panels (1343), rescans (977, 983), etc.

In 4.0.2 the raw manifest, including __sourceDir, was handed straight to the plugin:

// shell.qml (4.0.2-1), line 307
if ("manifest" in inst) inst.manifest = manifest

So under 4.0.2 a third-party plugin could read manifest.__sourceDir to find its own directory (needed to exec bundled scripts, read bundled assets, etc.). Under 4.0.3 there is no supported way for a non-first-party plugin to learn its own install path:

  • manifest.__sourceDir — deleted by publicPluginManifest()
  • pluginRegistry.installedPlugins[id] (via PluginRegistryApi.qml) — returns the same sanitized manifest
  • entryPointUrl() — only resolves declared entry points, and PluginRegistryApi.entryPointUrl() requires passing back a manifest whose id matches, but gives no directory

Note shell.qml:1410 still stamps the real __sourceDir into the bar widget metadata (meta.sourceDir), so the information is available to the host — it is just withheld from the plugin's service/panel components, which is where scripts actually get spawned.

Expected

A plugin should have a supported, documented way to resolve its own install directory. Options:

  1. Keep exposing __sourceDir (or a renamed sourceDir) on the plugin-facing manifest — it is not sensitive; it is always ~/.config/omarchy/plugins/<id> (or the first-party dir), which the plugin can already guess.
  2. Or add it to the shell API handed to plugins (e.g. shell.pluginDir / shell.sourceDir), the way meta.sourceDir is already passed to widgets.
  3. Or document Qt.resolvedUrl(".") from a component file as the blessed approach and note the manifest no longer carries a path.

If the removal was a deliberate security boundary, a note in the 4.0.3 migration/changelog plus a plugin-API doc update would have caught this before release. Third-party plugins other than Omarchy Spotify that bundle scripts or assets are likely affected too.

Related: #10661 is the same class of bug — third-party plugin manifests being mangled before the plugin sees them (there, array types lost through the panel Instantiator).

Steps to reproduce

  1. On Omarchy 4.0.2, install a third-party plugin that reads manifest.__sourceDir (e.g. omarchy plugin add https://github.com/stappmus/Omarchy-Spotify.git --enable) and confirm it works.
  2. omarchy update to 4.0.3, omarchy restart shell.
  3. Open the plugin. Its bundled scripts fail with "binary could not be found" and paths like /scripts/foo.sh.

Workaround (plugin side)

Patch the plugin to fall back to Qt.resolvedUrl(".") when __sourceDir is absent. Filed separately against the plugin: https://github.com/stappmus/Omarchy-Spotify/issues/69

System details

  • Omarchy: 4.0.2-1 → 4.0.3-1 (regression introduced by the upgrade)
  • Kernel: 6.x (Arch), x86_64
  • CPU: Intel Core i7-9750H
  • GPU: Intel UHD 630 + NVIDIA GTX 1660 Ti Mobile
  • quickshell 0.3.1-1, hyprland 0.56.2-2
  • Plugin: stappmus/Omarchy-Spotify @ e6c9f9f (manifest version 1.0.4)

redglover avatar Sep 08 '26 20:09 redglover

Confirming this hits a second, unrelated third-party plugin: Omamail (huacnlee/omamail, manifest id omamail, third-party, service/bar-widget/panel kinds), on the same 4.0.3-1 install.

Same signature in the journal:

omarchy-shell[…]: WARN: Process failed to start, likely because the binary could not be found. Command: QList("/scripts/config-store.sh", "window.json")
omarchy-shell[…]: WARN: Process failed to start, likely because the binary could not be found. Command: QList("/scripts/pkce.sh")
omarchy-shell[…]: WARN: Process failed to start, likely because the binary could not be found. Command: QList("/scripts/keyring-store.sh", "service", "omamail", "kind", "refresh-token", …)

User-visible effect here was the same failure mode as the Spotify report: pkce.sh (built from manifest.__sourceDir + "/scripts/pkce.sh", i.e. Service.qml's pluginDir) silently fails to spawn, so clicking "Sign in with Google" does nothing — no error surfaces anywhere, because the Process never reaches onExited with the plugin's own failure handling. keyring-store.sh (used to persist a rotated OAuth refresh token) fails the same way, so even a token obtained out-of-band never gets persisted back to the keyring on refresh.

One data point that may help narrow the fix: reads that go straight through secret-tool/plain commands (not through pluginDir-prefixed scripts) still work, since AuthManager.qml's token lookup shells out to bare secret-tool lookup … rather than a bundled script. So the break is specifically "any plugin action that needs its own script/asset path," exactly as described above — confirms this isn't plugin-specific, it's anything reading manifest.__sourceDir from a Service or Panel instance.

Also confirms the workaround note: Omamail's Service.qml does manifest && manifest.__sourceDir ? String(manifest.__sourceDir) : "" with no Qt.resolvedUrl(".") fallback either, so it's fully broken rather than degraded, same as Spotify.

Nebuc117 avatar Sep 09 '26 06:09 Nebuc117

Adding a confirmed existing-account IMAP failure from a separate Omamail installation, plus a tested plugin-side recovery.

Both configured accounts remained on “Checking for mail” for days after an Omarchy dev upgrade. The first recorded missing-helper failure was September 7, 2026 at 11:18:48 CEST, shortly after the package upgrade at 11:12:29 from 4.0.0.r2007.gd3d23fd-1 to 4.0.0.r2066.ge989b5b-1. The problem persisted through 4.0.0.r2090.g5b91db5-1, where it was diagnosed and repaired on September 9.

Evidence

The installed shell/shell.qml removes __sourceDir in publicPluginManifest(). Omamail 0.6.0 uses that field as its sole helper-directory source, so it starts these nonexistent paths:

WARN: Process failed to start, likely because the binary could not be found. Command: QList("/scripts/mail-transport.sh")
WARN: Process failed to start, likely because the binary could not be found. Command: QList("/scripts/config-store.sh", "window.json")

No mail-transfer process remained running. Quickshell's missing-executable path does not emit Process.exited, which also strands Omamail's completion callbacks and loading flags. The apparent multi-day network check is therefore a failed launch plus uncleared application state.

Tested recovery

In Omamail's Service.qml, replacing the private-manifest dependency with the following restored its helper paths:

readonly property string pluginDir: decodeURIComponent(
  Qt.resolvedUrl(".").toString().replace(/^file:\/\//, "")).replace(/\/$/, "")

Launching its POSIX mail helper as ["sh", root.transport] also makes a missing helper return a normal process error so the loading state can clear.

The plugin's make validate passed, including 91 QML tests. An isolated real-Quickshell harness confirmed path resolution without private manifest fields, missing-helper error completion, loading-state cleanup, and retry. After omarchy restart shell, both accounts fetched fresh inbox results and the UI displayed “Synced just now”. Account settings were unchanged.

Automatic plugin reload and an explicit omarchy-shell shell rescanPlugins still executed the old /scripts/mail-transport.sh command until the shell restart. This is an additional observation consistent with #9772, rather than evidence that the plugin-side path fix failed.

Please include a documented migration path for plugins that previously relied on this manifest field, and a compatibility regression check around third-party service helper resolution. Resolving relative to the component works without exposing internal manifest fields again.

Plugin-side report with the concrete fix and validation details: https://github.com/huacnlee/omamail/issues/163.

System details

  • Omarchy dev 4.0.0.r2090.g5b91db5-1 at diagnosis.
  • Omamail 0.6.0, commit f69df2dfc8fb15810f8b9edd163d8b6599869738.
  • Quickshell 0.3.1-1; Qt declarative 6.11.2-1; Qt base 6.11.2-3; curl 8.22.0-1.
  • Arch Linux; kernel 7.2.4-arch1-2; Intel Core i5-6400T; Intel HD Graphics 530.
  • omarchy debug --no-sudo --print returned “Unknown Omarchy command” on this installed build; relevant journal and package-version excerpts are included above.

kaalabs avatar Sep 09 '26 11:09 kaalabs

Confirming this regression on a fresh 4.0.2 → 4.0.3 update today. Another affected third-party plugin: huacnlee/omamail — every scripts/ helper it shells out to (mail transport, attachments, config-store writes, mailto registration, OAuth/PKCE sign-in) depends on manifest.__sourceDir from Service.qml, so all of it silently stopped starting. Tracked plugin-side at huacnlee/omamail#163.

None of that touches authentication services on the host side — it's a plugin resolving the path to its own bundled scripts, which publicPluginManifest() now strips indiscriminately for every third-party plugin rather than only where an authentication capability is actually in play. Worked around it locally by having the plugin self-locate its own directory via Qt.resolvedUrl(".") instead of trusting the manifest field, but that's a per-plugin patch — plugins that don't ship a fix (or haven't merged one yet, as with the three open PRs on omamail#163) stay broken until this is scoped more precisely upstream.

jacobtminson avatar Sep 09 '26 17:09 jacobtminson

This same 4.0.3 change breaks a second thing that isn't mentioned above: shell.shellConfig is also gone from what third-party plugins receive.

Since 4.0.3, ensureService/configureBar inject a capability-scoped PluginShellApi as shell instead of the real shell object (shell.qml, pluginShellFor()/createScopedPluginShell()). That proxy (services/PluginShellApi.qml) only exposes barConfig (the bar section of shell.json, kept live via syncPluginApis()) — there's no shellConfig property at all. Any plugin that read shell.shellConfig to look up its own saved settings (the pattern used for bar-widget config: search shellConfig.bar.layout.{left,center,right} for the entry matching your plugin id) now silently gets undefined, so every setting falls back to its default. Combined with the __sourceDir issue, our MPD client plugin (matjam/omajam (https://github.com/matjam/omajam)) went from "reads its saved host/port and connects" to "always connects to 127.0.0.1 regardless of what's configured" — no error anywhere, since the settings lookup just returns {}.

We worked around it by wrapping barConfig back into a {bar: ...} shape ({ bar: shell.barConfig }) before doing the same lookup, since barConfig already carries layout live. But it'd be worth an explicit, documented API for this — something like shell.settingsFor(pluginId) — rather than every third-party plugin having to reverse-engineer which proxy property replaced which internal one after each sandboxing pass. Same ask applies to __sourceDir: a stable manifest.sourceDir (or a helper) would remove the need for the Qt.resolvedUrl(".") workaround plugins are independently converging on.

(Omarchy 4.0.3, reproduced on Arch, quickshell shell.qml as shipped in the omarchy 4.0.3-1 package.)

jabular avatar Sep 12 '26 13:09 jabular

Fixed by #11925, now merged into quattro. Third-party plugin manifests retain their own __sourceDir, so bundled script paths resolve again; __isFirstParty and __hostCapabilities remain withheld. GitHub already closed the original directory-resolution report as completed. The later shell.shellConfig/settings-API and hot-reload observations are separate and are not claimed fixed here. This records the landed fix rather than another pending workaround.

Closure scope checked by GPT-6 in Codex and Codex Medium against the reports and landed source. The second opinion agreed; independence is not guaranteed. No runtime tests were rerun for this reconciliation.

omarchybot avatar Oct 04 '26 14:10 omarchybot