Skip to content

FORNO-300: Skip premature enabling of AM via Block Notes#47975

Draft
iamchughmayank wants to merge 2 commits intotrunkfrom
fix/skip-premature-am-enable-block-notes
Draft

FORNO-300: Skip premature enabling of AM via Block Notes#47975
iamchughmayank wants to merge 2 commits intotrunkfrom
fix/skip-premature-am-enable-block-notes

Conversation

@iamchughmayank
Copy link
Copy Markdown
Contributor

@iamchughmayank iamchughmayank commented Apr 7, 2026

Fixes #

Proposed changes

Block Notes was hooking into the agents_manager_use_unified_experience filter to force-enable Agents Manager whenever Block Notes was active causing Agents Manager to load site-wide.

  • Remove the enable_agents_manager_for_block_notes() function and its
    agents_manager_use_unified_experience filter hook
  • Remove associated tests

Block Notes JS (block-notes.min.js) is self-contained and works independently of Agents Manager, consistent with how Image Studio operates.

Other information

Related product discussion/links

Does this pull request change what data or activity we track or use?

Testing instructions

Regression test Block Notes:

  1. Sandbox a site and install plugin: bin/jetpack-downloader test jetpack fix/skip-premature-am-enable-block-notes
  2. Goto draft post and add a block
  3. Create a note and prompt AI
  4. It should respond correctly.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

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 fix/skip-premature-am-enable-block-notes branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/skip-premature-am-enable-block-notes

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 added [Extension] Block Notes [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

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.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Apr 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes Block Notes’ behavior that force-enabled the Agents Manager “unified experience” via the agents_manager_use_unified_experience filter, aligning with the goal of avoiding premature Agents Manager activation when Block Notes is enabled.

Changes:

  • Removed the enable_agents_manager_for_block_notes() filter hook from the Block Notes extension.
  • Deleted the associated unit tests that asserted the previous enablement behavior.
  • Simplified test teardown by no longer clearing agents_manager_use_unified_experience filters.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
projects/plugins/jetpack/extensions/plugins/block-notes/block-notes.php Stops Block Notes from enabling Agents Manager unified experience via a filter.
projects/plugins/jetpack/tests/php/extensions/plugins/block-notes/Block_Notes_Test.php Removes tests for the deleted enablement function and drops related teardown cleanup.

Comment on lines 961 to 963
// -------------------------------------------------------------------------
// register_headless_agent_provider() tests
// -------------------------------------------------------------------------
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR removes the enable_agents_manager_for_block_notes() filter behavior (and its tests), but there isn’t a replacement regression test asserting Block Notes no longer enables Agents Manager’s unified experience. Consider adding a test that verifies no agents_manager_use_unified_experience filter is registered / apply_filters( 'agents_manager_use_unified_experience', false ) remains false when only Block Notes is enabled, so this behavior doesn’t accidentally reappear.

Copilot uses AI. Check for mistakes.
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented Apr 7, 2026

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/extensions/plugins/block-notes/block-notes.php 104/115 (90.43%) 0.52% -1 💚

Full summary · PHP report · JS report

@iamchughmayank iamchughmayank marked this pull request as ready for review April 7, 2026 17:23
@iamchughmayank iamchughmayank marked this pull request as draft April 16, 2026 14:28
@iamchughmayank
Copy link
Copy Markdown
Contributor Author

Converted to draft since Block Notes was disabled temporarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Extension] Block Notes [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants