Repository navigation
Studio Code: List the user's WordPress.com sites in site_list - #5234
Merged
Merged
Conversation
site_list only listed local sites, so a site the user named that lives on WordPress.com looked missing. It now also returns the WordPress.com sites the login reaches, with the ID wpcom_request takes, through the same getWpComSites() the /site picker uses. A failed or signed-out lookup leaves the local listing intact. The remote-site runbook points to site_list instead of GET !/me/sites, whose plan field can return megabytes.
chubes4
marked this pull request as ready for review
October 21, 2026 03:54
Collaborator
📊 Performance Test ResultsComparing 850a7a4 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) |
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.
Related issues
How AI was used in this PR
Claude (via the Pi coding agent in a Roadie session) wrote the change and the tests, and ran the eval below on trunk and on this branch. I reviewed the diff and the transcripts.
Proposed Changes
site_listlisted only local sites. When the user names one of their WordPress.com sites and no WordPress.com site is active, the agent looked there, found nothing, and concluded the site doesn't exist. Nothing pointed it to WordPress.com, except a line in the remote-site runbook, which is only loaded once the agent already knows the site is remote.site_listnow returns{ local, wordpressCom }.wordpressComholds the sites the stored login reaches, with the IDwpcom_requesttakes assiteId. They come from the samegetWpComSites()the/sitepicker uses: about 14 KB for 160 sites, versus 2.4 MB forGET !/me/siteswithplan.signedIn: false. If the lookup fails, it reports the error and still lists the local sites.REMOTE_READ, likesite_connected_remote_sites. That tool is still read-only, so hosts run it without asking.site_listfor other sites instead ofsite_connected_remote_sitesorGET !/me/sites.Testing Instructions
npx vitest run apps/cli/ai/tests/tools.test.ts: it lists local and WordPress.com sites together, reports a signed-out user, and keeps the local sites when WordPress.com can't be reached.~/Studiowith Bashsite_list, then onewpcom_requestNo run on either arm called
GET !/me/sites. Median tokens went from 37k to 52k (theme) and from 32k to 53k (draft), because the branch finishes the task where trunk stopped to ask. The drafts were trashed afterwards.Pre-merge Checklist