Repository navigation
fix(shell): keep __sourceDir on third-party plugin manifests - #11925
Conversation
publicPluginManifest() stripped __sourceDir from every non-first-party manifest, but service and panel plugin instances receive only that stripped manifest and no separate sourceDir (unlike barWidgets, which get meta.sourceDir). That left third-party service/panel plugins with no way to locate their own bundled scripts and assets: any plugin that launches a bundled script resolves it against an empty base path and fails silently (e.g. Omarchy-Spotify hangs on "Checking playback support…", its keyring/credential scripts never run). __sourceDir is the plugin's own install directory, not a privilege signal — the plugin's code already runs from there. Keep withholding the real privilege markers (__isFirstParty, __hostCapabilities) but stop stripping __sourceDir. The plugin auth-boundary test suite still passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Automated AI review
Verified: the one-line change gives third-party plugins their own
Verified in more detail:
Code comment and description overstate two pointsThe new comment in
Impact: the comment will be read as the rationale for this trust boundary. Its contrast with bar widgets is inaccurate, and the absolute "no way" wording misstates what plugins could do. Suggested change: shorten the comment, for example: Optional test improvement: Related issues: #10863 reports exactly this regression (Omarchy-Spotify, Omamail, omajam), and #12308 and #12418 report it again. Adding Review informationTest scope: Source review of the PR head, merge base and current AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Reviewed at 6df574c, merged onto the current Reproduced on a fresh Omarchy VM. A minimal third-party service plugin in Boundary. Nothing #9618 guards is weakened. The only reader of Tests on the VM: every plugin suite under Suggested changes:
This PR fixes #10863, #12308 and #12418. Adding Review and VM runs by Opus 5.5 in Claude Code. Codex XHigh was the second opinion: it found no behavioural or security defect and flagged the same comment and test gap. That is agreement, and its independence is not guaranteed. Waiting on the author for the two changes above, then on a maintainer. |
Bar widget instances are not handed sourceDir (ModuleSlot.injectProps sets only bar, moduleName and settings), and a plugin could reach its directory through Qt.resolvedUrl, so the comment's rationale was wrong on both counts. Two lines carry what the code cannot say. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No suite failed with the strip restored, so nothing kept the 4.0.3 regression from coming back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed and reproduced at 84e88b4. The fix is right, and I pushed two small commits on top of it. Reproduced on an Omarchy worker VM. With the shell running this branch, a minimal third-party service plugin in Boundary. Every caller of Pushed to your branch:
Tests on the worker: Linked #10863, #12308 and #12418, which all report this regression, so they close when this merges. Review, worker runs and fixes by Claude Opus 5.5. Codex Medium was the second opinion on this head. It found nothing: it checked the same callers and boundary, and confirmed the new test cannot pass vacuously. It agreed with my conclusion, and its independence is not guaranteed. Nothing is left for the author. This is waiting on CI, which has not run on this pull request, and then on a maintainer. |
|
None of the 31 changed upstream files is in the verification scope; the menu and lock code is byte-identical across the merge. The only contact is shell/shell.qml (omacom#11925), whose one-line insertion moves the cited summon lines by one: the threat surface and SW-REQ-260928-8VJQ now cite shell.qml:1841 and :1144. Research note in review/upstream-a85e29ab-research-delta.md; upstream_refresh_v1 steps 1-13 confirmed, coverage and the campaign stamp follow the audit.
fix(shell): keep __sourceDir on third-party plugin manifests (cherry picked from commit 0537ae1)
#11925 keeps __sourceDir on third-party public manifests so plugins can find their bundled scripts; the clone still drops the host trust markers.
Problem
publicPluginManifest()(shell/shell.qml) deletes__sourceDirfrom third-party plugin manifests. Third-party service and panel plugin instances receive only this stripped manifest (inst.manifest = shell.publicPluginManifest(manifest)) and — unlike barWidgets, which getsourceDirvia theirmeta— have no other channel to their own directory.As a result, any third-party service/panel plugin that reads
manifest.__sourceDirto locate its bundled files now gets"", so everyProcess/script it launches resolves to an absolute/scripts/...and fails silently.Observed in the wild after upgrading to 4.0.3:
Process failed to start … Command: QList("/scripts/keyring-store.sh", …)in the qslog).Worked before 4.0.3.
Fix
Stop stripping
__sourceDir. A plugin's own install directory is not a privilege signal — the plugin's code already resides and runs there, and barWidgets already receive it viameta.sourceDir. The genuine privilege markers (__isFirstParty,__hostCapabilities) remain withheld from third parties.Testing
test/shell.d/plugin-auth-boundary-test.shpasses (all 13 checks) — the change doesn't touch the object-tree detachment / auth-capability boundary that suite guards. The test asserts nothing about__sourceDir, confirming it was collateral rather than a deliberate boundary.🤖 Generated with Claude Code
Fixes #10863
Fixes #12308
Fixes #12418