Skip to content

current-work: preserve remote machine kinds - #14914

Merged
teamleaderleo merged 7 commits into
mainfrom
feat/current-work-machine-kinds
Sep 27, 2026
Merged

teamleaderleo merged 7 commits into
mainfrom
feat/current-work-machine-kinds

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Current Work now preserves each resource’s actual machine kind: local, cloud, SSH, or device. Find Work labels SSH work as SSH and other remote placements as Remote, while keeping the machine identity visible in every remote row’s subtitle. Local subtitles remain unchanged.

This is a small prerequisite for #14909 / #14911. Machine lifecycle and routing behavior are unchanged.

Verification

  • Original head 2b2f93153f61cbe8f328f584529a08182fe4758c: CI run 36297937391 passed; all 7 reducer tests executed.
  • Regression-only 3cf15d58aebe8414e90aa0f6f95f6ce9d4f2d1e3: native run 36331249057 executed 14 tests in 2 suites. Only the new palette regression failed, with the expected two missing remote-machine identity assertions.
  • Final repair 655dca405c44751bca363b8f556f476896118002: local Swift syntax, test wiring, and feature-flag checks passed. Native CI run 36332209279 passed macOS compilation and all 14 tests in the same 2 selected suites, including the palette regression.

The palette regression covers local, cloud, SSH, and device subtitle behavior. The reducer regression checks each machine kind and stable machine identifier. The subtitle repair has not been dogfooded in a tagged app.

Localization

Reuses existing Local, Cloud, SSH, and Remote keys. The strict localization audit passed: 9 catalogs, 9 locales, no parity errors; no new or changed translation rows.

Changelog

Fixed: Current Work preserves SSH and device machine kinds, and Find Work shows the correct remote kind and machine identity.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Preserves the actual machine kind (local, cloud, ssh, device) in Current Work placement instead of collapsing every non-local placement to cloud. Find Work now labels SSH work as SSH and other remote kinds (including device) as Remote, and palette subtitles keep the machine identity for every remote placement instead of only Cloud.

Adds reducer and palette tests covering all four kinds and updates docs to state remote resources retain their catalog machine kind. No machine lifecycle or routing changes. Prerequisite for #14909 / #14911.

Written for commit 655dca4. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Current-work entries now show placement types more accurately, including SSH and Remote labels.
    • Placement details now include the machine identity for cloud, SSH, and device placements; local placements continue to omit it.
  • Documentation
    • Updated current-work documentation to describe remote-machine behavior and placement types.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c3bef96e-a040-4a05-820e-adbdce198b43

📥 Commits

Reviewing files that changed from the base of the PR and between eb4cc15 and 655dca4.

📒 Files selected for processing (6)
  • Sources/CommandPalette/CurrentWorkPalettePresentation.swift
  • Sources/ContentView+CurrentWorkCommandPalette.swift
  • Sources/Surfaces/CurrentWorkReducer.swift
  • cmuxTests/CurrentWorkCommandPaletteTests.swift
  • cmuxTests/CurrentWorkReducerTests.swift
  • docs/current-work.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Current-work placement now preserves each resource’s machine kind. The command palette displays kind-specific labels and includes the machine identity for non-local placements. Tests and documentation reflect these distinctions.

Changes

Current-work placement

Layer / File(s) Summary
Preserve machine kind
Sources/Surfaces/CurrentWorkReducer.swift, cmuxTests/CurrentWorkReducerTests.swift
The reducer uses each resource’s machine kind as its placement kind. A test checks local, cloud, SSH, and device placements.
Display placement kind
Sources/ContentView+CurrentWorkCommandPalette.swift, Sources/CommandPalette/CurrentWorkPalettePresentation.swift, cmuxTests/CurrentWorkCommandPaletteTests.swift, docs/current-work.md
The palette maps placement kinds to labels and includes the machine identity for non-local placements. Tests cover subtitle behavior, and the documentation describes remote-resource handling and preserved machine kinds.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 655dc

This PR only refines how machine kind is displayed in Current Work and the command palette, with no change to lifecycle or routing behavior; it is well covered by tests and low risk to merge.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 655dc

Remote work is identified more accurately without changing how machines are opened or focused. The remaining risk is that a consumer of Current Work data may expect only the older placement labels.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated change in exposure is placement metadata in the existing palette and current.list response, not a new route to machine operations or focus authority.

Trust Boundaries and Controls

  • observed — A snapshot row cannot by itself authorize palette navigation: the action recomputes focus targets and requires a matching current catalog projection and workspace target.

Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Swift Package Boundaries ❌ Error The changed Sources/Surfaces/CurrentWorkReducer.swift line materially expands core Current Work domain behavior from a local/cloud mapping to all catalog machine kinds. The reducer imports only `Cmu… Extract the pure Current Work reduction boundary from the app target into a small SwiftPM target, preferably alongside or split from the existing CmuxCloud Current Work model. Move CurrentWorkReducer and its pure regression tests with t…
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (23 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Cloud Persistent Session And Early Input ✅ Passed The pull request changes Current Work snapshot placement mapping, palette labels/subtitles, tests, and documentation only. The authoritative diff contains no Cloud terminal creation, cmux-tui client, …
Cmux Swift Actor Isolation ✅ Passed No actor-isolation failure is introduced. The production diff changes value selection in CurrentWorkReducer to read SurfaceMachineID.kind; SurfaceMachineID is an existing Sendable enum with a …
Cmux Swift Blocking Runtime ✅ Passed The production Swift diff changes placement labels and machine-kind data only. It adds no semaphore, wait, sleep, delayed dispatch, polling, main-queue sync, or manual lock. The two existing `Dispatch…
Cmux Browser Automation Off-Main ✅ Passed The PR changes only Current Work presentation, labeling, reduction, tests, and documentation. Neither Sources/TerminalController.swift nor `Packages/macOS/CmuxControlSocket/Sources/CmuxControlSocket…
Cmux Expensive Synchronous Load ✅ Passed The production diff adds no expensive synchronous loader, file read, directory scan, JSON parse, transcript access, or syscall. The changed palette methods only format already captured values. The red…
Cmux Cache Substitution Correctness ✅ Passed No cache substitution is introduced. The reducer changes only the placement-kind mapping from resource.machine.isLocal to resource.machine.kind, using the same captured catalog resource. `CurrentW…
Cmux No Hacky Sleeps ✅ Passed PASS: The pull request changes only Swift source/tests and Markdown documentation. It introduces no TypeScript, JavaScript, shell, or non-Swift build/runtime code, and the visible `DispatchQueue.main.…
Cmux Algorithmic Complexity ✅ Passed The production diff adds only a constant-time placement-label switch, changes one subtitle condition, and changes one placement-kind assignment. It adds no collection scan, sort, filter, join, or per-…
Cmux Swift Concurrency ✅ Passed PASS: The pull request adds only synchronous placement-label, subtitle, and reducer logic, plus tests. Added Swift lines contain no DispatchQueue, Task, Combine state, completion-handler API, or a…
Cmux Swift @Concurrent ✅ Passed The PR changes only synchronous Swift code and tests. The authoritative diff introduces no async, nonisolated, @concurrent, actor-isolation, or async call-site changes. The existing `DispatchQue…
Cmux Swiftpm Lockfiles ✅ Passed PASS. The review-scoped diff changes only six Swift source/test files and one documentation file. It changes no Package.swift, Package.resolved, .gitignore, workflow, or Xcode project package referenc…
Cmux Swift Logging ✅ Passed PASS: The pull request adds or changes no logging. The Swift diff only changes placement-kind selection, labels, subtitles, and tests. No added print, debugPrint, dump, NSLog, file/stdout logg…
Cmux User-Facing Error Privacy ✅ Passed PASS — The production changes reach the Find Work command-palette UI and regular current CLI output, but they add informational placement labels and catalog machine identities, not errors, alerts, r…
Cmux Full Internationalization ✅ Passed No internationalization violation is introduced. The changed Swift user-facing labels use String(localized:defaultValue:) with existing catalog keys for Local, Cloud, SSH, and Remote. The authoritat…
Cmux Swiftui State Layout ✅ Passed PASS: The reviewed Swift changes do not introduce any forbidden SwiftUI state or layout pattern. The diff only changes pure presentation/label logic and a reducer value, plus tests. No added lines con…
Cmux Architecture Rethink ✅ Passed PASS. The Swift diff is a small correctness change. It preserves resource.machine.kind, maps placement labels through one pure helper, and updates subtitle presentation. It adds no sleeps, delayed d…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: The PR changes Current Work placement data, palette labels/subtitles, tests, and documentation. The authoritative diff adds no user-visible NSWindow, NSPanel, NSWindowController, SwiftUI Window,…
Cmux Source Artifacts ✅ Passed The PR changes only six intentional Swift source files, Swift tests, and docs/current-work.md. The diff adds no logs, screenshots, recordings, temporary or cache directories, dependency checkouts, b…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS. The PR changes three production Swift files, but none adds a #if DEBUG or test-build guard, a test/debug-named member, a visibility widening, or a test-only accessor. The added `currentWorkPla…
Title check ✅ Passed The title clearly identifies the main change: preserving remote machine kinds in Current Work.
Description check ✅ Passed The description clearly explains the behavior change, scope, tests, localization audit, changelog entry, and known verification limit. It uses a Verification heading instead of Testing and does not in…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 5 files. (1 skipped: 1 unsupported.)

Full details: Cmux Swift Package Boundaries

Explanation

The changed Sources/Surfaces/CurrentWorkReducer.swift line materially expands core Current Work domain behavior from a local/cloud mapping to all catalog machine kinds. The reducer imports only CmuxCloud and Foundation, performs no I/O or app-lifecycle work, and its tests explicitly run without launching the app. Its output feeds both the CLI current.list path and the in-app Find Work path. This matches the rule's independently testable, reusable domain-logic boundary condition. The palette changes are UI/AppKit glue and are allowed.

Resolution

Extract the pure Current Work reduction boundary from the app target into a small SwiftPM target, preferably alongside or split from the existing CmuxCloud Current Work model. Move CurrentWorkReducer and its pure regression tests with that target. Expose the first public API as CurrentWorkReducer.reduce(_:limit:) (or a small CurrentWorkReducing protocol). Keep CurrentWorkQueryService, TerminalController capture/CLI composition, and ContentView/palette presentation in the app target.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

CI failure attribution

CI passes on 655dca405c (run 36332209279 attempt 1).

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's.

@teamleaderleo
teamleaderleo marked this pull request as ready for review September 27, 2026 16:10
@teamleaderleo
teamleaderleo merged commit 41a0c37 into main Sep 27, 2026
71 of 72 checks passed
@teamleaderleo
teamleaderleo deleted the feat/current-work-machine-kinds branch September 27, 2026 16:28
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for 655dca405c: every check was green at merge (16 verified; 14 skipped by policy). Full suite runs on main after merge.

rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 27, 2026
8efe28d Add terminal.confirmUnsafePaste to confirm unsafe pastes in a window sheet (manaflow-ai#14951)
368ec9f fix(ci): restore app-host artifact rerun setup (manaflow-ai#15029)
e67ea0f perf: stop launching the cmux CLI for every queued Claude hook (manaflow-ai#14931)
badf9f6 test: give the tmux split mapping test its own portal authority (manaflow-ai#15028)
41a0c37 current-work: preserve remote machine kinds (manaflow-ai#14914)
c842f7d test(hermes): wait for the hook installer instead of racing a 1 s deadline (manaflow-ai#15027)
810ffba fix(ci): resolve binary modules in detached test reruns (manaflow-ai#15026)
d363290 test: await fork probe fixture start signals (manaflow-ai#15025)
8c98e64 Add cmux import for settings from other terminals (manaflow-ai#15004)
30aa6c1 Keep SSH workspace titles when cmux-tui creates the remote workspace (manaflow-ai#14976)
b33c467 Restore workspace group color and icon key handling from manaflow-ai#13877 (manaflow-ai#15000)

# Conflicts:
#	.github/workflows/app-host-test-rerun.yml
#	.github/workflows/ci-macos.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant