Skip to content

Add Inline VS Code serve-web settings (port, data dir, persistence, extra args) - #6900

Closed
austinywang wants to merge 13 commits into
mainfrom
issue-6645-add-settings-for-inline-vs-code
Closed

austinywang wants to merge 13 commits into
mainfrom
issue-6645-add-settings-for-inline-vs-code

Conversation

@austinywang

@austinywang austinywang commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #6645

What

Exposes the Inline VS Code serve-web launch details that were previously hard-coded in the launcher path, both in cmux.json and the Settings UI. Adds an inlineVSCode config block:

Setting Purpose
persistServeWebState Keep serve-web state (sign-in, Settings Sync) across launches. Default true; false uses a throwaway data dir so nothing persists.
port Pin the local serve-web port. Default 0 = random free port.
serverDataDir Choose the serve-web --server-data-dir. Empty = VS Code default; leading ~ expands.
extraArgs Advanced upstream serve-web flags, appended verbatim.
{
  "inlineVSCode": {
    "persistServeWebState": true,
    "port": 8123,
    "serverDataDir": "~/Library/Application Support/cmux/vscode-serve-web",
    "extraArgs": []
  }
}

Precedence

cmux.json (also written by the Settings UI) > environment variable (CMUX_INLINE_VSCODE_PORT / _SERVER_DATA_DIR / _PERSIST_STATE / _EXTRA_ARGS) > internal defaults.

Defaults preserve the historical behavior (random port, VS Code default data location, persistent state) — this change is purely additive.

Design notes

  • One launch path. The macOS launcher (VSCodeServeWebController) reads the live global cmux.json on each (re)start via a single shared path, so there is no second way to start VS Code. "Restart Inline VS Code" applies changes immediately.
  • Security unchanged. serve-web is always bound to 127.0.0.1 with a connection-token file; extraArgs are appended after the cmux-managed flags and documented as advanced/unsupported.
  • The arg builder, config/env/default resolver, and presence-aware cmux.json reader are pure and unit-tested (cmuxTests/InlineVSCodeServeWebOptionsTests.swift).

Surfaces touched

  • Launcher: Sources/App/InlineVSCodeServeWebOptions.swift (new) + TerminalDirectoryOpenSupport.swift (net-neutral wiring).
  • Settings: new InlineVSCodeCatalogSection (CmuxSettings) + InlineVSCodeSection UI (CmuxSettingsUI), section nav, curated search entries.
  • Docs/schema: cmux.schema.json, configuration docs page, web/messages/en.json + ja.json.
  • Localization: all new Swift strings added to Resources/Localizable.xcstrings (en + ja).

Localization audit

All new user-facing Swift strings use String(localized:) with matching en + ja entries in Localizable.xcstrings. Schema descriptions carry descriptionKeys with en + ja in the web message catalogs; the other 18 locales deep-merge-fall-back to en (existing i18n/request.ts behavior, matching markdown/canvas/workspaceGroups).

🤖 Generated with Claude Code


Summary by cubic

Adds configurable Inline VS Code serve-web options (port, server data dir, persistence, extra args) in cmux.json and the Settings UI. Fixes #6645 while keeping loopback + token invariants and cleaning up per‑launch temp dirs when non‑persistent.

  • New Features

    • New inlineVSCode config: persistServeWebState, port (0 = random), serverDataDir (supports ~), extraArgs.
    • Precedence: cmux.json > env (CMUX_INLINE_VSCODE_*) > defaults; read at each start; use “Restart Inline VS Code” to apply now.
    • UI: Settings > Inline VS Code; fields commit on blur or Return; section nav and curated search entries; fully localized.
    • Security: always binds 127.0.0.1 with a connection token; strips cmux-owned flags from extraArgs to prevent overrides.
  • Bug Fixes

    • inlineVSCode.port in cmux.json rejects fractional numbers instead of truncating (e.g., 1.9 ignored; 8123.0 accepted).

Written for commit 6726c4d. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added a new Inline VS Code settings section with options for session persistence, port selection, server data directory, and extra launch arguments.
    • Inline VS Code settings now appear in the app’s settings sidebar, search, and configuration examples.
    • Updated the VS Code launch flow to respect these settings, including support for persistent or per-launch data storage.
  • Bug Fixes

    • Improved handling of custom launch arguments so managed connection and host settings stay protected.

…xtra args)

