Feature-flag the Cloud VM UI (cloud-vm-ui-enabled-release) - #7592
Conversation
Adds a PostHog-backed flag that hides every Cloud VM entrypoint so the feature can be turned off without shipping a build. Release builds default OFF (hidden) until the flag is enabled; DEBUG defaults ON for dogfood, matching the pro-upgrade-ui pattern. Gated at every surface (shared-behavior policy): the new-workspace dropdown Cloud VM section (Open/Fork/Checkpoint/Restore/Advanced), the caret's direct Cloud VM menu, the command-palette Cloud VM commands, and the three shared actions (performCloudVMAction, performCurrentCloudVMCommand, performCloudVMRestoreCommand) — so no entrypoint can reach Cloud VM when the flag is off. Localized flag title/description (en+ja). Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughAdds a Cloud VM UI feature flag, gates Cloud VM entrypoints behind it, and updates localization strings for CMUX, workspace layout, debug UI, notifications, and related menus. ChangesCloud VM feature flag and gating
Localization updates
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (7 errors, 1 warning)
✅ Passed checks (17 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds a feature flag for the Cloud VM UI. The main changes are:
Confidence Score: 4/5This is close, but the stale palette path should be fixed before merging.
Sources/ContentView+AuthCommandPalette.swift Important Files Changed
Reviews (5): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
| static func commandPaletteCloudCommandContributions() -> [CommandPaletteCommandContribution] { | ||
| // Feature-gated: hide every Cloud VM command from the palette when the | ||
| // Cloud VM UI flag is off, matching the dropdown and shortcut gates. | ||
| guard CmuxFeatureFlags.shared.isCloudVMUIEnabled else { return [] } |
There was a problem hiding this comment.
When the Cloud VM flag changes while the command palette is open, this guard only takes effect the next time the palette rebuilds its command corpus. A flag-off toggle can leave Cloud VM commands visible and selectable until the user refreshes or reopens the palette, where the handlers then silently return without doing anything.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| "featureFlags.cloudVM.description": { | ||
| "extractionState": "manual", | ||
| "localizations": { | ||
| "en": { | ||
| "stringUnit": { | ||
| "state": "translated", | ||
| "value": "Shows Cloud VM entrypoints in the new-workspace dropdown and command palette." | ||
| } | ||
| }, | ||
| "ja": { | ||
| "stringUnit": { | ||
| "state": "translated", | ||
| "value": "新規ワークスペースのドロップダウンとコマンドパレットにクラウドVMのエントリーポイントを表示します。" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "featureFlags.cloudVM.title": { |
There was a problem hiding this comment.
The new Cloud VM feature-flag title and description are shown in the Feature Flags window, but these catalog entries only include English and Japanese. This catalog already carries additional app locales on nearby production strings, so users in those locales will see fallback or missing localized copy for this new flag.
File Used: .github/review-bot-rules/full-internationalization.md (source)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Sources/FeatureFlags.swift`:
- Around line 112-114: `isCloudVMUIEnabled` currently depends on a fragile
positional lookup in `FeatureFlags.allFlags`, so the accessor can silently point
to the wrong flag if the array order changes. Update the `isCloudVMUIEnabled`
implementation to resolve the flag by its unique key/name instead of using
`allFlags[2]`, following the same approach you choose for
`isProUpgradeUIEnabled` and `isMobileConnectButtonEnabled` so the accessor stays
stable even if `allFlags` is reordered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4de73274-9d61-4716-8cba-6f91481dd7d7
📒 Files selected for processing (6)
Resources/Localizable.xcstringsSources/AppDelegate+NewWorkspaceContextMenu.swiftSources/AppDelegate.swiftSources/ContentView+AuthCommandPalette.swiftSources/FeatureFlags.swiftSources/Update/TitlebarCloudVMButton.swift
| var isCloudVMUIEnabled: Bool { | ||
| effectiveValue(for: Self.allFlags[2]) | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Positional index into allFlags is fragile.
isCloudVMUIEnabled (and the existing isProUpgradeUIEnabled/isMobileConnectButtonEnabled) rely on allFlags[N] matching declaration order in the array literal. Reordering allFlags (e.g., inserting a flag earlier in the list, or a future merge conflict) silently breaks the wrong flag's accessor without a compiler error.
Since this follows the existing pattern rather than introducing new risk, consider a follow-up to look up by key (e.g., a dictionary or first(where:)) instead of index, but not blocking for this PR.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Sources/FeatureFlags.swift` around lines 112 - 114, `isCloudVMUIEnabled`
currently depends on a fragile positional lookup in `FeatureFlags.allFlags`, so
the accessor can silently point to the wrong flag if the array order changes.
Update the `isCloudVMUIEnabled` implementation to resolve the flag by its unique
key/name instead of using `allFlags[2]`, following the same approach you choose
for `isProUpgradeUIEnabled` and `isMobileConnectButtonEnabled` so the accessor
stays stable even if `allFlags` is reordered.
Co-Authored-By: Claude <noreply@anthropic.com>
| static func commandPaletteCloudCommandContributions() -> [CommandPaletteCommandContribution] { | ||
| // Feature-gated: hide every Cloud VM command from the palette when the | ||
| // Cloud VM UI flag is off, matching the dropdown and shortcut gates. | ||
| guard CmuxFeatureFlags.shared.isCloudVMUIEnabled else { return [] } |
There was a problem hiding this comment.
This guard only runs when the command-palette command corpus is rebuilt. If the Cloud VM flag is turned off while the palette is already open, the existing search corpus can still contain the Cloud VM commands because the palette refresh fingerprint does not include isCloudVMUIEnabled. Those commands remain visible and selectable, then hit the new action guards and silently do nothing. Please include this flag in the palette invalidation path, or trigger a corpus rebuild when the feature flag changes.
# Conflicts: # .github/swift-file-length-budget.tsv
| static func commandPaletteCloudCommandContributions() -> [CommandPaletteCommandContribution] { | ||
| // Feature-gated: hide every Cloud VM command from the palette when the | ||
| // Cloud VM UI flag is off, matching the dropdown and shortcut gates. | ||
| guard CmuxFeatureFlags.shared.isCloudVMUIEnabled else { return [] } |
There was a problem hiding this comment.
This guard hides Cloud VM commands only when the palette corpus is rebuilt. If the palette is opened while Cloud VM is enabled, then the flag flips off, the cached corpus can keep the old Cloud VM entries because the palette fingerprint does not include isCloudVMUIEnabled. Those stale commands can remain visible and selectable until another path rebuilds the corpus. Please include this flag in the palette invalidation path, or force a corpus refresh when the feature flag changes.
# Conflicts: # .github/swift-file-length-budget.tsv # Resources/Localizable.xcstrings # Sources/AppDelegate+NewWorkspaceContextMenu.swift
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 04f43db. Configure here.
|
|
||
| @MainActor | ||
| static func showCloudVMMenu(anchorView: NSView, event: NSEvent) { | ||
| guard CmuxFeatureFlags.shared.isCloudVMUIEnabled else { return } |
There was a problem hiding this comment.
Cloud caret still opens VM
Medium Severity
With cloud-vm-ui-enabled-release off, the titlebar split button’s caret segment stays visible and can still call performCloudVMAction (including the no-anchor fallback). Cloud VM is only hidden from the new-workspace menu and palette, not this entrypoint.
Reviewed by Cursor Bugbot for commit 04f43db. Configure here.
| static func commandPaletteCloudCommandContributions() -> [CommandPaletteCommandContribution] { | ||
| // Feature-gated: hide every Cloud VM command from the palette when the | ||
| // Cloud VM UI flag is off, matching the dropdown and shortcut gates. | ||
| guard CmuxFeatureFlags.shared.isCloudVMUIEnabled else { return [] } |
There was a problem hiding this comment.
This guard only removes Cloud VM commands when the palette rebuilds its command list. If the palette was built while the flag was on, then isCloudVMUIEnabled flips off while that list is still live, the stale Cloud VM entries can still be selected. The handlers below call the shared Cloud VM actions, and those action methods do not check the flag, so selecting a stale entry can still launch Cloud VM while the UI flag is off. Please make the palette refresh when this flag changes, or fail closed in the registered handlers/shared action path.


Adds a PostHog-backed feature flag
cloud-vm-ui-enabled-releasethat hides every Cloud VM entrypoint, so the feature can be switched off from the dashboard without shipping a build. Requested: the Cloud VM items in the new-workspace dropdown (Open Cloud VM / Fork / Checkpoint / Restore / Advanced) need to be disable-able.Defaults follow the existing
pro-upgrade-uipattern: Release OFF (hidden until the flag is enabled), DEBUG ON (visible for dogfood).Gated at every surface (shared-behavior policy — one flag, all entrypoints):
AppDelegate+NewWorkspaceContextMenu— the dropdown's Cloud VM section is skipped when offTitlebarCloudVMButton.showCloudVMMenu— the caret's direct Cloud VM menu no-opsContentView+AuthCommandPalette.commandPaletteCloudCommandContributions— returns[], hiding all palette Cloud VM commandsperformCloudVMAction/performCurrentCloudVMCommand/performCloudVMRestoreCommand— the three shared actions returnfalse, so shortcuts and any stale entrypoint can't reach Cloud VM eitherLocalized flag title/description (en + ja).
scripts/lint-feature-flags.pypasses (the macOS flag reads PostHog directly; no web-registry change needed).Dogfood: in a Debug build the flag defaults ON. Open the Feature Flags window and toggle Cloud VM UI off — the dropdown Cloud VM items, palette commands, and shortcut all disappear; toggle on to restore.
🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Low Risk
UI-only gating with safe Release defaults; Cloud VM behavior is unchanged when the flag is on. Residual risk is non-gated paths (shortcuts, titlebar primary actions, RPC) still reaching Cloud VM while the flag is off.
Overview
Introduces PostHog flag
cloud-vm-ui-enabled-releasewithisCloudVMUIEnabled, using the same pattern as other release flags: off in Release until PostHog enables it, on in DEBUG for dogfood. Localized title/description are added for the Feature Flags UI (en/ja).When the flag is off, Cloud VM is hidden at the main entrypoints: the new-workspace menu skips the Cloud section, the command palette returns no Cloud VM commands, and
TitlebarCloudVMButton.showCloudVMMenuno-ops.makeCloudVMMenu()is unchanged, so callers that build menus without the show helpers could still surface actions if not gated elsewhere.Reviewed by Cursor Bugbot for commit 04f43db. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Adds a PostHog feature flag
cloud-vm-ui-enabled-releaseto hide Cloud VM UI entrypoints, defaulting OFF in Release and ON in Debug. Gating is applied only to UI entrypoints (dropdown, titlebar menu, command palette), not actions.New Features
isCloudVMUIEnabledand localized flag title/description (en/ja).Migration
cloud-vm-ui-enabled-releasein PostHog to show the UI in release builds.Written for commit 04f43db. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes
Chores