Studio Code Assistant - #2870
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…l, permission) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add AiEnginePanel to AI settings modal for switching between Studio Code (local agent) and Studio Assistant (WordPress.com). Modify ContentTabAssistant to check engine preference and provider availability on mount, rendering StudioCodeChat when Studio Code is selected and available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…component Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove redundant proc.start() in studioCodeStart IPC handler (getOrCreateProcess already starts the process) - Fix useEffect dependency array to use individual properties instead of full selectedSite object reference - Replace console.warn with console.error in StudioCodeProcess Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use AbortController to cleanly terminate the cancel listener when a turn completes, preventing it from stealing stdin lines - Add command type validation in parseCommand() to reject unknown types - Use crypto.randomUUID() for permission request IDs - Handle cancel commands in waitForCommand() by throwing AbortError Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Create headless-types.ts with HeadlessEvent and HeadlessCommand types - Add --headless, --site, --site-name, --site-url options to studio ai command - Route to runHeadlessCommand() when --headless is set Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📊 Performance Test ResultsComparing b3da4f4 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) |
# Conflicts: # apps/cli/commands/ai/index.ts # apps/studio/src/components/ai-settings-modal.tsx # apps/studio/src/index.ts # apps/studio/src/preload.ts
- Resolve CLI ai command: keep both headless and session-persistence options - Resolve index.ts imports: keep studio-code + add SiteServer, remove deleted setup-wp-server-files - Resolve preload.ts: keep both studio-code IPC methods and new WordPress skills methods - Keep ai-settings-modal.tsx (deleted in trunk, needed for studio-code feature) - Fix authToken access: read from SharedConfig instead of UserData - Remove unused onOpenSettings prop from studio-code-chat Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…-assistant # Conflicts: # apps/cli/commands/ai/index.ts
…nt turn Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…into studio-code-assistant
…n JSON mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| @@ -357,6 +359,16 @@ const UnauthenticatedView = ( { onAuthenticate }: { onAuthenticate: () => void } | |||
| ); | |||
katinthehatsite
left a comment
There was a problem hiding this comment.
Another bit that I found strange (although I understand why it is needed) is that you can type but can't send a message while the assistant is answering. With tools like Claude or Cursor, you can either queue the message or interrupt the ongoing request and send a new message:
Screen.Recording.2026-04-15.at.10.49.03.AM.mov
| } | ||
|
|
||
| export function studioCodeAbort( _event: IpcMainInvokeEvent, siteId: string ): void { | ||
| abortTurn( siteId ); |
There was a problem hiding this comment.
I don't think we have a user facing option to abort a running turn. Should we? (similar comment to the other one I made about not being able to send a message while assistant is thinking)
| @@ -0,0 +1,34 @@ | |||
| // Event types matching the JSON mode output from `studio code --json` | |||
There was a problem hiding this comment.
There is a file that is named the same in apps/studio/src/components/studio-code-types.ts and I am wondering if we should rename them to make them cleaner e.g 👍
- studio-code-ui-types.ts (the component/renderer types)
- studio-code-event-types.ts (the CLI wire format types)
Let's track that. I think it's a bug on Studio Code (not just here but also in CLI) |
Created STU-1574 |
…io Code chat Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| <span className="ltr:pl-2 rtl:pl-2">{ __( 'Build with Telex' ) }</span> | ||
| <ArrowIcon /> | ||
| </MenuItem> | ||
| { showTelexLink && ( |
There was a problem hiding this comment.
TBH, I don't think we should have this link to Telex.
There was a problem hiding this comment.
Agreed. I'll create a follow-up issue to remove it and we can discuss it there. This PR just keeps intact the experience of Studio Assistant.
| adapter: AiOutputAdapter; | ||
| initialMessage?: string; | ||
| resumeSession?: LoadedAiSession; | ||
| resumeSessionId?: string; |
There was a problem hiding this comment.
I like the fact we can resume sessions now.
wesleyfantinel
left a comment
There was a problem hiding this comment.
My understanding is that this is adding good changes to the headless (--json) mode. I haven’t looked at the studio app changes yet.
Splits the two identically-named files so readers can tell at a glance which defines renderer/UI types and which defines the CLI JSON wire format: - apps/studio/src/components/studio-code-types.ts -> studio-code-ui-types.ts - apps/studio/src/modules/studio-code/studio-code-types.ts -> studio-code-event-types.ts Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two changes from PR #2870 review: - Throw when --resume-session points at a missing session instead of silently creating a fresh one. Silent creation is misleading for callers (notably the desktop app, which spawns the CLI with a specific session ID) and hides real bugs. - Call maybeAutoSwitchProvider() once from inside runAgentTurn so every mode (JSON, initial message, slash/skill commands, interactive loop) consistently re-evaluates provider availability before a turn. The initial-message path was previously missing this check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # apps/cli/commands/ai/index.ts # apps/studio/src/ipc-handlers.ts
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@wesleyfantinel , @katinthehatsite , I addressed your feedback and added a logout page state. Could you take another look? I would like to merge the PR behind a feature flag and create follow-up issues for the rest of improvements. |
# Conflicts: # apps/studio/src/ipc-utils.ts

Related issues
How AI was used in this PR
Currently mostly vibe-coded with superpowers.
Proposed Changes
Default empty chatTesting Instructions
ENABLE_STUDIO_CODE_UI=true npm startstudio-code-assistant.mp4
Pre-merge Checklist