Exposes the Inline VS Code `serve-web` launch details that were previously
hard-coded in the launcher path, both in `cmux.json` and the Settings UI, per
issue #6645. Adds an `inlineVSCode` config block:

- persistServeWebState — keep serve-web state across launches (default true;
  false uses a throwaway data dir so nothing persists)
- port — pin the local serve-web port (0 = random)
- serverDataDir — choose the serve-web --server-data-dir (~ expands)
- extraArgs — advanced upstream serve-web flags, appended verbatim

Resolution precedence is cmux.json (also written by the Settings UI) >
environment variable (CMUX_INLINE_VSCODE_*) > internal defaults. Defaults
preserve the historical behavior (random port, VS Code default data location),
so this is purely additive. serve-web stays bound to 127.0.0.1 with a
connection token regardless of extraArgs.

The macOS launcher reads the live global cmux.json on each (re)start through a
single shared path (VSCodeServeWebController), so there is no second way to
start VS Code; "Restart Inline VS Code" applies changes immediately.

Implementation:
- New InlineVSCodeServeWebSupport / resolver / presence-aware reader / pure
  serve-web argument builder (unit-tested).
- New CmuxSettings catalog section + CmuxSettingsUI "Inline VS Code" settings
  section, search index, and curated search entries.
- Schema, configuration docs, and en/ja message catalogs updated; all
  user-facing strings localized in Localizable.xcstrings (en + ja).

Fixes #6645

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jul 5, 2026 1:28am
cmux-staging Building Building Preview, Comment Jul 5, 2026 1:28am

@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new inlineVSCode settings namespace and settings UI for VS Code serve-web options, wires it into section navigation and documentation, and changes the launch path to resolve and sanitize serve-web arguments from config, environment, and defaults.

Changes

Inline VS Code serve-web settings

Layer / File(s) Summary
Settings surface and discoverability
Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/InlineVSCodeCatalogSection.swift, Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/SettingCatalog.swift, Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/SettingsSectionID.swift, Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry+Default.swift, Packages/macOS/CmuxSettingsUI/Tests/CmuxSettingsUITests/SettingsRowAnchorResolutionTests.swift, web/data/cmux.schema.json, web/messages/en.json, web/messages/ja.json, web/app/[locale]/docs/configuration/page.tsx
Adds the inlineVSCode settings block, the matching section metadata and curated search entries, the schema and help text entries, and the row-anchor expectations for the four new settings.
Inline VS Code settings section
Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/InlineVSCodeSection.swift, Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Scene/SettingsWindowScene.swift, Resources/Localizable.xcstrings
Adds the SwiftUI section for the four settings, including draft loading, commit handlers, parsing helpers, localized labels, and insertion into the settings window section stack.
Serve-web options and launch wiring
Sources/App/InlineVSCodeServeWebOptions.swift, Sources/App/TerminalDirectoryOpenSupport.swift, cmuxTests/InlineVSCodeServeWebOptionsTests.swift, cmux.xcodeproj/project.pbxproj
Introduces config/env/default resolution for serve-web, builds sanitized launch arguments, switches the launcher to use those arguments, and adds the test target and source-file project entries.

Sequence Diagram(s)

sequenceDiagram
  participant TerminalDirectoryOpenSupport
  participant InlineVSCodeServeWebConfigurationLoader
  participant InlineVSCodeServeWebOptionsResolver
  participant Process

  TerminalDirectoryOpenSupport->>InlineVSCodeServeWebConfigurationLoader: loadOptions()
  InlineVSCodeServeWebConfigurationLoader->>InlineVSCodeServeWebOptionsResolver: resolve inlineVSCode fields
  InlineVSCodeServeWebConfigurationLoader-->>TerminalDirectoryOpenSupport: serveWebArguments(...)
  TerminalDirectoryOpenSupport->>Process: assign Process.arguments
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • Issue 6595 in manaflow-ai/cmux: Adds inline VS Code settings and launch plumbing for serve-web, matching the issue's configuration scope.

Possibly related PRs

  • manaflow-ai/cmux#5012: Extends curated settings/search-anchor plumbing that the new inline VS Code entries plug into.
  • manaflow-ai/cmux#6196: Touches the same settings navigation/search-index path that this PR extends with new section and row metadata.

Suggested reviewers

  • lawrencecchen

Poem

🐇 I thumped a tune in the cmux glow,
With inlineVSCode settings set to go.
A port, a dir, and flags in tidy rows,
I hop to VS Code where the green carrot grows.
✨ Hop-hop!


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 errors, 2 warnings)

Check name Status Explanation Resolution
Cmux Swift File And Package Boundaries ❌ Error New 349-line Sources/App/InlineVSCodeServeWebOptions.swift keeps independent resolver/JSONC loader/temp-dir logic in the app target instead of a package boundary. Move the resolver/loader/options into CmuxSettings or a small new SwiftPM package, and keep Sources/App to launch wiring plus teardown.
Cmux Full Internationalization ❌ Error FAIL: The new inline VS Code search aliases are hard-coded English, and the new web/i18n strings exist only in en/ja despite 20 supported locales. Localize the new search aliases via translated resources, and add matching translated web message/catalog entries for every supported locale in web/i18n/routing.ts (and the app catalog locales touched by the PR).
Docstring Coverage ⚠️ Warning Docstring coverage is 30.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers the feature, precedence, and design, but it omits the required Summary, Testing, Demo Video, Review Trigger, and Checklist sections. Add the template sections with a brief summary, testing steps/results, demo video link or note, the review-trigger block, and a completed checklist.
✅ Passed checks (21 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR adds the requested Inline VS Code settings in cmux.json and the UI, keeps the same launcher path, and preserves the stated precedence.
Out of Scope Changes check ✅ Passed The listed changes all support the Inline VS Code settings feature; no unrelated edits are evident.
Cmux Swift Actor Isolation ✅ Passed New code keeps UI types on @MainActor and adds pure Sendable/value helpers; no new shared mutable Sendable or background-accessed UI store isolation issues were introduced.
Cmux Swift Blocking Runtime ✅ Passed The new Swift code is config/UI plumbing only; no added semaphores, sleeps, main-syncs, or locks appear in the changed paths.
Cmux Browser Automation Off-Main ✅ Passed PR only changes Inline VS Code settings/launcher/docs/UI; no browser.* automation commands, socketWorkerMethods, or mainActor routing changes are touched.
Cmux Expensive Synchronous Load ✅ Passed No agent-history loaders were added; inline VS Code config is parsed on VSCodeServeWebController.launchQueue, not on MainActor or an interactive history path.
Cmux Cache Substitution Correctness ✅ Passed The launcher reads cmux.json fresh on each restart; no changed path replaces an authoritative read with a cached/opportunistic value in a persistence/snapshot flow.
Cmux No Hacky Sleeps ✅ Passed No changed non-Swift runtime code adds sleeps, timers, polling, or delayed dispatch; the touched TSX file is static docs-only and contains no wait logic.
Cmux Algorithmic Complexity ✅ Passed The diff only adds linear processing over fixed settings collections (14 sections, 123 curated entries) and per-launch args; no nested scans over scalable user data.
Cmux Swift Concurrency ✅ Passed The only new async construct is a SwiftUI .task in InlineVSCodeSection; the launcher/config changes are synchronous and no new legacy Dispatch/Combine/completion patterns were added.
Cmux Swift @Concurrent ✅ Passed No changed Swift code adds invalid @concurrent/nonisolated-async patterns; the new .task work is UI-bound and the launcher/config helpers are synchronous.
Cmux Swiftpm Lockfiles ✅ Passed Only vendored submodule gitlinks changed (ghostty, vendor/bonsplit); no cmux-owned Package.swift, .gitignore, workflow, or pbxproj lockfile diffs were present.
Cmux Swift Logging ✅ Passed Reviewed the changed production Swift files; the diff adds no print/debugPrint/dump/NSLog/Logger or ad hoc stdout/file logging.
Cmux User-Facing Error Privacy ✅ Passed New inlineVSCode copy is settings/help text only; no new error, alert, recovery, or command-output strings expose sensitive details.
Cmux Swiftui State Layout ✅ Passed PASS: The new Inline VS Code section uses existing @Observable JSONValueModel state in @State and lifecycle .task setup; no new lazy-list store refs, GeometryReader layout measurement, or render-ti...
Cmux Architecture Rethink ✅ Passed Adds one shared Inline VS Code launch path with clear config ownership; no sleeps, polling, duplicate entrypoints, or split UI lifecycle were introduced.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed No new or materially changed standalone window code: the only WindowGroup is existing SettingsWindowScene with stable id cmux.settings, and this PR only adds a settings section.
Cmux Source Artifacts ✅ Passed All changed paths are intentional source/config/docs/localization/test assets; none are transient artifact paths banned by the rule.
Cmux No Test Or Debug Seam In Production Source ✅ Passed The new Inline VS Code source files add no test/debug seams; the only ForTesting helpers are preexisting in TerminalDirectoryOpenSupport.swift and are exercised by tests.
Cmux No Ambient Global State ✅ Passed New inlineVSCode code is instance-based and injected; no new file-scope funcs/vars or static-only namespaces were added, and only existing singletons were touched.
Title check ✅ Passed The title clearly names the new Inline VS Code serve-web settings and matches the main change set.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-6645-add-settings-for-inline-vs-code

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR exposes four previously hard-coded serve-web launch parameters (persistServeWebState, port, serverDataDir, extraArgs) through a new inlineVSCode block in cmux.json and a matching Settings UI section, fixing #6645. Precedence is cmux.json > env var fallback > internal defaults that match historical behavior.

  • New types (InlineVSCodeConfigFileValues, InlineVSCodeServeWebOptions, InlineVSCodeServeWebOptionsResolver, InlineVSCodeServeWebConfigurationLoader) are properly-constructed structs with injected dependencies, pure resolution logic, and thorough unit tests covering the reader, resolver, arg builder, and sanitizedExtraArgs sanitization.
  • The launcher (VSCodeServeWebController) now constructs an InlineVSCodeServeWebConfigurationLoader on the background launchQueue at each (re)start, so the latest config is always picked up without a secondary entry point.
  • Security invariants are preserved: loopback bind, connection-token file, and stripping of cmux-owned flags from extraArgs are enforced unconditionally; ephemeral directories created for persistServeWebState: false are cleaned up on process exit.

Confidence Score: 5/5

Safe to merge — the change is purely additive, defaults preserve historical behavior, and security invariants (loopback bind, connection-token) are enforced unconditionally in the arg builder.

All new logic is pure and comprehensively unit-tested. The loader runs on the background launchQueue, not the main actor. Ephemeral directory cleanup is idempotent. The sanitizedExtraArgs path correctly prevents any user-supplied flag from overriding the cmux-managed host, port, or connection-token arguments. Localization was audited: the app string catalog entries cover all 19 locales, and the schema description keys for non-en/ja locales use the established deep-merge-fallback-to-en pattern already present for canvas, fileEditor, and other sections.

No files require special attention.

Important Files Changed

Filename Overview
Sources/App/InlineVSCodeServeWebOptions.swift New value type holding resolved launch options; sanitizedExtraArgs correctly strips reserved flags in both --flag value and --flag=value forms; effectiveServerDataDir has clear invariant preventing ephemeral mode from ever silently falling back to persistent state.
Sources/App/InlineVSCodeServeWebOptionsResolver.swift Proper injectable struct (not a caseless enum namespace) with correct precedence: file > env > default; tilde expansion, port range clamping, boolean env parsing, and extra-args whitespace splitting are all correct.
Sources/App/InlineVSCodeServeWebConfigurationLoader.swift Well-structured loader with injectable dataReader/sanitizer; integerValue correctly rejects booleans, non-integral doubles, and non-finite values; makeEphemeralServerDataDir uses UUID-per-launch to ensure non-persistent mode never leaks across restarts.
Sources/App/TerminalDirectoryOpenSupport.swift Loader is constructed and called on the background launchQueue (not MainActor); ephemeralServerDataDir is captured by value in the termination handler; removeEphemeralServerDataDir is idempotent (try?) so the harmless double-call on the early-exit error path is safe.
Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/InlineVSCodeSection.swift @mainactor SwiftUI view; uses portLoaded/serverDataDirLoaded/extraArgsLoaded flags to prevent draft state resets on reappear; commits on focus-loss and onSubmit for all text fields; accessibility identifiers present.
cmuxTests/InlineVSCodeServeWebOptionsTests.swift 323-line test suite covers reader (JSONC tolerance, per-field type errors, fractional port rejection, presence-awareness), resolver precedence and env-var parsing, arg-builder ordering, and sanitization of both space- and equals-separated reserved flags.
web/data/cmux.schema.json Adds inlineVSCode block with correct types (boolean, integer with min/max, string, string-array), additionalProperties: false, and descriptionKey refs to en+ja web messages.
Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/InlineVSCodeCatalogSection.swift Straightforward SettingCatalogSection with four JSONKey typed fields matching the resolver defaults; default values are consistent across schema, resolver, and catalog.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[VSCodeServeWebController.launchServeWebProcess\non launchQueue background] --> B[InlineVSCodeServeWebConfigurationLoader\nreads live cmux.json]
    B --> C{inlineVSCode block\nin cmux.json?}
    C -- yes --> D[InlineVSCodeConfigFileValues\nwith presence-aware optionals]
    C -- no --> E[InlineVSCodeConfigFileValues.empty]
    D --> F[InlineVSCodeServeWebOptionsResolver.resolve]
    E --> F
    F --> G{Field present\nin file?}
    G -- yes --> H[Use file value]
    G -- no --> I{Env var set?}
    I -- yes --> J[Use env var value]
    I -- no --> K[Use internal default]
    H --> L[InlineVSCodeServeWebOptions]
    J --> L
    K --> L
    L --> M[serveWebArguments builds Process.arguments]
    M --> N[sanitizedExtraArgs strips reserved flags]
    N --> O[Process launched 127.0.0.1 + connection-token always enforced]
    O --> P{persistServeWebState?}
    P -- false, no serverDataDir --> Q[makeEphemeralServerDataDir UUID temp dir]
    P -- true or explicit dir --> R[persistent / explicit --server-data-dir]
    Q --> S[Process terminates]
    R --> S
    S --> T[removeEphemeralServerDataDir cleans up UUID temp dir]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[VSCodeServeWebController.launchServeWebProcess\non launchQueue background] --> B[InlineVSCodeServeWebConfigurationLoader\nreads live cmux.json]
    B --> C{inlineVSCode block\nin cmux.json?}
    C -- yes --> D[InlineVSCodeConfigFileValues\nwith presence-aware optionals]
    C -- no --> E[InlineVSCodeConfigFileValues.empty]
    D --> F[InlineVSCodeServeWebOptionsResolver.resolve]
    E --> F
    F --> G{Field present\nin file?}
    G -- yes --> H[Use file value]
    G -- no --> I{Env var set?}
    I -- yes --> J[Use env var value]
    I -- no --> K[Use internal default]
    H --> L[InlineVSCodeServeWebOptions]
    J --> L
    K --> L
    L --> M[serveWebArguments builds Process.arguments]
    M --> N[sanitizedExtraArgs strips reserved flags]
    N --> O[Process launched 127.0.0.1 + connection-token always enforced]
    O --> P{persistServeWebState?}
    P -- false, no serverDataDir --> Q[makeEphemeralServerDataDir UUID temp dir]
    P -- true or explicit dir --> R[persistent / explicit --server-data-dir]
    Q --> S[Process terminates]
    R --> S
    S --> T[removeEphemeralServerDataDir cleans up UUID temp dir]
Loading

Reviews (11): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

cmux and others added 4 commits June 26, 2026 04:35
…eepy Mode sections

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…reserved extraArgs

Resolves the autoreview + Greptile findings on the Inline VS Code serve-web
options:

- Replace the two caseless-enum namespaces with constructor-injected structs
  (cmux no-ambient-global-state policy): InlineVSCodeServeWebOptionsResolver now
  takes environment + home directory; a new InlineVSCodeServeWebConfigurationLoader
  owns the cmux.json read + ephemeral-dir factory; the serve-web argument builder
  moves onto InlineVSCodeServeWebOptions.
- Non-persistent mode never silently reverts to persistent storage: the ephemeral
  data directory is a unique per-launch temp path that serve-web creates if
  missing, so a filesystem hiccup can't turn "don't persist" into persisted
  sign-in/state.
- extraArgs can no longer override cmux's loopback/token invariants: cmux-owned
  flags (--host, --port, --connection-token[-file], --server-data-dir,
  --without-connection-token, --accept-server-license-terms) are stripped before
  the user flags are appended, in both the --flag value and --flag=value forms.

Docs/schema/strings updated to match (extraArgs no longer "verbatim"); tests
cover the sanitizer and the non-persistent guarantee.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…, safe ephemeral dirs

- Settings UI: port and server data directory drafts now commit on focus loss
  (and Return), not only on Return, so edits aren't silently dropped when the
  user tabs/clicks away or closes the window. Unified the three fields under one
  @focusstate and commit the field that lost focus.
- cmux.json reader is now tolerant per-field: each inlineVSCode key is decoded
  independently (via JSONSerialization with strict number/boolean typing), so one
  malformed value (e.g. a quoted "port") no longer discards valid sibling fields
  — a typo can't drop a valid persistServeWebState:false privacy choice.
- Ephemeral serve-web data dirs no longer wipe the shared temp parent. Each
  non-persistent launch gets a unique UUID dir and never deletes siblings, so one
  cmux instance can't recursively remove a directory another instance's running
  serve-web is using. Freshness (non-persistence) comes from the per-launch UUID.

Tests updated: per-field tolerance, number/boolean strictness, and ephemeral-dir
uniqueness/non-deletion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n teardown

The non-persistent ephemeral data directory is now tied to the launched
serve-web process lifecycle: the unique per-launch dir is captured and removed
in the process termination handler (covering normal exit, stop(), and restart)
and on the launch-failure path. Only that specific per-launch UUID directory is
removed, so a sibling cmux instance's running serve-web directory is never
touched. This bounds disk usage for persistServeWebState: false instead of
leaking a directory under the temp root on every restart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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 `@cmuxTests/InlineVSCodeServeWebOptionsTests.swift`:
- Around line 219-225: Several tests in InlineVSCodeServeWebOptionsTests still
use try! with `#require`, which bypasses Swift Testing’s structured failure
reporting. Update the affected `@Test` functions to be throws tests and replace
each try! `#require` with try `#require` in the assertions around args(),
firstIndex(of:), and the related result checks so failures are reported through
Swift Testing instead of trapping.

In
`@Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry`+Default.swift:
- Around line 181-209: The Inline VS Code aliases are hard-coded English in
CuratedSettingEntry+Default, so non-English locales miss the extra search terms.
Move the alias strings for the .inlineVSCode entries (including persist-state,
port, server-data-dir, and extra-args) into localized resources, and wire them
up through the existing localization pattern used by the section entries. In the
same change, update the .inlineVSCode searchKeywords branch in SettingsSectionID
so it returns localized keywords/aliases consistently with the localized title
and symbol text. Keep the new behavior aligned with the other localized settings
cases in CuratedSettingEntry and SettingsSectionID.
🪄 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: 2760752e-0dac-41d8-bf8f-06fe9f71ca81

📥 Commits

Reviewing files that changed from the base of the PR and between 6d6c701 and de81da1.

⛔ Files ignored due to path filters (1)
  • .github/swift-file-length-budget.tsv is excluded by !**/*.tsv
📒 Files selected for processing (16)
  • Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/InlineVSCodeCatalogSection.swift
  • Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/SettingCatalog.swift
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry+Default.swift
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/SettingsSectionID.swift
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Scene/SettingsWindowScene.swift
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/InlineVSCodeSection.swift
  • Packages/macOS/CmuxSettingsUI/Tests/CmuxSettingsUITests/SettingsRowAnchorResolutionTests.swift
  • Resources/Localizable.xcstrings
  • Sources/App/InlineVSCodeServeWebOptions.swift
  • Sources/App/TerminalDirectoryOpenSupport.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/InlineVSCodeServeWebOptionsTests.swift
  • web/app/[locale]/docs/configuration/page.tsx
  • web/data/cmux.schema.json
  • web/messages/en.json
  • web/messages/ja.json

Comment thread cmuxTests/InlineVSCodeServeWebOptionsTests.swift Outdated
cmux and others added 3 commits June 26, 2026 05:16
A fractional inlineVSCode.port (e.g. 1.9) is now treated as absent and falls
back to the default random port, matching the schema (type: integer), the
Settings UI parser, and CmuxSettings' Int.decodeFromJSON — rather than silently
truncating to a different bound port. Integral floats (8123.0) are still accepted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…per-file

Per the cmux file/API discipline rule for new Swift code, split the four
top-level types out of InlineVSCodeServeWebOptions.swift into their own files:
InlineVSCodeServeWebOptions, InlineVSCodeConfigFileValues,
InlineVSCodeServeWebOptionsResolver, and InlineVSCodeServeWebConfigurationLoader.
Each keeps only its tightly-bound private helpers. Wired the three new files into
the cmux target in project.pbxproj.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e helpers

- Add Swift-DocC comments to the new public package symbols (InlineVSCodeSection
  init/body, InlineVSCodeCatalogSection init).
- Replace the nested focus enum with three @focusstate bools so the section file
  holds a single major type (file-organization policy).
- Make the section's pure draft-parsing helpers (parsePort/portText/
  parseExtraArgs) instance methods on the owning view instead of static, clearing
  the static-as-namespace policy flag.

No behavior change. cmux-policy-check now reports no findings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@austinywang

Copy link
Copy Markdown
Contributor Author

Review iteration summary

Drove this through several automated-review rounds (Codex/autoreview + Greptile + cmux-policy). Fixes pushed:

  • Architecture (Greptile + cmux-policy): replaced the caseless-enum namespaces with constructor-injected structs and split the four serve-web helper types into one-file-per-type; moved the arg builder onto the options type; settings-section parsing helpers are now instance methods; added Swift-DocC to new public package symbols.
  • Privacy (autoreview): non-persistent mode now always uses a unique throwaway data dir and never silently reverts to persistent storage; that dir is removed on process teardown (no leak, and never deletes a sibling instance's dir).
  • Security (autoreview): extraArgs can no longer override cmux's managed --host/--port/connection-token/--server-data-dir flags (stripped in both --flag value and --flag=value forms).
  • Robustness (autoreview): cmux.json is decoded per-field, so one bad value can't drop a valid persistServeWebState:false; fractional ports are rejected (not truncated); Settings text fields commit on focus-loss, not only Return.

One autoreview finding consciously rejected as a false positive: "add inlineVSCode schemaDescriptions to every locale catalog." web/i18n/request.ts deep-merges the English catalog as the base for every non-default locale (deepMergeMessages(defaultMessages, localeMessages)), so /fr, /de, … fall back to the English text rather than hitting a missing-message error. This matches the already-shipping schemaDescriptions.canvas and schemaDescriptions.fileEditor, which are also en-only (absent in fr/de/es/zh-CN). Adding English placeholders to the other 18 catalogs would break that convention and mislead translators, so inlineVSCode stays en+ja like the rest of the docs schema descriptions.

@blacksmith-sh

This comment has been minimized.

…gs-for-inline-vs-code

# Conflicts:
#	.github/swift-file-length-budget.tsv
#	Packages/macOS/CmuxSettingsUI/Tests/CmuxSettingsUITests/SettingsRowAnchorResolutionTests.swift
#	cmux.xcodeproj/project.pbxproj
Comment on lines 218778 to +218779
}
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing locale translations for 18 supported app locales

The catalog supports 20 locales (ar, bs, da, de, en, es, fr, it, ja, ko, nb, pl, pt-BR, ru, th, tr, uk, zh-Hans, zh-Hant), but every new entry added by this PR only provides en and ja. The 11 new string keys — settings.section.inlineVSCode, settings.inlineVSCode.persistState, settings.inlineVSCode.port, settings.inlineVSCode.port.subtitle, settings.inlineVSCode.port.placeholder, settings.inlineVSCode.serverDataDir, settings.inlineVSCode.serverDataDir.subtitle, settings.inlineVSCode.serverDataDir.placeholder, settings.inlineVSCode.extraArgs, settings.inlineVSCode.extraArgs.subtitle, and settings.inlineVSCode.note — will fall back to English for all users on ar, bs, da, de, es, fr, it, ko, nb, pl, pt-BR, ru, th, tr, uk, zh-Hans, and zh-Hant. Every other manually-translated entry in the catalog ships translated copies for all 20 locales.

Rule Used: Flag production user-facing text that is not fully... (source)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a92756d: expanded the inline VS Code app string catalog entries, including the newly localized search alias keys, to all 19 app locales (ar, bs, da, de, en, es, fr, it, ja, ko, nb, pl, pt-BR, ru, th, tr, uk, zh-Hans, zh-Hant). Verified with python3 -m json.tool and a locale-coverage script.

— Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on current head 6726c4d: the Inline VS Code settings and search-alias xcstrings entries are present for all supported app locales. Local JSON coverage check reports inline_vs_code_keys=13, locales=19, missing=0. This was fixed in a92756d and preserved through the latest main merge.

— Claude Code

@lawrencecchen lawrencecchen added the stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening. label Sep 23, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in cmux backlog Sep 23, 2026

This branch was successfully deployed

1 active deployment
Preview – cmux — 6726c4d5 Deployed Jul 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add settings for Inline VS Code serve-web launches

3 participants