Repository navigation
Let a clone stand in for its built-in only while it is installed and enabled - #17588
ThePrimeagen wants to merge 6 commits into
Conversation
[Medium impact] The PR appears safe to merge; no new actionable issue remains. SummaryBuilt-ins now yield to installed, enabled clones without saving replacement state in
|
a5d153e to
72c8ce5
Compare
72c8ce5 to
d7497de
Compare
d7497de to
e854cc0
Compare
|
GPT-6 in Codex reviewed the diff, linked reports #17577 and #9800, existing review comments, and the base branch’s plugin rules. This appears to fix broken clone replacement and restoration, so my classification is The second classification model, |
e854cc0 to
4e3b669
Compare
|
GPT-6 in Codex checked head The required second classifier, |
|
GPT-6 in Codex (driver effort not exposed) checked head In The migration also replaces a symlinked The main bar-reset fix works in my reproduction: clone the menu, run After installing the worker's missing Node.js dependency, all ten plugin-related test files and the CLI suite pass. The migration also passes installed, deleted, malformed-manifest and absent-config checks, including a second run, while preserving an unrelated disabled plugin. The aggregate shell suite still fails five of 421 files, with skipped checks in six files. No fix was pushed because the aggregate suite is not green. Waiting on the maintainer for the migration defects and verification blockers to be addressed. #15482 changes the same clone-restoration paths with a different saved-state design and needs coordination with this change. The worker has been destroyed. |
|
I compared this with #15482 in a disposable VM. With two clones of the same panel, enabling the second retired the first. When the active clone’s manifest disappeared, the built-in came back without an explicit disable. That matches #9800’s one-clone expectation. I tested a panel, not the lock screen. The registry contract test passed at |
Bring in the current plugin scan framing and first-party directory checks before updating the clone registry fixture.
The registry fixture rescans when a clone's manifest disappears. Keep its first-party root set until both test scans finish so the real scanner continues to accept the built-in manifests. Co-Authored-By: GPT-6.2 Sol High (Codex) <noreply@openai.com>
Recover a missing clone's built-in using the full current account prefix, matching the prefix used when the clone was created. Resolve the shell config before replacing it so a managed symlink stays in place. Stage the repaired JSON beside its target and retain the target's permissions. Co-Authored-By: GPT-6.2 Sol High (Codex) <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com> Co-Authored-By: muse-wonder via pi, thinking high <noreply@openrouter.ai>
The manual now explains why a built-in can be inactive without an entry in disabledPlugins. Co-Authored-By: GPT-6.2 Sol High (Codex) <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
Leave an empty shell configuration alone, and fail on malformed JSON so the runner can retry after repair. Recover missing clones by matching their suffix against disabled built-ins, and retain the record when the source is ambiguous or cannot be matched. Co-Authored-By: GPT-6.2 Sol High (Codex) <noreply@openai.com> Co-Authored-By: muse-wonder via pi, thinking high <noreply@openrouter.ai> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
|
GPT-6.2 Sol High in Codex reproduced the fixture failure with the scanner from #19961 and pushed the fixture correction, migration repairs, and a manual update at On a disposable Omarchy worker, a bar reset after cloning the menu left the built-in missing on The CLI, focused plugin checks, and all GitHub checks passed. The audio panel, OEM console logo, and kept service IPC assertions failed in the full worker suite and reproduced on |




