Skip to content

setPluginEnabled answers ok for an unknown plugin id, so omarchy plugin disable <typo> reports success and does nothing #11119

Open

Description

@Mario-Mohar

What happened

omarchy plugin disable reports success for a plugin id that does not exist:

$ omarchy plugin disable does.not.exist; echo "exit=$?"
Disabled does.not.exist
exit=0

Nothing happens. A typo in the id is indistinguishable from a real disable, so the plugin the user meant to switch off keeps running while the command says it was switched off.

The IPC call underneath answers ok, and shell.json is untouched:

$ md5sum ~/.config/omarchy/shell.json
cf10e466fd4e1c2e617b6f423b8be9fa  /home/.../shell.json
$ omarchy-shell shell setPluginEnabled totally.made.up false
ok
$ md5sum ~/.config/omarchy/shell.json
cf10e466fd4e1c2e617b6f423b8be9fa  /home/.../shell.json

The enable side of the same registry call gets this right:

$ omarchy-shell shell enablePlugin totally.made.up '{}'
unknown

Where it comes from

Both IPC handlers go through PluginRegistry.setEnabled (shell/shell.qml:1609 and :1613), and the guard there only covers one direction (shell/services/PluginRegistry.qml:482):

var manifest = installedPlugins[key]
if (value && !manifest) {
  console.warn("PluginRegistry.setEnabled: unknown plugin " + key)
  return false
}

With value false the guard is skipped, the disable path finds no clonedFrom, no bar layout entry and no plugins[] entry, so it changes nothing, and the function still ends on:

if (lastEnableError) return false
registryRevision++
pluginsChanged()
return true

true becomes ok in setPluginEnabled, and omarchy-plugin-disable prints Disabled $id on anything that is not a non-ok answer. There is no console.warn on this path either, so nothing is left in the log.

The guard's asymmetry looks deliberate

I am guessing here, but refusing an unknown id on the disable side would be wrong: a plugin whose directory was deleted has no manifest while its shell.json entry is still there, and that entry has to stay removable. So the fix is probably not to widen the guard to !manifest, but to make the return value say whether anything was actually found. Disabling an id with neither a manifest nor a config entry is the case that should answer unknown, and that keeps the ghost-entry cleanup working.

Nothing in test/shell.d/ currently covers setEnabled with an unknown id in either direction, so there is no existing expectation to weigh this against.

A smaller side effect

The same path runs registryRevision++ and pluginsChanged() before returning, so a call that changed nothing still signals every consumer that the plugin set moved.

Reproduce

omarchy plugin disable some.id.that.does.not.exist   # prints "Disabled ...", exits 0
omarchy-shell shell setPluginEnabled some.id.that.does.not.exist false   # ok
omarchy-shell shell enablePlugin some.id.that.does.not.exist '{}'        # unknown

Environment

Activity

  1. omarchybot commented on Oct 11, 2026

    @omarchybot
    Collaborator

    Checked against quattro (be7c7bf). The diagnosis is right: PluginRegistry.setEnabled only refuses an unknown id when enabling (shell/services/PluginRegistry.qml:482). Disabling an id with no manifest and no entry in shell.json changes nothing, still fires pluginsChanged(), and returns true (:563-:566), which setPluginEnabled turns into ok and omarchy-plugin-disable into Disabled <id>, exit 0.

    Reproduced on a fresh Omarchy worker VM with a new case in test/shell.d/plugin-registry-contract-test.sh: on quattro, disabling does.not.exist returns true and signals a change. A fix is drafted. It refuses a manifest-less id unless bar.layout or plugins[] still names it, so the leftover entry of a deleted plugin can still be removed, as you pointed out. The same contract test passes with it, ./test/cli passes, and the shell suite shows only the 8 failures it already has on quattro on that worker. Nothing in bin/, migrations/ or shell/ disables an absent plugin and relies on success.

    Checked by Claude Opus 5.5 only. The second opinion (Codex Medium) did not run: its daily review limit was spent. A fix is not filed as a pull request without that review, so this waits on the maintainer, or on a run once the reviewer is available again.

  2. jandrusk commented on Oct 13, 2026

    @jandrusk

    Confirmed on quattro: PluginRegistry.setEnabled only rejects unknown ids when enabling.

    #11134 implements the disable-side rejection (plus clone-source restore). Suggest linking/closing this once that merges.

  3. omarchybot commented on Oct 14, 2026

    @omarchybot
    Collaborator

    #11134 by @sanjyay fixes this and already carries Fixes #11119, so this issue closes when it merges. It was opened before the fix drafted here, so that draft will not be filed as a competing pull request.

    Read at its head (069f6b3) against quattro: setEnabled now refuses a manifest-less id unless bar.id, bar.layout or plugins[] still names it (shell/services/PluginRegistry.qml:546), so omarchy plugin disable does.not.exist gets unknown, exits 1, and no longer fires pluginsChanged(). A deleted plugin's leftover entry is still removable, which keeps the case you raised working.

    One gap remains, found by the second opinion and confirmed in the source: installedPlugins is a plain {}, so an id that names an inherited object property, such as toString, looks installed, skips the guard, and still answers ok. That is narrow, and it belongs on #11134 rather than here.

    Checked by Claude Opus 5.5 and Codex Medium, by reading the pull request; the bug itself was reproduced on a worker in the earlier comment. #11134 currently conflicts with quattro and is reviewed as its own item. This waits on the maintainer and on that pull request.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions