Repository navigation
Conversation
Runtime state writes under a plugin dir (data.json, caches, binaries) were triggering full bar teardowns via the recursive inotify watch. Allowlist manifest/QML/JS paths so helper churn cannot storm-reload the shell. Fixes omacom#12158
|
The new filter also suppresses whole-plugin directory moves. I checked Could directory create/move/delete events remain eligible for rescanning while runtime-file writes stay filtered? A regression test that moves a populated plugin directory into the watched tree would cover this without needing a running desktop. |
quattro rewrote shell/README.md and dropped its hot-reload paragraph, so the conflict resolves to quattro's version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
inotifywait drops every directory event once --include is set, whatever the pattern, so moving a populated plugin directory into or out of ~/.config/omarchy/plugins no longer reloaded anything. Filter in localPluginIdForPath alone and let a top-level plugin directory through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renaming a populated subdirectory such as components/ inside a plugin produces only a directory event, so the filter dropped it and the plugin kept running stale components. Print the event with each path and let moved directories through; created and deleted ones stay filtered, so a plugin making cache directories still cannot reload the shell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
Helper scripts and data files are outside the allowlist too, so editing one now needs a rescan; the docs only mentioned runtime state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed and run on an Omarchy ISO worker with the shell loaded from this branch. The fix works, and I pushed three commits and a merge of What was checked. On the worker I counted What I changed:
Tests on the worker: Second opinion (Codex Medium). It was asked separately to choose between this PR, #12020 and #10705, and chose this one. #12020 and #10705 exclude named paths, so What happens next. This waits on the maintainer. The suite was not fully green on the worker, for the reasons above, so the PR is labelled |
|
| // Hidden entries are not plugins: clone staging dirs, remove backups. | ||
| if (relative.indexOf(".") === 0) return "" | ||
| if (relative.indexOf("/.git/") !== -1 || relative.endsWith("/.git")) return "" | ||
| if (!movedDirectory && !isWatchedPluginPath(relative)) return "" |
There was a problem hiding this comment.
| if (baseName === "manifest.json") return true | ||
| if (baseName.endsWith(".manifest.json")) return true | ||
| if (baseName.endsWith(".qml")) return true | ||
| if (baseName.endsWith(".js")) return true | ||
| return false |
There was a problem hiding this comment.
| root.assertEqual(registry.localPluginIdForPath(cloneBase, true), "dhh.clock", "a plugin directory moved in or out whole is watched") | ||
| root.assertEqual(registry.localPluginIdForPath(cloneBase + "/components", true), "dhh.clock", "a source directory moved within a plugin is watched") | ||
| root.assertEqual(registry.localPluginIdForPath(cloneBase + "/cache", false), "", "a runtime directory created by a plugin is ignored") |
There was a problem hiding this comment.
Watcher parsing remains untested These assertions supply the directory-move flag directly, so they do not test how the watcher parses
%e %w%f output or classifies real file and directory events. A mistake in that path could change reload behavior while these tests still pass; a watcher-level test would cover the new contract.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
quattro added the orphaned-watcher reaper beside the watcher this branch filters; both are kept. The reaper finds watchers by their flags up to the event list, so the new --format still matches it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plugin copied into ~/.config/omarchy/plugins with cp -r, or moved there from another filesystem, arrives as CREATE,ISDIR followed by files the recursive watch can miss, since inotifywait only adds the new directory once it sees it. Filtering on file names dropped the directory event, so on a worker cp -r of a plugin reloaded the shell zero times where quattro reloads four. A directory created at the top level is a new plugin; one created inside a plugin stays ignored, so a plugin making its own cache directory still reloads nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A directory created inside a plugin does not reload the shell, so a plugin making its own runtime directories stays quiet, and a source folder copied in by hand can land before the recursive watch reaches it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
This stopped merging cleanly when The merge. What was checked. Reloads counted from the shell log for each kind of write under
What I changed:
Tests on the worker: Second opinion (Codex Medium). Its first round confirmed the merge composes, and it found the nested-copy race above. Asked to weigh fixing it against documenting it, it recommended documenting it. Its third round, on this head, found nothing open. It can read this session's working, so its agreement is not guaranteed to be independent. Asked separately to choose among this PR, #12020 and the newer #15093, it chose this one: #12020 and #15093 ignore Python bytecode by name, so What happens next. It is labelled |
Summary
manifest.json/*.manifest.json/*.qml/*.jsso runtime state writes (e.g.data.json, caches, binaries) no longer tear down the whole bar.inotifywait --includeand inlocalPluginIdForPathas defense in depth.Fixes #12158
This is intentionally an allowlist rather than extending the denylist approach in related PRs like #12020 / #10705 — those still fire on arbitrary files such as
data.json.Test plan
bash test/shell.d/plugin-registry-contract-test.shinotifywait --include '(manifest\.json$|\.manifest\.json$|\.(qml|js)$)'—data.jsonsuppressed;.qml/manifest.json/.jsstill fireLocal plugin changed, reloading.qml/manifest.jsonand confirm hot-reload still works