fix: isolate browser ability registration - #2755
superdav42 wants to merge 3 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (11)
💤 Files with no reviewable changes (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe browser ability registry now stores callbacks and descriptors in page-local state, and admin enqueue paths no longer load the WordPress abilities modules or bridge. Preview URL hash extraction now distinguishes declared hashes from hashes derived from URLs. ChangesPage-local browser abilities
Pending preview URL handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant sessionsSlice
participant abilitiesIndex
participant registry
sessionsSlice->>abilitiesIndex: ensureRegistered()
abilitiesIndex->>registry: registerCategory()
abilitiesIndex->>registry: registerClientAbility()
registry-->>abilitiesIndex: local registration complete
sessionsSlice->>registry: snapshotDescriptors()
Merge Risk: ⚪ Minimal · up to Browser abilities now run from a page-local registry, and the admin screens no longer load the WordPress abilities modules. Ordinary screenshot URLs stay executable, and private Elementor preview URLs are still sealed before they are stored. No outstanding issue blocks merging this change. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary
sd-ai-agent-jscategory registration and isolate chat bootstrap from malformed third-party ability categorieswp.abilitiesscreenshot-urltargets while retaining sealed transport for explicitly marked private Elementor preview URLsReproduction
With WPForms Lite active, loading the SD AI Agent admin screen reproduced both reported failures:
Category "sd-ai-agent-js" is already registered.Ability "wpforms/list-forms" references non-existent category "wpforms-forms".After the change, the same screen loads with 13 standard local browser abilities and neither abilities fetch warning. Elementor 4.1.3 adds four optional in-editor MCP abilities through its public
elementorV2.editorMcpadapter.Live conversational ability matrix
Model-driven browser callback and tool-result records cover all 17 production abilities across sessions 48, 51, and 52:
navigate-to,refresh-pagecapture-screenshot,screenshot-urlget-editor-selection,get-editor-capabilities,get-canonical-block-examplesinsert-block,insert-block-markup,replace-editor-selection,change-editor-historyvalidate-page-quality,validate-theme-completionget-elementor-editor-mcp-context,list-elementor-editor-mcp-capabilities,read-elementor-editor-mcp-resource,call-elementor-editor-mcp-toolRepresentative durable evidence:
navigate-toreached/wp-admin/plugins.phpand completed its tool-result continuationget-element-configuration-valuestool and returned the expected missing-fixture resultURL is required; after the fix,screenshot-urlretainedhttp://wordpress.local:8080/, returnedsuccess=true, and attached the rendered image to the modelWorker self-verification
Additional checks:
ElementorCompletionGateTest— 9 tests, 50 assertionspnpm run verifycompleted successfullyaidevops.sh v3.34.13 plugin for OpenCode v1.18.31 with gpt-5.6-sol spent 48m and 499,908 tokens on this with the user in an interactive session.
Summary by CodeRabbit