What changes
Fixes #17577. Fixes #9800. When a clone of a built-in plugin goes away in any way but
omarchy plugin disable, the built-in can stay switched off for good: no menu button and no Super+Space menu, or no emoji picker. And when two clones of one built-in are on, turning one off brings the built-in back beside the other: two clocks, two menu buttons, or two emoji pickers.shell.json, as an entry indisabledPluginsand one incloneSourceRestores, and onlyrestoreCloneSource(inshell/services/PluginRegistry.qml, run by a disable) takes it out again. Dragging the clone off the bar,omarchy bar defaults,omarchy plugin removeof a clone that is off the bar, deleting the clone's folder and a manifest that stops parsing all skip it. The record is also kept per clone, so a second clone of the same built-in is never accounted for.isEnabledworks it out when it is asked: a first-party built-in is off while an installed, enabled clone of it (one that is more than a bar widget) exists. However the clone goes, the built-in comes back, because nothing is left to undo. One clone stands in for a built-in at a time: enabling a clone retires the others and takes their place on the bar, and enabling the built-in retires all of them. Disabling the clone in use brings back the built-in, not a clone retired earlier. Every bar slot a retired clone held, with its settings, goes back to the built-in, or to the clone enabled in its place.cloneSourceRestoresfromshell.jsonand drops thedisabledPluginsentries it accounted for, so a built-in switched off only because of a clone comes back. A built-in the user switched off themselves stays off. It reads each listed clone'sclonedFrom; a clone that is gone or whose manifest no longer parses is matched by its name,<user>.<built-in name>, asomarchy plugin clonenames it.A second clone of the same built-in
omarchy plugin clone omarchy.menu, then a copy of it,alice.menu, added withomarchy plugin add /tmp/alice.menu --enable --yes.quattro: both are drawn. Printed:{"drawn":["prime.menu","alice.menu"]}alice.menutakesprime.menu's place. Printed:{"drawn":["alice.menu"]}omarchy plugin disable prime.menuquattro:restoreCloneSourceputs the built-in back inprime.menu's place, besidealice.menu. Printed:{"drawn":["alice.menu","omarchy.menu"]}alice.menustays alone. Printed:{"drawn":["alice.menu"]}The clock behaves the same: on
quattro, addingalice.clockdraws{"drawn":["prime.clock","alice.clock"]}; with this changealice.clockreplacesprime.clock, and disabling it leaves{"drawn":["omarchy.clock"]}.Two clones of the emoji picker (overlays, panels, services)
omarchy plugin clone omarchy.emojis, then a copy,alice.emojis, added and enabled.quattro: both copies load. Printed:{"enabled":["alice.emojis","prime.emojis"]}alice.emojisreplacesprime.emojis. Printed:{"enabled":["alice.emojis"]}omarchy plugin disable prime.emojisquattro:restoreCloneSourcetakesomarchy.emojisout ofdisabledPluginswhilealice.emojisis still on. Printed:{"enabled":["omarchy.emojis","alice.emojis"]}{"enabled":["alice.emojis"]}For
omarchy.lock, two clones at once are the crash loop in #9800.Switching back to the built-in while two clones are on
omarchy plugin enable omarchy.emojis.quattro:activeCloneForreturns one clone, and only that one is retired. Printed:{"enabled":["omarchy.emojis","prime.emojis"]}{"enabled":["omarchy.emojis"]}A clone on the bar twice
omarchy plugin clone omarchy.indicators, a secondprime.indicatorsadded to the bar's right side, thenomarchy plugin disable prime.indicators.restoreCloneSourceput the built-in back in the clone's first slot only, and the second slot kept the disabled clone. Printed:"bar":["omarchy.indicators","prime.indicators"]"bar":["omarchy.indicators","omarchy.indicators"]Enabling a clone in another clone's place
omarchy plugin clone omarchy.clock, thenalice.clockadded and enabled,prime.clockput back on the bar beside it, thenomarchy plugin enable alice.clock --before prime.clock.prime.clockturned its slot back into the built-in, so the move found noprime.clockand was skipped. Printed:Enabled and moved alice.clockand{"drawn":["alice.clock","omarchy.clock"]}; two clocks.alice.clockleaves its own slot and takesprime.clock's. Printed:{"drawn":["alice.clock"]}Switching back to the built-in clock with two clones on the bar
omarchy plugin clone omarchy.clock, thenalice.clockadded and enabled, thenprime.clockput back at the right end of the bar, thenomarchy plugin enable omarchy.clock.{"drawn":["omarchy.clock"]}{"drawn":["omarchy.clock","omarchy.clock"]}A clone enabled in place of one that is on the bar twice
omarchy plugin clone omarchy.indicators, a secondprime.indicatorsadded to the bar's right side, then a copy,alice.indicators, added and enabled.alice.indicatorstook only the first of the two slots, and the built-in came back in the other. Printed:"bar":["alice.indicators","omarchy.indicators"]alice.indicatorstakes both. Printed:"bar":["alice.indicators","alice.indicators"]A menu clone taken off the bar
Dragging a widget off the bar (
commitBarRemovalinshell/plugins/bar/Bar.qml) drops itsbar.layoutentry and nothing else.omarchy plugin clone omarchy.menu, thenprime.menutaken off the bar.quattro:omarchy.menuis still indisabledPlugins, so there is no menu at all, and Super+Space opens nothing. Printed:{"bar":[],"plugins":[],"disabledPlugins":["omarchy.menu"],"cloneSourceRestores":["prime.menu"]}{"bar":[],"plugins":[],"disabledPlugins":null,"cloneSourceRestores":null}omarchy bar defaultscmd_defaultsinbin/omarchy-barreplaces.baronly.omarchy plugin clone omarchy.menu, thenomarchy bar defaults.quattro: the bar listsomarchy.menu, but it is still switched off, so no menu button is drawn and Super+Space opens nothing. Printed:{"drawn":[]}and{"bar":["omarchy.menu"],"plugins":[],"disabledPlugins":["omarchy.menu"],"cloneSourceRestores":["prime.menu"]}{"drawn":["omarchy.menu"]}, and Super+Space opens the menu.omarchy plugin removeof a clone that is off the barbin/omarchy-plugin-removedisables a widget only when it is on the bar, so a menu clone taken off the bar is deleted without the disable.omarchy plugin clone omarchy.menu,prime.menutaken off the bar, thenomarchy plugin remove prime.menu --yes.quattro:Removed prime.menu.,omarchy.menustays indisabledPlugins, and Super+Space opens nothing."disabledPlugins":nullA clone deleted by hand, or whose manifest stops parsing
parseScanOutputdrops the clone from the installed plugins and settles nothing.omarchy plugin clone omarchy.menu, thenrm -rf ~/.config/omarchy/plugins/prime.menu && omarchy-shell shell rescanPlugins.quattro:"disabledPlugins":["omarchy.menu"], and Super+Space opens nothing.omarchy plugin clone omarchy.emojis, thenecho '{' > ~/.config/omarchy/plugins/prime.emojis/manifest.json && omarchy-shell shell rescanPlugins.quattro:{"enabled":[]}, and Super+Ctrl+E opens nothing.{"enabled":["omarchy.emojis"]}, and Super+Ctrl+E opens the emoji picker.The migration, for a clone that is gone or no longer parses
shell.jsonhere holds what the shell wrote before this change:"disabledPlugins":["omarchy.menu"]and"cloneSourceRestores":["prime.menu"], with the clone's folder deleted, orprime.emojis's manifest broken, before the upgrade.bash -euo pipefail /usr/share/omarchy/migrations/1793808884.sh, the wayomarchy-migrateruns it, with theprime.menufolder gone.manifest.json, which is gone, so it droppedcloneSourceRestoresbut keptomarchy.menuswitched off. Printed:exit=0and"disabledPlugins":["omarchy.menu"],"cloneSourceRestores":null; no menu button, and Super+Space opens nothing.exit=0,{"drawn":["omarchy.menu"]}and"disabledPlugins":null,"cloneSourceRestores":null; Super+Space opens the menu.echo '{' > ~/.config/omarchy/plugins/prime.emojis/manifest.json.jqfailed on the manifest and, underset -e, stopped the migration. Printed:jq: parse error: Unfinished JSON term at EOF at line 2, column 0,exit=5,{"enabled":[]}; Super+Ctrl+E opens nothing.exit=0and{"enabled":["omarchy.emojis"]}; Super+Ctrl+E opens the emoji picker.Verification
test/shell.d/plugin-registry-contract-test.sh: one new check, "a clone stands in for its built-in only while it is installed and enabled, and one clone stands in at a time". It covers a clone taken off the bar, a clone whose manifest is gone, second clones of a panel, a bar widget and a menu-and-widget, the last clone going, and enabling the built-in. It fails on quattro84b3f2872with every case on its old value (for exampledraggedOff: [false, …]andmanifestGone: false), and passes with this change. The plugin-clone, plugin-enable, plugin-manifest-scan, plugins, plugin-watcher-reap, runtime-smoke, manifest-entrypoints and config tests pass, andqmllintis clean.--beforeanother clone; the built-in enabled while two clones hold two slots with their own settings; and a clone enabled in place of one on the bar twice. It fails on72c8ce546with[omarchy.first-widget, local.first-widget]and[omarchy.first-widget, omarchy.weather, shared.first-widget]for the first two. It fails ond7497de8dwith[omarchy.weather, {omarchy.first-widget, size: 3}]and[{shared.first-widget, size: 2}, {omarchy.first-widget, size: 3}]for the last two. It passes with this change.bash -euo pipefail: a clone still installed beside a built-in the user switched off, a clone's folder deleted, a manifest that no longer parses, a shared clone whose id does not follow the built-in's name, and no clone records. Each exits 0, dropscloneSourceRestoresand only thedisabledPluginsentries a clone accounted for, keepsomarchy.osdthe user switched off, and changes nothing on the second run. This PR's previous version keptomarchy.menuoff for the deleted clone and exited 5 on the broken manifest.a5d153e92, and on one built from this change, with the records written intoshell.jsonfirst. The cases of a clone on the bar twice and of a clone enabled in another's place were run the same way, on an ISO built from this PR's version72c8ce546and on one built from this change. So were the cases of switching back with two clones on the bar and of a clone enabled in place of one on the bar twice, on an ISO built fromd7497de8d.84b3f2872, then run again with the same tests on an ISO built from84b3f2872plus this change: each case's commands above, in a terminal, then Super+Space or Super+Ctrl+E. After every command the test printed what is drawn on the bar, whatomarchy plugin listreports enabled, and the bar entries,plugins,disabledPluginsandcloneSourceRestoresread fromshell.json; the printed lines above are read from those screenshots.shell.jsoninstead, so that every way out has to undo it. Searched every writer ofdisabledPlugins,cloneSourceRestores,plugins[]andbar.layoutundershell/andbin/, and every reader ofomarchy.clonedFrom. Fixed here: the two stored records inPluginRegistry.qml, and the one-clone assumption insetEnabledwhen the built-in or a second clone is enabled. Not affected now: drag off,omarchy bar defaults,omarchy plugin remove,omarchy bar putof a built-in whose clone is off the bar, rescans dropping a manifest, an update that changesclonedFrom, a clonedomarchy.barand clones ofomarchy.media, since with nothing stored none of them has anything left to settle.resolveEnabledId,listPluginsandomarchy-menu-pluginalready work it out when read.plugin remove's message (omarchy plugin removeprints "Restored <source>." when the source stays disabled #13507).bar.layoutorplugins[]entry stays inshell.jsonand draws nothing, so a menu button deleted by hand is not put back on the bar, though Super+Space works. Ashell.jsonthat already has two clones of one built-in on the bar keeps both until one of them or the built-in is enabled, which then takes every slot they held.omarchy plugin clonecan time out, printomarchy-shell is not respondingand delete the folder of a clone the shell already switched to (omarchy plugin clone omarchy.menutimes out and leaves shell.json pointing at a deleted plugin #16514). The built-in lock starting for a moment beforeshell.jsonis read (Cloned omarchy.lock: built-in lock still loads at shell startup, two session locks race and Quickshell crashes #14930), and trustingclonedFromfrom the manifest (PluginRegistry: verify clone provenance instead of trusting omarchy.clonedFrom #14966). The migration matches a clone that is gone or no longer parses by its name, so one renamed away from<user>.<built-in name>and then deleted before the upgrade leaves its built-in switched off;omarchy plugin enablebrings it back.shell.jsonthe way the drag does. Two clones ofomarchy.lock(Enabling a second clone of the same plugin leaves both active; two omarchy.lock clones crash-loop the shell until it gives up #9800's crash) were not run; the emoji picker shows the same path.Screenshots
A second clone of the same built-in
prime.menudisabledTwo clones of the emoji picker
prime.emojisdisabledSwitching back to the built-in while two clones are on
omarchy.emojisenabledA clone on the bar twice
prime.indicatorsdisabledEnabling a clone in another clone's place
alice.clockenabled beforeprime.clockSwitching back to the built-in clock with two clones on the bar
omarchy.clockenabledA clone enabled in place of one that is on the bar twice
alice.indicatorsaddedA menu clone taken off the bar
omarchy bar defaultsomarchy plugin removeof a clone that is off the barA clone deleted by hand, or whose manifest stops parsing
The migration, for a clone that is gone or no longer parses