Use dedicated endpoint for Agents Manager state#108636
Open
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Contributor
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
3 tasks
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.
Partially fixes AI-850
Paired with Automattic/jetpack#46937
Proposed Changes
/me/preferencesendpoint to the new dedicated/wpcom/v2/agents-manager/stateendpoint.calypso_preferenceswrapper from all request and response handling — the new endpoint uses a flat key/value format.resolvers.ts: GET now hits/agents-manager/stateand reads flat keys directly instead of unwrappingcalypso_preferences.actions.ts: POST now hits/agents-manager/statewith{ state: { ... } }body instead of{ calypso_preferences: { ... } }.use-persisted-history.ts: Same POST pattern for persisting router history on navigation.use-unified-ai-chat.ts: Now fetches from/agents-manager/state?key=unified_ai_chat(v2) instead of/me/preferences(v1.1).apiFetchpath (/agents-manager/open-state) is unchanged — the Jetpack proxy handles the translation.Why are these changes being made?
/me/preferencesendpoint exposes all calypso preferences, which is unnecessarily broad for Agents Manager.Testing Instructions
/agents-manager/state(not/me/preferences).install-plugin.sh agents-manager update/use-dedicated-state-endpointinstall-plugin.sh help-center update/use-dedicated-state-endpointchange/use-wpcom-agents-manager-endpoint./agents-manager/open-state(the Jetpack proxy).install-plugin.sh agents-manager update/use-dedicated-state-endpoint(if not already)install-plugin.sh help-center update/use-dedicated-state-endpoint(if not already)bin/jetpack-downloader test jetpack-mu-wpcom-plugin change/use-wpcom-agents-manager-endpoint(Use Agents Manager state endpoint jetpack#46937)/agents-manager/stateendpoint.unified_ai_chatenabled, verify the flag is correctly read on Calypso. Unified sidebar should load when the setting is enabled.Pre-merge Checklist