Repository navigation
feat(plugins): bind worker and panel approval to exact bytes and recheck before every start - #30637
Conversation
1d1caf5 to
723ffee
Compare
27af974 to
226c0a1
Compare
723ffee to
0db147c
Compare
226c0a1 to
8f9a8a3
Compare
0db147c to
9fc2023
Compare
8f9a8a3 to
880ad10
Compare
9fc2023 to
f828fed
Compare
880ad10 to
54639b8
Compare
f828fed to
dc669ca
Compare
54639b8 to
dfff513
Compare
dc669ca to
c3cce13
Compare
dfff513 to
b324ef1
Compare
b90df10 to
f27a26e
Compare
c4aafc0 to
a22710d
Compare
f27a26e to
7a56a37
Compare
a22710d to
96880d1
Compare
dce92a3 to
b7a4a3c
Compare
96880d1 to
df3870b
Compare
b7a4a3c to
00d3122
Compare
df3870b to
2c1552c
Compare
Consent for any plugin that runs code (a v2 sandboxed-ui or trusted-worker profile, or a v1 manifest with a worker or panel) now names its installed content hash, so an update cannot swap code under an old approval. Shipped v1 installs re-prompt once. Data packs keep their fingerprints, and dev trees stay unbound so a save doesn't re-prompt. The re-review notice is one short line.
The content verifier cached its first check, so bytes swapped between a crash and its restart still ran. The controller now hands the manager one uncached verifyBeforeSpawn hook that runs before every spawn, including crash restarts, and replaces the cached first-start check, so nothing is hashed twice and a running worker is reused without hashing. It is an integrity check, not a sandbox: Node still reads files after it. Approval is re-asserted at the same points, so a revoked plugin stops restarting instead of counting as a crash, and cancellation does not wait on a hash.
A refresh that changes a running worker's spec used to stop it and wait for the next command or event. Reconcile now restarts it once on the new spec after every stop, through the same approval and integrity path, and skips the restart if a newer reconcile or dispose has taken over. Idle workers stay lazy.
Approval of worker and panel plugins now names their exact bytes, so switching the demo plugin from its installed copy to the dev folder asks for review again; the journey approves the dev copy before using it.
00d3122 to
2e3e915
Compare
…d test smudge filters for real
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Walkthrough
Priority: Merge Risk:
|
[High impact] The PR changes approval and start checks for executable plugins. The PR still needs the earlier fix for workers that call the host while restarting during a refresh. Findings
SummaryThe PR ties installed worker and panel approval to their exact files and checks worker files before every start.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9457fa8f-2268-4d12-ba26-c4d30658be01
Files selected for processing: 30-
src/main/plugins/__mocks__/plugin-uninstall-log-test-fixture.tssrc/main/plugins/plugin-content-integrity.tssrc/main/plugins/plugin-discovery.test.tssrc/main/plugins/plugin-discovery.tssrc/main/plugins/plugin-git-repository.integration.test.tssrc/main/plugins/plugin-git-repository.tssrc/main/plugins/plugin-service-integrity.test.tssrc/main/plugins/plugin-service-reconciliation.test.tssrc/main/plugins/plugin-service.tssrc/main/plugins/plugin-uninstall-log-retention.test.tssrc/main/plugins/plugin-uninstall-ordering.test.tssrc/main/plugins/plugin-worker-controller.test.tssrc/main/plugins/plugin-worker-controller.tssrc/main/plugins/plugin-worker-manager.tssrc/main/plugins/plugin-worker-reconciliation.tssrc/main/plugins/plugin-worker-refresh-admission.test.tssrc/main/plugins/plugin-worker-reviewed-content.test.tssrc/main/plugins/plugin-worker-spawn-spec.tssrc/main/plugins/plugin-worker-startup.tssrc/renderer/src/components/settings/PluginConsentDialog.test.tsxsrc/renderer/src/components/settings/PluginConsentDialog.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/plugins/plugin-consent-fingerprint.test.tssrc/shared/plugins/plugin-consent-fingerprint.tstests/e2e/plugin-demo.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
…s before awaiting refresh on shutdown, and narrow inherited Git protocol allowlists
| isCurrentApproved: (plugin) => | ||
| this.findValidPlugin(plugin.pluginKey) === plugin && this.canStartPluginWork(plugin), | ||
| isCurrentApproved: (spec) => isApprovedWorkerSpec(spec, resolveApproved(spec.pluginKey)), | ||
| isApprovalKept: (spec) => isApprovedWorkerSpec(spec, resolveApproved(spec.pluginKey, true)), |
There was a problem hiding this comment.
isApprovalKept now lets a crashed worker restart while contentPacksReady is false. But its host calls still use getGrantedCapabilities, which returns null during that pause. A plugin that awaits orca.host.call() during activation therefore gets consent_required despite still being approved.
An uncaught rejection ends activation and counts as another crash. A slow refresh can exhaust the remaining retries, and the unchanged refresh then skips that worker instead of recovering it. Wait for the pause to end before starting the worker, or keep its approved host calls available through the same pause.
There was a problem hiding this comment.
Leaving as is: the refresh pause denies host calls to every running worker, not just restarts, and lasts one file reread; a restart that lands in it now fails one attempt and backs off instead of ending recovery outright.
There was a problem hiding this comment.
Agreed. The refresh pause also denies host calls to workers that were already running, and a restart that hits the pause gets the normal retry/backoff rather than failing recovery immediately. Given the pause is limited to the refresh reread, leaving this as-is is reasonable; my earlier comment overstated the restart-specific impact.
ELI5
When you approve a plugin that runs code (a background worker or a panel), the approval now covers those exact files. If the files change, Orca asks you to look again before running them. Each time a worker starts or restarts after a crash, Orca first checks that its files are still the ones you approved. When a plugin updates while its worker is running, the worker restarts on the new code instead of staying stopped.
What Changed
1. Approval tied to exact files (
plugin-consent-fingerprint.ts,plugin-discovery.ts)2. Integrity check before every start (
plugin-worker-manager.ts,plugin-worker-startup.ts,plugin-worker-controller.ts)3. Restart on update (
plugin-worker-controller.ts)Why
Linked Issue
None — this is part of the plugin platform rework (maintainer change).
Visual Proof
The only visible change is the re-approval notice in the plugin review dialog, now one short line.
The layout, the dialog, and when it appears are unchanged; it now also appears after an update to a worker or panel plugin's files.
Testing
Approval tests: a changed file hash requires approving again for v1/v2 workers and panels; data packs stay approved. Discovery gives an installed v2 worker a new approval identity when its files change.
Worker tests:
Updated tests: existing tests now use the new approval identity. They approve an updated bundled worker the way a user would, or verify the integrity check at start time.
Dialog test: updated for the new notice.
Platforms: macOS, run locally; Linux and Windows run in CI.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reason — copy change described above; screenshot not capturedpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — plugin tests,check:code-quality:changed,pnpm tc:nodeandtc:webpass; CI covers the rest