AI Assistant: add feature settings controls#50287
Conversation
test_add_agents_manager_data_exposes_ai_editorial_review_enabled set A8C_PROXIED_REQUEST, which marks an internal testing environment. That is the same gate that emits the payload at all and that exposes the in-development Generate Feedback and Optimize Title suggestions, so the old false assertions were unreachable. Assert them true to match the gate, keeping seoSuggestions off since the seo-tools module is inactive.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCannot generate coverage summary while tests are failing. 🤐 Please fix the tests, or re-run the Code coverage job if it was something being flaky. |
Generate Feedback and AI Editorial Review are writing suggestions, so the jetpack_ai_writing_assistant_enabled toggle must switch them off along with Proofreader and Optimize Title — including when an external host (Big Sky, Woo) draws the sidebar.
726f87e to
c897b4d
Compare
Fixes #
Proposed changes
Jetpack_AI_Settingsregistry for the Jetpack AI master switch and per-feature toggles.wpcom/v2/jetpack-ai/feature-settingsfor reading and updating AI feature settings.Related product discussion/links
Does this pull request change what data or activity we track or use?
Yes. It registers and syncs site-local boolean options for Jetpack AI feature settings (
jetpack_ai_enabled,jetpack_ai_writing_assistant_enabled,jetpack_ai_image_editor_enabled,jetpack_ai_image_label_enabled,jetpack_ai_excerpt_enabled) so WordPress.com can read the site's AI feature-toggle state. It does not add new event tracking.Testing instructions
GET /wp-json/wpcom/v2/jetpack-ai/feature-settings.host_allows_ai,is_connected,plan.supports_ai,plan.supports_search,master_enabled, and feature entries for writing assistant, image editor/image label, SEO enhancer, excerpt, and AI Search.POST /wp-json/wpcom/v2/jetpack-ai/feature-settingspayload such as{ "master_enabled": false, "features": { "excerpt": false, "seo_enhancer": { "enabled": true } } }.Local validation run:
git diff --checkphp -lon all changed PHP filesNot run locally:
WORDPRESS_DEVELOP_DIRin this checkout.10.30.3; this repo currently requires^11.5.0, so the hooks failed before running repository checks.