CLI: Remove feature flag gating from remote-session - #3513
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes the CLI remote-session feature publicly available by removing the STUDIO_ENABLE_REMOTE_SESSION feature-flag gate and registering the related command surfaces unconditionally.
Changes:
- Remove the
STUDIO_ENABLE_REMOTE_SESSIONfeature flag implementation and its tests. - Register
studio code remote-sessionand the hidden--message-from-stdinoption unconditionally. - Remove slash-command gating and make daemon status polling always run to keep the REPL indicator in sync.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| specs/studio-code-remote-session-spec.md | Updates spec notes to reflect removal of the feature flag and unconditional daemon polling. |
| apps/cli/lib/feature-flags.ts | Deletes the feature flag helper (isRemoteSessionEnabled). |
| apps/cli/lib/tests/feature-flags.test.ts | Deletes tests for the removed feature flag helper. |
| apps/cli/index.ts | Registers the remote-session command unconditionally. |
| apps/cli/commands/ai/index.ts | Always registers and honors --message-from-stdin; starts daemon status polling unconditionally. |
| apps/cli/ai/daemon-status-poll.ts | Removes enablement gating so polling always runs. |
| apps/cli/ai/tests/daemon-status-poll.test.ts | Updates polling tests to reflect unconditional behavior. |
| apps/cli/ai/slash-commands.ts | Removes the enabled gate and related filtering for slash commands. |
| apps/cli/ai/tests/slash-commands.test.ts | Updates slash command tests to remove feature-flag expectations. |
| apps/cli/ai/tools/index.ts | Cleans up comments that referenced the removed feature flag. |
| apps/cli/ai/tools/share-screenshot.ts | Cleans up comments that referenced the removed feature flag. |
Comments suppressed due to low confidence (1)
apps/cli/commands/ai/index.ts:708
- The
--jsonvalidation error message is now inaccurate: callers can satisfy the requirement either by passing an initial message argument or by using--message-from-stdin. Update the message to mention both options so users aren’t misled when using stdin mode.
return chain.check( ( argv ) => {
if ( argv.json && ! argv.message && ! argv.messageFromStdin ) {
throw new Error( __( '--json requires an initial message argument' ) );
}
return true;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Performance Test ResultsComparing 32c83b0 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) |
epeicher
left a comment
There was a problem hiding this comment.
Thanks @gcsecsey for releasing this! I have tested it, and I can see and execute the command as expected without the feature flag.
| CLI commands |
|---|
![]() |
I have also tested creating a site using studio code just co check the regression impact and I haven't found anything. Changes also LGTM!

Related issues
How AI was used in this PR
Claude Code drafted the edits and ran typecheck, lint, the affected vitest suites, and the CLI build. I reviewed the diff before pushing.
Proposed Changes
The remote-session feature in the CLI was gated behind the
STUDIO_ENABLE_REMOTE_SESSIONenv var introduced in STU-1654 (default OFF). To make the initial version publicly available, this PR removes the gate so the feature ships on by default for everyone on a recent CLI build.apps/cli/lib/feature-flags.tsand its tests. The flag and its only export,isRemoteSessionEnabled(), are gone.studio code remote-session(inapps/cli/index.ts) is registered unconditionally instead of behind a dynamic import + flag check.--message-from-stdinoption onstudio codeis now always registered and honored. Previously the option was only added and only respected when the flag was on, which made the daemon's headless turn entry point unreachable for non-opted-in users./remote-sessionslash command no longer carries anenabledgate. The unusedenabledfield onSlashCommandDefand the filter insidegetActiveSlashCommands()were removed since they had no other consumers.startDaemonStatusPolling()no longer takes anisEnabledoption. The 5sgetDaemonStatus()poll that mirrors daemon liveness into the REPL bottom-bar runs unconditionally.apps/cli/ai/tools/index.ts,apps/cli/ai/tools/share-screenshot.ts, and the spec underspecs/studio-code-remote-session-spec.md(added a 2026-05-15 status note documenting the removal).Testing Instructions
npm run cli:build && node apps/cli/dist/cli/main.mjs code --help. Confirm theremote-sessionsubcommand is listed without setting any env var.node apps/cli/dist/cli/main.mjs code remote-session --helpand verifystart,stop,status,attachare all advertised.studio codesession, type/, and confirm/remote-sessionappears in the autocomplete withstart/stopargument completions, again without any env var set./remote-session startfrom the REPL and verify the bottom-bar indicator flips to running. Stop the daemon from a second terminal withstudio code remote-session stopand confirm the REPL's indicator updates within ~5s (the unconditional poll).npm test -- apps/cli.studio code --helpshowingremote-sessionsubcommand/autocomplete showing/remote-session/remote-session startPre-merge Checklist