Skip to content

Studio Code: Point to the remote-site skill from the active-site line instead of the system prompt - #5191

Closed
chubes4 wants to merge 1 commit into
trunkfrom
studio-code/drop-remote-site-line
Closed

chubes4 wants to merge 1 commit into
trunkfrom
studio-code/drop-remote-site-line

Conversation

@chubes4

@chubes4 chubes4 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude (via the Pi coding agent in a Roadie session) found the rule, ran an eval showing a plain deletion regresses, wrote the replacement and its tests, and ran the checks and evals below.

Proposed Changes

  • The system prompt told the agent, on every turn, to load edit-manage-remote-site first for any WordPress.com site. That line is removed.
  • Instead, the active-site line names the skill only when the active site is on WordPress.com. The runtime writes that line from Studio's own site data, so the instruction appears exactly when it applies:
    [Active site: "X" (ID: 123) at https://… (WordPress.com, live: load the edit-manage-remote-site skill before working on it)]
  • Local sites' active-site line is unchanged.
  • When the user names a WordPress.com site without making it active, the skill's own description (in the Skill tool's list) covers the routing.

Testing Instructions

  • npx vitest run apps/cli/ai apps/cli/commands/ai: the new site-selection.test.ts checks both active-site lines; the prompt test checks the skill's description carries the routing and the prompt no longer does.
  • Eval, read-only against a real WordPress.com site (Business plan), 2 runs per case per arm. A run passes when the agent loads edit-manage-remote-site before its first wpcom_request, makes only GET requests, and touches no local site.
Case Trunk Line deleted, nothing added This PR
Active WordPress.com site: "how many published posts, which theme?" 2/2 0/2 2/2
Names the site: "which plugins are active on my site X?" 2/2 2/2 2/2
Names the site: "does X have a Contact page? Don't change anything." 2/2 1/2 2/2
  • Without the line, an active WordPress.com site went straight to wpcom_request without the skill. Answers were still right for these read-only questions, but a change would have skipped the skill's plan check, size limits and verification.
  • All answers were correct on every arm, and no run made a non-GET request.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@chubes4

chubes4 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Closing. The eval in the description shows the trunk prompt line is what makes the agent load edit-manage-remote-site for an active WordPress.com site (0/2 without it). It doesn't show that loading the skill changes outcomes: every answer was correct on every arm, but these were read-only questions. Moving the line into the active-site message keeps parity without a clear gain, so the open question is whether the skill matters for changes to a live site. That needs a write eval on a test site before deciding between keeping the line, enforcing it, or dropping it.

Claude (via the Pi coding agent in a Roadie session) ran the evals and wrote this note.

@chubes4 chubes4 closed this Oct 19, 2026
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing a3edfc3 vs trunk

app-size

Metric trunk a3edfc3 Diff Change
App Size (Mac) 927.54 MB 927.54 MB 0.00 MB ⚪ 0.0%

site-editor

Metric trunk a3edfc3 Diff Change
load 1144 ms 1165 ms +21 ms ⚪ 0.0%

site-startup

Metric trunk a3edfc3 Diff Change
siteCreation 8147 ms 8564 ms +417 ms 🔴 5.1%
siteStartup 5899 ms 5905 ms +6 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants