Commit graph

111 commits

Author SHA1 Message Date
Austin Wang
c5577dd495
Fix flaky CLI socket listener recovery (#952) (#954)
* Harden socket listener health checks and path handling

* Make socket health probe non-blocking

* Address PR feedback for issue 952 recovery guard

* Run issue 952 regression guard without pytest dependency

* Harden socket probe timing and health telemetry

* Handle missing git in issue 952 regression guard

* Address remaining PR 954 review fixes
2026-03-05 19:52:59 -08:00
Lawrence Chen
0fb2b414b0
"Claude PR Assistant workflow" (#965) 2026-03-05 17:19:02 -08:00
Lawrence Chen
4af2e6be30
Remove hourly cron and skipped job from nightly workflow (#817)
Every merge to main already triggers a nightly build, making the hourly
cron redundant. The skipped job was cosmetic (just echoed a message) and
caused confusing red X statuses when cancel-in-progress kicked in.
2026-03-03 15:42:09 -08:00
Lawrence Chen
37dc43a6de
Fix TCC dialog, trim black frames, add macos-26 runner option (#784)
- Grant kTCCServiceScreenCapture in system-level TCC database (sudo)
  and pre-date ScreenCaptureApprovals.plist to suppress Sequoia's
  private window picker dialog
- Move recording start to right before xcodebuild test (skip build time)
- Trim leading black frames from video using ffmpeg blackdetect
- Add runner input: macos-15 (Sequoia) or macos-26 (Tahoe)
2026-03-02 23:14:27 -08:00
Lawrence Chen
d77299c220
Clean up E2E ffmpeg device detection (#782)
* Install ffmpeg via brew for screen recording

macos-15 GitHub runners don't have ffmpeg pre-installed.

* Clean up ffmpeg device detection and add fallback

Suppress noisy device listing errors, add fallback to index 1 if
detected index fails, upgrade warning to error on total failure.
2026-03-02 22:55:03 -08:00
Lawrence Chen
63e7cc7faa
Install ffmpeg via brew for screen recording (#781)
macos-15 GitHub runners don't have ffmpeg pre-installed.
2026-03-02 22:45:22 -08:00
Lawrence Chen
3cb101f1c8
Switch screen recording from screencapture to ffmpeg AVFoundation (#780)
screencapture -v produces a 0-second file on GitHub Actions M-series
runners (IOServiceMatchingfailed for AppleM2ScalerParavirtDriver).
ffmpeg with avfoundation input handles virtual displays correctly.
2026-03-02 22:36:07 -08:00
Lawrence Chen
cd0c3cfa93
Add E2E test workflow with video recording (#778)
* Add E2E test workflow with video recording and issue posting

New workflow_dispatch workflow (test-e2e.yml) that runs XCUITests on
GitHub-hosted macos-15 runners, records the virtual display, uploads the
video as an artifact, and posts results as an issue on cmux-dev-artifacts.

Includes scripts/run-e2e.sh for convenient triggering from the terminal.

* Print issue URL in workflow annotation and run-e2e.sh output

- Capture gh issue create output URL, print as ::notice annotation
- Search issues by run ID instead of grabbing most recent
2026-03-02 22:16:38 -08:00
Lawrence Chen
fe3e2d06d9
Trigger nightly on push to main, switch to GitHub macos-15 runner (#779)
Build immediately on merge instead of waiting for the hourly cron.
Concurrency group cancels in-progress builds when new commits land.
Depot macos runner replaced with GitHub macos-15 (similar perf, simpler).
2026-03-02 22:13:03 -08:00
Lawrence Chen
225588ccfc
Split CI: GitHub runners for tests, Depot for perf regression (#773)
* Split CI: GitHub runners for tests, Depot for perf regression

Unit/UI tests move to macos-15 (no queue wait, fast enough for test
suites). Typing-lag regression stays on Depot in a new tests-depot job
(needs stronger hardware). No duplicated test work between the two.

* Fix Xcode selection: add pipefail guard, use sort|tail for consistency

Address review comments:
- tests job: add || true to ls pipeline so fallback works under pipefail
- tests-depot job: use sort | tail -n 1 instead of head -n 1

* Move XCUITests from GitHub runner to Depot

tests (macos-15) now runs unit tests only. tests-depot (Depot) runs
UI tests and the typing-lag regression, reusing the same build.
2026-03-02 21:31:39 -08:00
Lawrence Chen
682a57d7db
Add workspace-churn typing lag regression and fix (#767)
* Add workspace-churn typing lag regression and fix

* Fix CI build for debug stress split calls

* Stabilize lag regression gate for low baseline latency
2026-03-02 19:06:50 -08:00
Lawrence Chen
b3f6f8cfd7
Add macOS compatibility CI: unit tests + smoke test on macos-14/15 (#769)
* Add macOS compatibility CI: unit tests + smoke test on macos-14/15

New workflow runs on GitHub-hosted macos-14 and macos-15 runners
(matrix strategy). Each run: unit tests via cmux-unit scheme, then
a smoke test that builds the app, launches it, sends a command via
the socket, and verifies it stays alive for 15 seconds.

* Select latest Xcode on runner (fix macos-14 Swift tools version)

macos-14 runners default to Xcode 15.4, but sentry-cocoa needs
Swift tools version 6.0 (Xcode 16+). Pick the latest Xcode_*.app
instead of the default symlink.

* Launch app binary directly in smoke test for better CI compatibility

Using `open` can fail silently on CI runners. Launch the binary
directly with env vars set, capture stdout/stderr, and add process
health checks with diagnostic output (debug log tail, crash reports)
on failure.
2026-03-02 18:50:27 -08:00
Lawrence Chen
58bb9bc655
Migrate all workflows from self-hosted Mac Mini to Depot runners (#730)
* Migrate all workflows from self-hosted Mac Mini to Depot runners

Move CI, nightly, and release workflows to depot-macos-latest. Replace
zig GhosttyKit builds with pre-built xcframework downloads. Add virtual
display for CI UI tests. Remove concurrency groups (ephemeral VMs don't
need them).

* Add per-test timeout to CI UI tests to prevent hangs on Depot

SidebarResizeUITests hangs on headless Depot runners due to mouse drag
simulation issues. Adding -maximum-test-execution-time-allowance 120
(matching test-depot.yml) ensures individual tests timeout after 2 min
instead of blocking the entire run.

* Skip SidebarResizeUITests in CI on Depot runners

Mouse drag simulation hangs on headless Depot runners even with a
virtual display. The per-test timeout doesn't prevent the hang either.
Skip this test class in CI; it still runs fine on local machines.

* Handle XCTExpectFailure in CI UI tests (exit 65 with 0 unexpected)

xcodebuild exits 65 even when all failures use XCTExpectFailure. Add
the same expected-failure handling from the unit test step so browser
focus tests (which are expected to fail on headless runners) don't
break CI.
2026-03-01 19:06:45 -08:00
Lawrence Chen
1fcbdc9417
Split self-hosted concurrency groups per workflow (#729)
* Add virtual display for headless Depot runners

Depot macOS runners have no physical display, causing XCUITests to fail
with "Failed to activate application (current state: Running Background)".
This adds a small ObjC tool that creates a virtual display using the
private CGVirtualDisplay API before tests run.

* Split self-hosted concurrency groups per workflow

CI, nightly, and release all shared `self-hosted-build`, so the hourly
nightly cancelled in-progress CI runs. Now each workflow has its own
group (self-hosted-ci, self-hosted-nightly, self-hosted-release).

CI also gets cancel-in-progress: true so rapid pushes cancel stale runs.
2026-03-01 16:34:38 -08:00
Lawrence Chen
2b66a2f5c1
Add virtual display for headless Depot runners (#721)
Depot macOS runners have no physical display, causing XCUITests to fail
with "Failed to activate application (current state: Running Background)".
This adds a small ObjC tool that creates a virtual display using the
private CGVirtualDisplay API before tests run.
2026-03-01 04:25:36 -08:00
Lawrence Chen
1b160dc5ca
Add display diagnostics, test filter, and per-test timeout to Depot workflow (#720)
- Display diagnostics step to debug headless display issues
- test_filter input to run specific XCUITest classes
- test_timeout input (default 120s) to prevent test hangs
2026-03-01 04:04:32 -08:00
Lawrence Chen
e295f384fc
Run all XCUITests in CI and add skip_unit_tests to Depot workflow (#718)
* Run all XCUITests in CI instead of just UpdatePillUITests

Removes the -only-testing:cmuxUITests/UpdatePillUITests filter so
new test classes are picked up automatically. No more workflow edits
needed when adding tests.

* Add skip_unit_tests input to test-depot workflow
2026-03-01 02:58:27 -08:00
Austin Wang
dba1e232d3
Fix SwiftPM binary artifact cache collision in CI (#716)
After rm -rf of the SPM cache dir, recreate it as an empty directory
so binary target downloads (e.g. Sentry.xcframework.zip) don't hit
"already exists in file system" errors from stale artifacts on the
self-hosted runner.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:18:21 -08:00
Lawrence Chen
9d00ae9ab0
Move Build GhosttyKit to Depot to avoid self-hosted concurrency cancellations (#713)
build-ghosttykit shared the self-hosted-build concurrency group with
CI tests, causing one to get cancelled when both trigger on the same
push. Most runs are no-ops (xcframework already exists), so Depot is
a good fit. Eliminates the red X on pushes to main.
2026-02-28 22:46:15 -08:00
Lawrence Chen
b6efd73d57
Switch CI and Build GhosttyKit to Depot macOS runners (#710)
* Switch CI and Build GhosttyKit to Depot macOS runners

Moves the tests job (unit + UI) and build-ghosttykit job from
self-hosted to depot-macos-latest so CI doesn't block the local
Mac Mini. CI tests now download the pre-built xcframework from
the ghostty releases instead of building with zig. Nightly and
release workflows stay on self-hosted for signing/notarization.

* Add on-demand Depot test workflow, revert CI changes

Adds test-depot.yml (workflow_dispatch) for running tests on Depot
macOS runners during local dev without tying up the Mac Mini.
Reverts ci.yml and build-ghosttykit.yml back to self-hosted.
2026-02-28 22:32:51 -08:00
Lawrence Chen
f451766d12
Add cmux <path> to open directories and Homebrew binary stanza (#705)
* Add `cmux <path>` to open directories and Homebrew binary stanza

CLI: `cmux .` or `cmux /path/to/dir` opens a new workspace at the
given directory. If the app isn't running, it launches first and waits
for the socket. Also adds `--cwd` flag to `new-workspace`.

Server: `workspace.create` now accepts an optional `cwd` parameter,
passed through to `TabManager.addWorkspace(workingDirectory:)`.

Homebrew: adds `binary` stanza to the cask so `cmux` CLI is globally
available after `brew install --cask cmux`. Updated both the cask file,
the CI workflow template, and the manual release script so automated
version bumps preserve the stanza.

* Address review: validate cwd type, fix socket detection, propagate errors

- looksLikePath now also matches paths containing `/` (e.g. `foo/bar`)
- openPath uses socket connection attempt instead of fileExists to detect
  whether the app is running (Unix sockets may not appear on filesystem)
- launchApp/activateApp now throw instead of swallowing errors with try?
- Server validates that cwd param is a string, returns invalid_params error
  if wrong type is passed
2026-02-28 20:25:41 -08:00
Lawrence Chen
7916b2d418
Fix Xcode Cloud UI tests by running TestAction in Debug (#672)
* Set cmux TestAction to Debug for UI tests

* Broaden XCTest detection for debug launch gate

* Fix AutomationSocketUITests launch hang in CI

* Stabilize CI Swift package resolution for test jobs

* Stabilize Xcode Cloud UI test focus and socket handling

* Add Xcode Cloud pre-xcodebuild submodule bootstrap

* Harden Xcode Cloud bonsplit bootstrap fallback
2026-02-28 01:48:49 -08:00
Lawrence Chen
be89812bea
Harden CI unit tests against SwiftPM artifact flakes (#682) 2026-02-28 00:38:46 -08:00
Lawrence Chen
ae3bcd7eea
Set up full test suite in CI and Xcode Cloud (#447)
* Set up full test suite in CI and Xcode Cloud

Add build-ghosttykit.yml workflow to pre-build and publish
GhosttyKit.xcframework as a GitHub release on manaflow-ai/ghostty,
keyed by submodule SHA. Add ci_scripts/ci_post_clone.sh for Xcode
Cloud to download the pre-built xcframework with retry logic. Create
cmux-ci scheme that runs both cmuxTests and cmuxUITests. Switch the
CI tests job from running a single UI test class to the full suite.

* Run unit tests + single UI test class on self-hosted runner

The self-hosted runner can't launch the full app for UI tests (no GUI
session), so run all unit tests via cmux-unit scheme and keep the
original UpdatePillUITests as a smoke test. Full UI test suite runs
on Xcode Cloud which has proper macOS GUI support.

* Handle expected test failures in unit tests step

xcodebuild returns exit code 65 even for expected failures
(XCTExpectFailure). Parse the summary line to only fail the CI job
when there are unexpected failures.
2026-02-27 04:18:26 -08:00
Lawrence Chen
c7eec9fbb5
Pin create-dmg version in signed build workflows (#401)
* Pin create-dmg version in release workflows

* Bump pinned create-dmg to 8.0.0
2026-02-25 19:30:10 -08:00
Lawrence Chen
4d2fd30143 Fix UI test hang: bypass launch guard for XCUITest apps
XCUITest launches the app as a separate process that doesn't inherit
XCTest env vars (XCTestConfigurationFilePath, etc.), so
isRunningUnderXCTest() returns false. The app then hits
shouldBlockUntaggedDebugLaunch() and exits with code 64, causing the
test runner to hang waiting for the app to launch.

Fix: detect CMUX_UI_TEST_* env vars set via XCUIApplication.launchEnvironment
and skip the launch guard. Also revert the failed CMUX_TAG ci.yml workaround.
2026-02-24 23:28:34 -08:00
Lawrence Chen
77a59b5743 Fix UI test hang: set CMUX_TAG for debug launch guard
Debug builds refuse to launch without CMUX_TAG to prevent accidental
untagged launches. XCUITest launches the app as a separate process
without XCTest env vars, so the app's isRunningUnderXCTest() check
fails and the app calls exit(64). The test runner then waits forever
for the app to report back. Set CMUX_TAG=ci in the CI env.
2026-02-24 23:19:04 -08:00
Lawrence Chen
79266ee03b Fix UI test hang: remove ad-hoc signature before test launch
The Mac Mini runner has no dev certificates, so xcodebuild produces
an ad-hoc signed app. Gatekeeper rejects it, causing XCUITest to hang
forever at app.launch(). Split build and test phases, strip the ad-hoc
signature between them so the app can launch.
2026-02-24 23:15:11 -08:00
Lawrence Chen
fc3e3a4d7d Pin all GitHub Actions to full commit SHAs
Org policy now requires actions pinned to immutable SHAs instead of
mutable version tags. Pin actions/checkout, actions/github-script,
softprops/action-gh-release, and oven-sh/setup-bun across all workflows.
2026-02-24 22:21:40 -08:00
Lawrence Chen
53ef6a5f7d
Upgrade Sentry: tracing, breadcrumbs, dSYM upload (#366)
* Upgrade Sentry: tracing, breadcrumbs, dSYM upload

- Enhanced Sentry SDK init with performance tracing (10% sample),
  explicit app hang timeout, stack trace attachment, and HTTP
  failure capture
- Added breadcrumbs for key user actions: workspace switch/create/close,
  split creation, command palette open/close, app focus — these give
  context to hang/crash reports
- Added dSYM upload step to nightly and release CI workflows so hang
  stacks are fully symbolicated (requires SENTRY_AUTH_TOKEN secret)
- Created SentryHelper.swift with lightweight breadcrumb helper

Closes https://github.com/manaflow-ai/cmux/issues/365

* Remove command palette breadcrumbs

Not useful for hang diagnosis — keep only workspace/tab/split/focus
breadcrumbs that correlate with heavy operations.
2026-02-23 17:11:01 -08:00
Lawrence Chen
f3fc880468 Guard self-hosted CI from fork pull requests 2026-02-23 14:58:17 -08:00
Lawrence Chen
5ac633445f Fail partial release assets and short-circuit reruns 2026-02-21 15:27:24 -08:00
Lawrence Chen
cf1cd096b1 Make release asset guard idempotent 2026-02-21 15:19:10 -08:00
Lawrence Chen
6a0b708ea1
Merge pull request #269 from manaflow-ai/feat-release-immutable-guards
release: enforce immutable signed assets per tag
2026-02-21 04:14:27 -08:00
Lawrence Chen
a5b1039fbc release: block accidental overwrite of signed assets 2026-02-21 04:07:00 -08:00
Lawrence Chen
5e1d458505 nightly: publish immutable DMG assets for appcast 2026-02-21 04:02:51 -08:00
Lawrence Chen
5502bec29a
Fix homebrew cask template: homepage → cmux.dev, min macOS → Sonoma (#162) 2026-02-20 13:45:20 -08:00
Lawrence Chen
305d22e4e6
Fix same-day nightly update detection in Sparkle (#173)
* Fix nightly build version monotonicity for Sparkle updates

* Include run attempt in nightly build version
2026-02-20 13:43:51 -08:00
Lawrence Chen
6f9146e895
Run nightly workflow hourly instead of daily (#170)
The decide job already skips when main HEAD matches the nightly tag,
so this only builds when there are actual changes. Hourly means users
get nightly updates within an hour of merging to main.
2026-02-20 04:40:14 -08:00
Lawrence Chen
ec9b80f389
Add nightly-specific app icon with purple NIGHTLY banner (#166)
Follows the same pattern as AppIcon-Debug (orange DEV banner) but with
a purple banner and "NIGHTLY" text. The nightly CI workflow now passes
ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon-Nightly to xcodebuild so
the nightly app gets its own distinct icon.

Includes scripts/generate_nightly_icon.py for regenerating the icons
from the production AppIcon source files.
2026-02-20 04:10:32 -08:00
Lawrence Chen
707be44aaf
Separate cmux NIGHTLY as standalone app with its own bundle ID (#164)
The nightly build is now a distinct app called "cmux NIGHTLY" with
bundle ID com.cmuxterm.app.nightly, allowing side-by-side installation
with the stable release. The nightly appcast URL is baked into the
app's Info.plist by CI, so no in-app channel switching is needed.

- Nightly workflow: rename app to "cmux NIGHTLY", set bundle ID to
  com.cmuxterm.app.nightly, hardcode nightly Sparkle feed URL, publish
  DMG as cmux-nightly-macos.dmg
- Remove "Receive Nightly Builds" toggle from settings
- Remove UpdateChannelSettings enum and simplify feed URL resolution
  to just use SUFeedURL from Info.plist
- Remove UpdateChannelSettingsTests (no longer applicable)
2026-02-20 03:54:07 -08:00
Lawrence Chen
fc1de08561
Fix homebrew SHA mismatch race condition (#111)
Root cause: update-homebrew.yml triggered on release:published, which fires
before softprops/action-gh-release finishes uploading assets. The workflow
downloaded a 404 page instead of the DMG and committed its SHA.

Fix:
- Change trigger from release:published to workflow_run (fires after the
  release workflow completes, guaranteeing assets are uploaded)
- Add download validation with retries and file size checks
- Add SHA verification step before committing to the cask
- Add homebrew cask update to build-sign-upload.sh for local releases
- Add regression test (tests/test_homebrew_sha.sh)
- Update /release and /release-local skills with homebrew verification steps

Fixes #110
2026-02-19 17:44:00 -08:00
Lawrence Chen
d08f28d770
Merge pull request #83 from manaflow-ai/perf/portal-hosting-selected-mount
Reduce terminal input latency via portal hosting + selected-only workspace mounting
2026-02-18 22:31:45 -08:00
Lawrence Chen
699db2a9ed
Fix menubar lag on M1 Macs by using universal xcframework target (#93)
Remove -Dxcframework-target=native from CI and release workflows,
defaulting to universal (matching upstream ghostty). The native target
produces a macos-arm64 xcframework slice that causes Xcode to link the
final binary differently (~70KB more __text), resulting in menubar and
right-click lag on M1 Max. The arm64 static libraries are byte-for-byte
identical between native and universal builds - the difference is purely
in how Xcode resolves the xcframework slice.
2026-02-18 22:09:13 -08:00
Lawrence Chen
442eb1f01d Rename test targets to cmuxTests and cmuxUITests 2026-02-18 21:19:56 -08:00
Lawrence Chen
915e34bd38
Revert xcframework-target removal that broke CI (#86) (#90)
The -Dxcframework-target flag controls platform slices (native=macOS
only, universal=macOS+iOS), not CPU microarchitecture. Removing it
caused CI to attempt iOS builds which fail due to missing Metal
iOS toolchain on the runner.
2026-02-18 20:37:59 -08:00
Austin Wang
65ac29d827
Fix zsh git branch refresh race after cwd change (#71)
* Fix zsh git branch refresh race after cwd change

* Clarify intentional duplicate cwd check in git refresh path

* Add Metal Toolchain download step to CI and release workflows

Fixes build failure when compiling Metal shaders for iOS xcframework
targets — the self-hosted runner needs `xcodebuild -downloadComponent
MetalToolchain` installed before `xcrun metal` can run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:36:27 -08:00
Lawrence Chen
d24030db58
Use universal xcframework target instead of native (#86)
The self-hosted runner (M4 Mac Mini) was building GhosttyKit with
-Dxcframework-target=native, producing M4-tuned binaries. This caused
menubar and right-click lag on M1 machines. Dropping the flag defaults
to universal, which works well across all Apple Silicon chips.
2026-02-18 20:21:34 -08:00
Lawrence Chen
a2457f1d5e Fix menubar lag in production builds caused by hardened runtime
Hardened runtime's library validation was verifying every dylib on load,
causing noticeable UI lag. Add entitlements file with
disable-library-validation to fix while keeping notarization support.
2026-02-16 03:26:33 -08:00
Lawrence Chen
5e62a9eca7 Fix nightly: delete existing CMUXCommit plist key before adding 2026-02-15 17:14:35 -08:00