Repository navigation
Conversation
319efd8 to
2ca9f1d
Compare
There was a problem hiding this comment.
Pull request overview
Fixes local plugin hot reloads for symlinked development directories and stale imported JavaScript.
Changes:
- Watches external symlink targets and rebuilds watches after plugin-root changes.
- Uses soft Quickshell reloads for fresh QML engines.
- Adds watcher and runtime regression tests.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
shell/scripts/watch-local-plugins |
Watches plugin trees and external symlink targets. |
shell/services/PluginRegistry.qml |
Integrates and rebuilds the watcher. |
shell/shell.qml |
Replaces manual plugin unloading with soft reloads. |
test/shell.d/local-plugin-watcher-test.sh |
Tests symlink target and replacement events. |
test/shell.d/runtime-smoke-test.sh |
Covers linked plugins and JavaScript reloading. |
test/shell.d/fixtures/plugin-registry/shell.qml |
Tests plugin-root change classification. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
shell/shell.qml:717
- This changes the reload lifecycle for the entire shell, but the listed tests only verify that IPC and plugin data recover; they do not verify the stated window-preservation behavior.
AGENTS.md:120requires running-UI visual verification for changes with visual effects. Please verify and document that an open bar/panel remains correctly mapped without flicker, stale state, or focus regressions across a plugin rescan.
Quickshell.reload(false)
|
I reran the full smoke test on a two-monitor session and tracked the apparent The warning count is cumulative across engine generations: In Quickshell 0.3.1 the IPC registry is scoped to an The existing assertion only allows generations=$(grep -c "Configuration Loaded" "$log" || true)
(( generations > 0 )) || generations=1
allowed_collisions=$((generations * (screens - 1)))Then compare Results on Omarchy 4.0.1, Quickshell 0.3.1, Hyprland 0.56.2, two monitors: One minor caveat remains: IPC calls can briefly return I can provide the two small commits if useful. |
|
|
Compatibility warning for the current Quickshell package: This PR changes Quickshell 0.3.1-1 has a confirmed use-after-free at exactly this lifecycle boundary: quickshell#956. We symbolized two crashes on Omarchy 4.0.1-1 / Quickshell 0.3.1-1 / Qt 6.11.2: In both cores, Quickshell master now contains an apparent direct fix: This does not mean the watcher/cache design in this PR is wrong, but merging this against unpatched 0.3.1 would exercise the vulnerable generation-teardown boundary on every plugin change, increasing exposure to the timing-dependent use-after-free. Could the PR either wait until Omarchy consumes a Quickshell build containing A useful regression test would start a Process-driven |
|
Adding the two data points I have from the same lifecycle boundary, since my On Omarchy 4.0.1-1 / Quickshell 0.3.1-1 / Hyprland 0.56.2, two monitors, the My two commits on this PR are test-only accounting plus the stray property, so I have not tried to reproduce quickshell#956 directly and I take no position on |
|
Thanks for the follow-up. I think we’re mostly agreeing, but I want to make the distinction clear. Your test shows that eight reloads can complete successfully. I believe that result. The problem is that this is a timing-dependent crash, so eight successful reloads do not tell us whether the teardown is safe—they only tell us those eight reloads missed the bad timing window. I went back and tested that window directly. I built QuickShell 0.3.1 twice from the same source:
Using this PR’s actual plugin watcher and real plugin-file edits, the unpatched build crashed in five out of six runs. Most crashes happened after only one to four edits. The build with the QuickShell fix completed 100 consecutive edits without crashing. I also tested the reload operation by itself with randomized timing. The unpatched build crashed in 27 of 30 runs. The fixed build survived all 30 runs and loaded 909 generations. Interestingly, when I used an exact 150 ms interval every time, the unpatched build survived 400 generations. That likely explains why your eight-generation smoke test passed: repeating at a fixed interval can consistently miss a timing-sensitive race. So I am not saying every plugin edit will crash the shell. I am saying every successful plugin edit now triggers a full QuickShell generation teardown, and on the currently packaged QuickShell 0.3.1-1, that teardown contains the use-after-free described in quickshell#956. Each edit gives the race another opportunity to happen. This PR did not create the QuickShell bug. It just makes that buggy teardown path part of the normal plugin-edit workflow. My recommendation is therefore straightforward: merge or release this only after Omarchy’s QuickShell package includes TLDR: The upstream QuickShell fix does not replace this PR—it makes the soft-reload behavior added by this PR safe to use. My only concern is release ordering: Omarchy should consume |
|
Here they are: catlee#1 (the test accounting and the stray property, on top of |
|
Adding a third option that I don't think has come up yet, since the teardown-safety Keep the in-place reload, and give The stale-code symptom follows from - var comp = Qt.createComponent(url, Component.Asynchronous)
+ var reloadUrl = url + (url.indexOf("?") === -1 ? "?" : "&") + "omarchyReload=" + Date.now()
+ var comp = Qt.createComponent(reloadUrl, Component.Asynchronous)The reason this might be worth a look here: it does not destroy an What I verifiedOmarchy 4.0.1-1, quickshell 0.3.1-1, qt6-declarative 6.11.2-1, Arch, kernel 7.1.9, With a throwaway bar-widget plugin logging a Unpatched, the same edit re-instantiates the widget and re-runs the old marker. I also instrumented A third-party plugin using a relative Limits, stated plainly
Not suggesting this should replace the approach here — posting it as a data point in Measurements run by an AI agent on my machine; I reviewed the results and the |
f2b1fb5 to
2a6f31c
Compare
|
Reviewed at 2a6f31c, with tests run on a disposable worker VM built from the Omarchy ISO, the shell served from the tree under test. On its own base the branch does what it says: It conflicts with The concern raised above about quickshell-mirror/quickshell#956 still stands: the issue is open, Arch still ships Related: #7259 fixes Only one model reviewed this. The configured second opinion, Codex Medium, answered a ping but did not run, because today's review budget was spent. Next step is yours: bring the branch up to date with |
|
Tested this with a symlinked plugin checkout, coming from #14387 (closed as a duplicate of #6981). It fixes both problems for me. Setup: Omarchy 4.0.4, quickshell 0.3.1, Qt 6.11.2. The plugin is a bar widget whose directory in How I ran it: I applied the three Results
On stock 4.0.4 none of these edits appear until Not covered: a rebase onto current |
|
I rebased this onto current The rebase itself is small, but it runs into a contract that landed on Conflicts (all in
The other six commits applied cleanly. Tests on the rebased branch
The three failures are source-pattern checks for the functions this PR removes, so they would need rewriting either way. The part that needs a decision is what they stand for: since #9485 and #13439, So the open question for whoever picks this up: does a soft Quickshell reload keep the session lock and the other |
|
Looked again at 2a6f31c after the two comments above. The head has not moved and it still conflicts with This time the second opinion, Codex Medium, did run. It read the code without running it. It agreed with the finding above, but it can see this session's own notes, so its agreement is not guaranteed independent. It also raised points of its own, which I checked against the source:
I linked #6981, which this fixes. Next step is still yours, @catlee: bring the branch up to date with |
|
Looked again at 2a6f31c. The head has not moved, but there are now five open pull requests for this bug, so I compared them. This one is not the one I'm recommending to the maintainer. The competing fixes, oldest first:
The part of this pull request none of the others has is the symlink watching: This was checked by reading the five diffs against Waiting on the maintainer to choose among #10576, #11408 and #13911. |
What changed
Why
I am working on a local plugin installed through a symlink under
~/.config/omarchy/plugins. Editing the checkout behind that link did not trigger a reload. A manual rescan found manifest changes, but could still run an old imported JavaScript module.The watcher now includes direct external symlink targets. Rescanning creates a fresh QML engine without unnecessarily recreating windows.
Testing
bash test/shell.d/local-plugin-watcher-test.shbash test/shell.d/plugin-registry-contract-test.shbash test/shell.d/runtime-smoke-test.shqmllint shell/shell.qml shell/services/PluginRegistry.qmlbash test/shellreaches an unrelated package-checkout failure becauseOMARCHY_PKGS_PATHis not configured in this worktree.Fixes #6981
Fixes #11740