chore(apps): consolidate accessor implementation to runtime (3/4) - #41378
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (124)
💤 Files with no reviewable changes (106)
📜 Recent review details⏰ Context from checks skipped due to timeout. (20)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (4)📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-05-06T12:21:44.083ZApplied to files:
📚 Learning: 2026-05-11T21:46:23.471ZApplied to files:
🪛 ast-grep (0.45.0)packages/apps/src/server/runtime/base/BaseRuntimeSubprocessController.ts[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec. (detect-child-process-typescript) 🔇 Additional comments (18)
WalkthroughThe PR removes host-side accessor implementations and ChangesAccessor consolidation
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #41378 +/- ##
===========================================
+ Coverage 68.72% 68.73% +0.01%
===========================================
Files 4151 4151
Lines 159513 159513
Branches 27988 27972 -16
===========================================
+ Hits 109621 109647 +26
+ Misses 44721 44686 -35
- Partials 5171 5180 +9
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
799c45f to
e1698b5
Compare
99e5b50 to
c8c10fe
Compare
e1698b5 to
91104bd
Compare
c8c10fe to
1658bb9
Compare
91104bd to
9630cd4
Compare
1658bb9 to
8bcb150
Compare
61c16fd to
8bc03d6
Compare
8bcb150 to
2e441d7
Compare
8bc03d6 to
c0d24d2
Compare
2e441d7 to
465c6a2
Compare
624af84 to
94bca38
Compare
465c6a2 to
f43eafd
Compare
94bca38 to
7deb704
Compare
f43eafd to
59d3fa4
Compare
Completes the primary objective: handleAccessorMessage and the entire accessor:* JSON-RPC category are gone. BaseRuntimeSubprocessController now dispatches only bridges:* (plus ready/log/error notifications), so there is a single app-originated RPC channel, a single permission model (the bridge do* wrappers), and accessor behavior lives in exactly one place - the base-runtime. - BaseRuntimeSubprocessController: delete handleAccessorMessage, ALLOWED_ACCESSOR_METHODS, isValidOrigin, getAccessorForOrigin, the accessor: branch in handleIncomingMessage, and the now-unused accessors/api fields (and their manager.getAccessorManager()/getApiManager() reads). The restart-time registration guard now lives in handleBridgeMessage via AppResourceBridge.REGISTRATION_METHODS (Phase 3). JSONRPC_METHOD_NOT_FOUND is kept - it is imported by ProxiedApp, AppListenerManager, AppVideoConfProvider. - AppListenerManager.executePostMessageSent: the one load-bearing host-side accessor consumer outside the RPC path now calls manager.getBridges().getUserBridge().doGetAppUser(appId) directly; the class no longer references AppAccessorManager. Physical deletion of the now-unreachable host accessor classes + AppAccessorManager is folded into follow-up #4 (documented), because it requires first un-threading the ignored accessors parameter from the sandbox-execution core (runTheCode) - a separate, behavior-neutral change the plan already carved out. The host accessors remain as dead code reachable by nothing on the subprocess path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FbxFGJWHiroxrdNPJRL3P
…oller test Phase 4 removed the accessor:* dispatch path (handleAccessorMessage) from BaseRuntimeSubprocessController, which DenoRuntimeSubprocessController extends. Four cases in DenoRuntimeSubprocessController.test.ts still called the deleted method and failed. Their behavior is now covered by the surviving handleBridgeMessage case plus the base-runtime accessor/RemoteBridges suites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FbxFGJWHiroxrdNPJRL3P
The base-runtime is the single source of truth for accessor behavior and the accessor:* message category is gone (Phase 4), so the host copies of the accessors are unreachable. This removes them and un-threads the vestigial accessor manager from the sandbox-execution core. - Drop the ignored `accessors: AppAccessorManager` parameter from the run*/ runTheCode methods of AppApi, AppSlashCommand, AppVideoConfProvider and AppOutboundCommunicationProvider, and the `accessors` field from their four managers (the app executes in the subprocess via sendRequest; the host accessor manager was never consulted). - Delete AppAccessorManager, its managers/index export, and AppManager's accessorManager field/constructor/getAccessorManager/purifyApp usage (purifyApp only cleared caches that were never populated). - Delete src/server/accessors/ (64 files) and the now-orphaned src/server/misc/UIHelper.ts. - Adapt tests: delete tests/server/accessors/ and the AppAccessorManager test; strip getAccessorManager/.accessors setup and assertions from the affected manager, AppManager and Deno-runtime tests. Behavior-neutral: host tsc error-set unchanged vs baseline; host node suites green (excluding the two deno-spawn integration suites, which require the deno binary and run in CI). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FbxFGJWHiroxrdNPJRL3P
59d3fa4 to
ac77da9
Compare
accessor:*message categoryProposed changes (including videos or screenshots)
Issue(s)
Related Jira task: ARCH-2185: reunite duplicated accessor implementations into a shared location
Steps to test or reproduce
Further comments
Summary by CodeRabbit