Guard against wpcom-dependent Jetpack modules on local sites#3611
Open
lezama wants to merge 3 commits into
Open
Guard against wpcom-dependent Jetpack modules on local sites#3611lezama wants to merge 3 commits into
lezama wants to merge 3 commits into
Conversation
…l env Add explicit caveat to the general Jetpack guidance in plugin-recommendations.ts: - List modules that require a wpcom connection (subscriptions, blaze, stats, sync) - Instruct the agent to NOT activate these in Studio's local PHP-WASM environment - Redirect newsletter signup requests to Jetpack Forms (contact-form module) Fixes the error youknowriad observed: wp jetpack module activate subscriptions Error: Newsletter could not be activated. Exit code: 1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Check connection status first rather than blocking outright. If the site is not connected to wpcom, fall back to Jetpack Forms for newsletter signups instead of activating the subscriptions module. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing a2a26ab vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
…ed fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds explicit guidance in the AI agent's Jetpack plugin recommendations to check for a WordPress.com connection before trying to activate modules that require one (e.g.
subscriptions,blaze,stats).If the site is not connected to wpcom, the agent falls back to Jetpack Forms (
contact-formmodule) for newsletter signups instead of hitting:Why
The
subscriptionsJetpack module hasRequires Connection: Yesin its module header. Jetpack's activation code explicitly blocks it when there's no wpcom connection — evenJETPACK_DEV_DEBUGdoesn't help because it only sets offline mode, which still enforces the connection check for modules that require it.Studio Code is local-first, so local sites won't have a Jetpack connection by default. The agent was blindly trying to activate
subscriptions(e.g. when adding a newsletter signup), triggering the error every time.Testing Instructions
Build a new local site with a newsletter signup (e.g. "a site for a coffee shop"). The agent should now:
wp jetpack connection statuscontact-form) instead of trying to activatesubscriptionsRelated
Reported by youknowriad in #studio-code.
Pre-merge Checklist
🤖 Generated with Claude Code