[FORNO-326] Add Jetpack AI abilities to Page/Site editor#49979
[FORNO-326] Add Jetpack AI abilities to Page/Site editor#49979kat3samsin wants to merge 3 commits into
Conversation
|
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: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
a59d3e2 to
11aa799
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands Jetpack AI’s provider bundle/data exposure beyond the post editor to also support the page editor and site editor, while keeping the same rollout gating (preview enabled, proxied request, Jetpack AI enabled, and AI features available) and avoiding overwriting any host-chosen agentId.
Changes:
- Introduce a broader “provider exposure” gate (
should_expose_provider) and use it for provider enqueue/registration and external AM payload patching. - Adjust Agents Manager data injection so page/site editors receive
jetpackAiSidebarconfig without Jetpack settingagentId. - Update and extend PHPUnit coverage for proxied vs unproxied behavior, AI-disabled behavior, and provider registration/enqueue on page/site editor surfaces.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/ai-sidebar/class-jetpack-ai-sidebar.php | Adds provider-level gating and expands provider exposure to page/site editor while preserving host agent selection. |
| projects/plugins/jetpack/tests/php/extensions/plugins/ai-sidebar/Jetpack_AI_Sidebar_Test.php | Updates existing tests for the new proxied gate and adds coverage for page/site editor provider behavior. |
| projects/plugins/jetpack/changelog/fix-jetpack-ai-provider-proxied-gate | Adds a Jetpack plugin changelog entry describing the new page/site editor abilities exposure. |
| private static function is_proxied_request(): bool { | ||
| $is_server_proxied = isset( $_SERVER['A8C_PROXIED_REQUEST'] ) | ||
| && (bool) sanitize_text_field( wp_unslash( $_SERVER['A8C_PROXIED_REQUEST'] ) ); | ||
|
|
||
| return $is_server_proxied || ( defined( 'A8C_PROXIED_REQUEST' ) && A8C_PROXIED_REQUEST ); | ||
| } |
Fixes #
Proposed changes
agentId.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
See WPCOM PR 225251