Skip to content

fix: recover plugin directory when omarchy strips __sourceDir - #14

Merged
CoderLambert merged 1 commit into
mainfrom
hotfix/omarchy-4.0.4-source-dir-fallback
Sep 17, 2026
Merged

CoderLambert merged 1 commit into
mainfrom
hotfix/omarchy-4.0.4-source-dir-fallback

Conversation

@CoderLambert

Copy link
Copy Markdown
Owner

Problem

After upgrading to omarchy 4.0.4, QOpen opens with "0 resources" even though
~/.config/qopen/config.json is intact and bin/qopen api catalog works
standalone.

Root cause

omarchy 4.0.4 hardened the third-party plugin API and now injects a sanitized
manifest via publicPluginManifest(), which deletes __sourceDir for
third-party plugins:

function publicPluginManifest(manifest) {
    if (!manifest) return null
    if (manifest.__isFirstParty) return manifest
    var copy = JSON.parse(JSON.stringify(manifest))
    delete copy.__sourceDir   // third-party plugins lose their own directory
    ...
}

QOpen derived its backend path from that field:

readonly property string pluginDir: (manifest && manifest.__sourceDir) || ""

so pluginDir became "", backendPath became "",
requestCatalogReload() returned early, and the catalog stayed at its
empty initial value — no error banner, just an empty list.

Fix

pluginDir now falls back to the plugin's own entry point URL, exposed by
the host-injected pluginRegistry API (file:///.../qopen.launcher/QOpen.qml
→ directory). Shells before 4.0.4 keep the existing __sourceDir path, so
behavior is unchanged there.

Verification

  • python -m json.tool manifest.json OK
  • python -m py_compile bin/qopen OK
  • python -m unittest discover -s tests -v — 47 tests OK (incl. new
    source-level regression test for the fallback)
  • omarchy plugin validate . — exit 0
  • qmlcachegen --only-bytecode on all five QML files OK
  • git diff --check clean
  • Runtime acceptance on omarchy 4.0.4 still to be performed manually

🤖 Generated with Claude Code

omarchy 4.0.4 hands third-party plugins a sanitized manifest without
__sourceDir, so pluginDir resolved to "" and the catalog silently loaded
empty ("0 resources", no error). Derive the plugin directory from the
plugin's own entry point URL as a fallback, which also keeps pre-4.0.4
shells on the manifest path.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@CoderLambert
CoderLambert merged commit 1f3d2bc into main Sep 17, 2026
4 checks passed
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