Skip to content

Studio Code: generate the tool list for live WordPress.com site sessions too - #5004

Merged
youknowriad merged 1 commit into
trunkfrom
stu-2508-generate-the-tool-list-for-live-wordpresscom-site-sessions
Oct 6, 2026
Merged

youknowriad merged 1 commit into
trunkfrom
stu-2508-generate-the-tool-list-for-live-wordpresscom-site-sessions

Conversation

@youknowriad

@youknowriad youknowriad commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Written with Claude Code. I reviewed the diff; Claude ran lint, typecheck and the CLI AI tests, and checked the change by rendering the system prompts before and after it.

Proposed Changes

Studio Code's system prompt lists the session's tools from the tools themselves (#4858), but only for local sites. Sessions on a live WordPress.com site still had a hand-written tool list, which drifts whenever a tool changes (#5003 had to edit it by hand).

  • Both kinds of session now get their tool list and tool guidelines from the tools they register, so the list can't drift from what the agent can actually call.
  • wpcom_request now describes itself in the prompt, like the other tools.
  • Live-site sessions also get the file tools' usage guidelines (Write size limits, batching edits), which they were missing.
  • The one live-site note the hand-written list carried (create a local site before pulling into it) moved to the live-site rules. That Read/Write/Edit/Ls only touch scratch files was already said there.

The local-site prompt is byte-for-byte unchanged, so local site builds behave as before.

Testing Instructions

  • npm test -- apps/cli/ai/tests/system-prompt.test.ts
  • In Studio Code on a live WordPress.com site (no eval covers these sessions):
    1. npm run cli:build && node apps/cli/dist/cli/main.mjs code
    2. Pick a WordPress.com site in the site picker.
    3. Ask "What's the title of my latest post?", then make a small change (e.g. "Change the tagline to …").
    4. The agent calls wpcom_request with the site's ID, and both requests work.

Pre-merge Checklist

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

🤖 Generated with Claude Code

Base automatically changed from stu-2496-let-wpcom_request-work-on-any-wordpresscom-site to trunk October 6, 2026 04:28
…registered tools

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@youknowriad
youknowriad force-pushed the stu-2508-generate-the-tool-list-for-live-wordpresscom-site-sessions branch from 4114991 to bd3e969 Compare October 6, 2026 04:30
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing bd3e969 vs trunk

app-size

Metric trunk bd3e969 Diff Change
App Size (Mac) 1456.80 MB 1456.80 MB 0.00 MB ⚪ 0.0%

site-editor

Metric trunk bd3e969 Diff Change
load 1180 ms 1171 ms 9 ms ⚪ 0.0%

site-startup

Metric trunk bd3e969 Diff Change
siteCreation 7062 ms 7056 ms 6 ms ⚪ 0.0%
siteStartup 3387 ms 3368 ms 19 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

@youknowriad
youknowriad merged commit 4c01449 into trunk Oct 6, 2026
11 of 13 checks passed
@youknowriad
youknowriad deleted the stu-2508-generate-the-tool-list-for-live-wordpresscom-site-sessions branch October 6, 2026 04:54
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