Skip to content

AI Assistant: add feature settings controls#50287

Draft
kat3samsin wants to merge 10 commits into
forno-326/jetpack-ai-to-page-site-editorfrom
add/jetpack-ai-feature-settings
Draft

AI Assistant: add feature settings controls#50287
kat3samsin wants to merge 10 commits into
forno-326/jetpack-ai-to-page-site-editorfrom
add/jetpack-ai-feature-settings

Conversation

@kat3samsin

Copy link
Copy Markdown
Contributor

Fixes #

Proposed changes

  • Add a centralized Jetpack_AI_Settings registry for the Jetpack AI master switch and per-feature toggles.
  • Add wpcom/v2/jetpack-ai/feature-settings for reading and updating AI feature settings.
  • Wire the settings gates into AI Assistant, AI Chat, AI Content Lens/excerpt, Image Studio, and AI Sidebar feature suggestions.
  • Add PHPUnit coverage for the settings gates, REST payload/update behavior, AI Content Lens gating, Image Studio gating, and sidebar suggestions.

Related product discussion/links

  • None included.

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

  1. In a Jetpack test environment with this branch active, authenticate as an admin user and request GET /wp-json/wpcom/v2/jetpack-ai/feature-settings.
  2. Confirm the response includes 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.
  3. Send a partial POST /wp-json/wpcom/v2/jetpack-ai/feature-settings payload such as { "master_enabled": false, "features": { "excerpt": false, "seo_enhancer": { "enabled": true } } }.
  4. Confirm only the submitted options change and the response returns the fresh settings shape.
  5. Toggle individual feature options off and confirm their corresponding editor entry points or sidebar suggestions no longer load.

Local validation run:

  • git diff --check
  • php -l on all changed PHP files

Not run locally:

  • Full Jetpack PHPUnit. Docker is not running locally, and Composer PHPUnit requires WORDPRESS_DEVELOP_DIR in this checkout.
  • Husky commit/push hooks. The active local pnpm is 10.30.3; this repo currently requires ^11.5.0, so the hooks failed before running repository checks.

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.
@kat3samsin kat3samsin added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account labels Jul 7, 2026
@kat3samsin kat3samsin self-assigned this Jul 7, 2026
@kat3samsin kat3samsin added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account labels Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the add/jetpack-ai-feature-settings branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/jetpack-ai-feature-settings

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

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.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Cannot generate coverage summary while tests are failing. 🤐

Please fix the tests, or re-run the Code coverage job if it was something being flaky.

Full summary · PHP report · JS report

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.
@kat3samsin kat3samsin force-pushed the forno-326/jetpack-ai-to-page-site-editor branch 3 times, most recently from 726f87e to c897b4d Compare July 8, 2026 14:51
@kat3samsin kat3samsin removed the [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] AI Assistant [Block] AI Chat Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Extension] AI Assistant Plugin [Extension] AI Content Lens [Extension] Image Studio [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant