Skip to content

Remove dead resume code left by #14560 - #14693

Merged
teamleaderleo merged 1 commit into
mainfrom
remove-dead-resume-followups
Sep 25, 2026
Merged

teamleaderleo merged 1 commit into
mainfrom
remove-dead-resume-followups

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #14560, which deleted the persistent-SSH resume binding path. Each item below was checked with git grep on current main before removal.

  1. willRunStartupCommand: every call site (Workspace.swift, DockSplitStore.swift, DockSplitStore+SessionRestore.swift) passed false. Removed the parameter from TerminalStartupRestoreCoordinator.runtimeSpawnPolicy and stage, the PendingTerminalStartupRestore field, the startupCommand breadcrumb field, and the RestoredAgentLifecycleCoordinator.seedSessionRestore branch that seeded .autoResumeCommandRunning. willRunStartupCommand || willRunStartupInput is now just willRunStartupInput. Tests that passed willRunStartupCommand: false were updated.
  2. setStartupRestoreAdmissionFallbackCommand (CmuxTerminal): it had no app caller. Removed it and the startupRestoreAdmissionFallbackCommand stored var. Cancelling deferred admission now sets the command override to nil, which is what it already did with no fallback set. The package test that set a fallback now asserts that cancelling drops the resume command (override nil).
  3. WorkspaceRemoteRelayCommandRewriter.authenticatesRemoteResumeParameters: only tests called it. Removed it and the assertions that exercised it in RemoteResumeBindingTests. The two affected tests now check that the rewriter still stamps the resume MAC on surface.resume.set (including the escaped method name) and only on the exact method. All remaining private helpers are still used.
  4. ControlSurfaceResumeSetInputs.remoteRelayParameters: nothing read it. Removed the field, the init parameter, and the arguments at ControlCommandCoordinator+Surface3.swift and GhosttyNSView+ForkConversationContextMenu.swift.

SurfaceResumeLaunchFlavor.persistentSSH encode/decode is unchanged. No files were deleted, so the pbxproj is untouched.

Out of scope: the rewriter still stamps _cmux_remote_relay_authentication_code on relayed surface.resume.set, and the app strips it on ingress, but nothing verifies it anymore. Removing that is a wire-format change, so it should be its own PR.

Verification: swift build for CmuxControlSocket passes. A git grep sweep finds no remaining references to the removed symbols. The app and test targets are left to CI.

🤖 Generated with Claude Code


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

Follow-up to #14560 that removes code left unreachable after the persistent-SSH resume binding path was deleted.

  • willRunStartupCommand was always false at every call site; the parameter, the .autoResumeCommandRunning seed branch, and the startupCommand breadcrumb field are gone.
  • setStartupRestoreAdmissionFallbackCommand had no app callers; cancelling deferred admission now always clears the command override, matching prior runtime behavior.
  • authenticatesRemoteResumeParameters was test-only; the tests now assert the resume MAC is stamped on surface.resume.set for the exact method only.
  • remoteRelayParameters was never read; the field, init parameter, and call-site arguments are removed.

The relayed resume MAC is still stamped and stripped on ingress, but nothing verifies it anymore; removing that is a wire-format change left for a separate PR.

Written for commit 04b590f. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Behavior Changes
    • Startup restore decisions now depend on pending startup input rather than a startup command alone. When deferred restore is cancelled, the resume command is discarded instead of being replaced with a fallback command.
    • Remote resume setup no longer carries relay parameters through the resume-binding flow.
  • Tests
    • Updated coverage to reflect startup restore cancellation and remote resume authentication behavior.

#14560 deleted the persistent-SSH resume binding path. This removes the
code that path left unreachable:

- willRunStartupCommand: every call site passed false. Drop the parameter
  from TerminalStartupRestoreCoordinator, PendingTerminalStartupRestore and
  RestoredAgentLifecycleCoordinator.seedSessionRestore, the startupCommand
  breadcrumb field, and the autoResumeCommandRunning seed branch.
- setStartupRestoreAdmissionFallbackCommand and its stored var: no app
  caller. Cancelling deferred admission now always clears the command.
- WorkspaceRemoteRelayCommandRewriter.authenticatesRemoteResumeParameters:
  test-only. Tests now assert the resume MAC is stamped instead.
- ControlSurfaceResumeSetInputs.remoteRelayParameters: never read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Sep 25, 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: ea84b4be-0aab-407e-b5b9-50e039dba203

📥 Commits

Reviewing files that changed from the base of the PR and between ff02854 and 04b590f.

📒 Files selected for processing (19)
  • Packages/macOS/CmuxControlSocket/Sources/CmuxControlSocket/Coordinator/Surface/ControlCommandCoordinator+Surface3.swift
  • Packages/macOS/CmuxControlSocket/Sources/CmuxControlSocket/Coordinator/Surface/ControlSurfaceResumeSetInputs.swift
  • Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Lifecycle/TerminalSurface+StartupRestoreAdmission.swift
  • Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+RuntimeLifecycle.swift
  • Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface.swift
  • Packages/macOS/CmuxTerminal/Tests/CmuxTerminalTests/TerminalSurfaceStartupRestorePolicyTests.swift
  • Sources/DockSplitStore+SessionRestore.swift
  • Sources/DockSplitStore.swift
  • Sources/GhosttyNSView+ForkConversationContextMenu.swift
  • Sources/PendingTerminalStartupRestore.swift
  • Sources/RestoredAgentLifecycleCoordinator.swift
  • Sources/TerminalStartupRestoreCoordinator.swift
  • Sources/Workspace.swift
  • Sources/WorkspaceRemoteRelayCommandRewriter.swift
  • cmuxTests/CodexAutoresumeChainTests.swift
  • cmuxTests/RemoteResumeBindingTests.swift
  • cmuxTests/RestoredStartupInputOwnershipTests.swift
  • cmuxTests/TerminalStartupRestoreFailureTests.swift
  • cmuxTests/VaultRestoreRelaunchPersistenceTests.swift
💤 Files with no reviewable changes (12)
  • Sources/DockSplitStore+SessionRestore.swift
  • Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface.swift
  • Packages/macOS/CmuxControlSocket/Sources/CmuxControlSocket/Coordinator/Surface/ControlCommandCoordinator+Surface3.swift
  • cmuxTests/VaultRestoreRelaunchPersistenceTests.swift
  • Sources/WorkspaceRemoteRelayCommandRewriter.swift
  • cmuxTests/RestoredStartupInputOwnershipTests.swift
  • Sources/DockSplitStore.swift
  • Packages/macOS/CmuxControlSocket/Sources/CmuxControlSocket/Coordinator/Surface/ControlSurfaceResumeSetInputs.swift
  • cmuxTests/CodexAutoresumeChainTests.swift
  • Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+RuntimeLifecycle.swift
  • cmuxTests/TerminalStartupRestoreFailureTests.swift
  • Sources/Workspace.swift

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Startup restore admission and lifecycle state now depend on startup input rather than startup command state. Admission cancellation clears the command override. Remote resume inputs no longer retain relay parameters, and the resume-parameter authentication verifier is removed.

Changes

Startup Restore Admission

Layer / File(s) Summary
Startup restore policy and wiring
Sources/PendingTerminalStartupRestore.swift, Sources/TerminalStartupRestoreCoordinator.swift, Sources/RestoredAgentLifecycleCoordinator.swift, Sources/Workspace.swift, Sources/DockSplitStore*.swift, cmuxTests/*
Startup restore staging, runtime policy, and lifecycle seeding use startup-input state. Restore call sites and tests no longer pass startup-command state.
Admission cancellation behavior
Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Lifecycle/TerminalSurface+StartupRestoreAdmission.swift, Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface*.swift, Packages/macOS/CmuxTerminal/Tests/CmuxTerminalTests/TerminalSurfaceStartupRestorePolicyTests.swift
Both admission-cancellation paths clear the command override. The fallback-command property and setter are removed. The test expects no command override after cancellation.

Remote Resume Authentication

Layer / File(s) Summary
Resume authentication inputs and checks
Packages/macOS/CmuxControlSocket/Sources/CmuxControlSocket/Coordinator/Surface/ControlCommandCoordinator+Surface3.swift, Packages/macOS/CmuxControlSocket/Sources/CmuxControlSocket/Coordinator/Surface/ControlSurfaceResumeSetInputs.swift, Sources/WorkspaceRemoteRelayCommandRewriter.swift, Sources/GhosttyNSView+ForkConversationContextMenu.swift, cmuxTests/RemoteResumeBindingTests.swift
Resume input construction omits relay parameters. The authentication verifier is removed. Tests check the authentication code stamped on exact resume methods.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 04b59

No merge-blocking issue is established; the change is ready for normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 04b59

The affected restore and remote-resume paths remain guarded, and this review found no new security bypass. Some security coverage is incomplete, so the assessment is not a clean bill of health.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A relay-token holder can submit authenticated resume requests for surfaces allowed by its workspace authorization. The reviewed removal does not establish broader workspace or surface reachability.

Trust Boundaries and Controls

  • observed — The request-level MAC authenticates the method and operational parameters, including resume command and selectors. Removing the test-only resume-parameter verifier therefore does not, on the inspected ingress path, remove authentication of those fields.

Resilience and Maintainability Implications

  • observed — The changed resume tests check that the producer stamps a code for the exact method, but no longer exercise the removed helper's tampered-command and missing-provenance rejection cases. This is a narrower test assertion, not evidence that production ingress lost its request-MAC check.
🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: removing unreachable resume-related code left after pull request #14560.
Description check ✅ Passed The description provides a detailed summary of the removed code, explains the resulting behavior, identifies out-of-scope wire-format work, and reports verification. The omitted demo video is appropri…
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 PASS: The PR does not change Cloud terminal creation, persistent transport allocation, readiness gates, or ordered input routing. The runtime policy cleanup removes willRunStartupCommand, but every …
Cmux Swift Actor Isolation ✅ Passed No Swift actor-isolation mistake is introduced or worsened. The production diff mainly removes dead parameters, state, and helpers. The only behavioral replacements remain inside existing @MainActor…
Cmux Swift Blocking Runtime ✅ Passed The pull request does not introduce or expand blocking or timing-based synchronization. The production diff only removes obsolete parameters, state, methods, and authentication code, or replaces fallb…
Cmux Browser Automation Off-Main ✅ Passed PASS. The pull request does not modify either rule-scoped browser automation source file: Sources/TerminalController.swift and `Packages/macOS/CmuxControlSocket/Sources/CmuxControlSocket/Wire/Contro…
Cmux Expensive Synchronous Load ✅ Passed PASS: The PR removes startup-restore state, parameters, and a test-only authentication helper. It does not add or move RestorableAgentSessionIndex.load(), agent-store reads, transcript parsing, dire…
Cmux Cache Substitution Correctness ✅ Passed PASS. The PR changes only Swift and removes parameters, stored state, a fallback API, and a test-only authentication helper. The restore-path changes remove willRunStartupCommand and retain `willRun…
Cmux No Hacky Sleeps ✅ Passed PASS. The pull request changes 19 files, and every changed file has a .swift extension. The custom check covers TypeScript, JavaScript, shell, and non-Swift build/runtime scripts. It does not apply …
Cmux Algorithmic Complexity ✅ Passed PASS — The PR introduces no algorithmic-complexity violation. The production diff is primarily deletions. Its additions only clear a scalar command override or select state with a boolean conditional.…
Cmux Swift Concurrency ✅ Passed The pull-request diff only removes legacy state, parameters, helper code, and test assertions, with a small replacement of restore-state logic. The added Swift lines contain no DispatchQueue, backgrou…
Cmux Swift @Concurrent ✅ Passed The PR does not introduce or materially expand async work. The changed startup-restore methods remain synchronous and @MainActor, while runtimeSpawnPolicy remains a nonisolated synchronous helper. T…
Cmux Swift Package Boundaries ✅ Passed The PR does not introduce or materially expand independently testable domain logic in the app target. The root Sources/ changes only remove obsolete startup-restore parameters/state and a test-only …
Cmux Swiftpm Lockfiles ✅ Passed The pull request changes only Swift source and test files. The authoritative diff contains no Package.swift, Package.resolved, .gitignore, workflow, or Xcode project/workspace changes. Therefore, the …
Cmux Swift Logging ✅ Passed PASS. The reviewed diff adds no print, debugPrint, dump, NSLog, ad hoc file/stdout logging, Logger declarations, or sensitive-data logs. The changed lines remove unused state, parameters, call…
Cmux User-Facing Error Privacy ✅ Passed PASS. The authoritative diff contains no added or changed user-facing error, alert, command-output, API-error, or recovery text. Production changes remove unused parameters, state, authentication help…
Cmux Full Internationalization ✅ Passed PASS: The authoritative PR diff changes only 19 Swift files and adds no user-facing production text. The added lines are control-flow changes, nil assignments, protocol-key checks, and test assertions…
Cmux Swiftui State Layout ✅ Passed PASS. The PR does not introduce or materially expand SwiftUI state or layout patterns. The authoritative diff adds no ObservableObject/@published state, @Observable state, GeometryReader, lazy/list ro…
Cmux Architecture Rethink ✅ Passed PASS. The PR removes dead parameters, fields, a test-only helper, and an unused fallback API. The only behavioral additions assign the existing startupRestoreAdmissionCommandOverride to nil, and t…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed The pull request does not add or materially change any standalone NSWindow, NSPanel, NSWindowController, SwiftUI Window, or WindowGroup. The diff only removes resume/restore state, APIs, par…
Cmux Source Artifacts ✅ Passed All 19 changed paths are existing Swift source or test files. The diff contains only source cleanup and test updates, with no added files, binary files, logs, screenshots, caches, build output, tempor…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS: The production Swift diff adds only two assignments clearing startupRestoreAdmissionCommandOverride. It adds no #if DEBUG or test-build block, test/debug seam member, wrapper accessor, or wi…
  • 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.

@teamleaderleo
teamleaderleo merged commit d57f584 into main Sep 25, 2026
67 of 68 checks passed
@teamleaderleo
teamleaderleo deleted the remove-dead-resume-followups branch September 25, 2026 19:54
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for 04b590f3eb: every check was green at merge (20 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 25, 2026
8538fa9 Add a Focus Last action that toggles between the two most recent focus positions (manaflow-ai#14700)
fba6c47 Don't leak the host's TERM_PROGRAM/COLORTERM into remote PTY sessions (manaflow-ai#9610)
10cdafe agent-chat: skip the launchd PATH prefix on Windows so agent CLIs resolve (manaflow-ai#12206)
9c8039a Add Reveal in Finder to the terminal context menu (manaflow-ai#14697)
d57f584 Remove dead resume code left by manaflow-ai#14560 (manaflow-ai#14693)
67debd6 Report the closed surface's own ref from surface.close (manaflow-ai#14698)
a75ab64 test(ios): fix stale CmuxMobileShell connection-recovery tests (manaflow-ai#14691)
ec7b2f1 Predicted echo: seed alternate screen from ghostty, guard stale erases (manaflow-ai#14686)
9aa850d refactor: move the Cloud surface models into CmuxCloud (manaflow-ai#14390)
da468e1 ci(e2e): order sibling waits by attempt start, adopt main's seed product (manaflow-ai#14684)
ff02854 Request badge authorization so the Dock badge renders (manaflow-ai#14242)
dc89b82 ci: iOS picker mints the routing token with the org runner permission (manaflow-ai#14690)
9650672 ci: label the org glaeda-minis runners with warm keys (manaflow-ai#14679)
992a2de Remove unreachable persistent-SSH resume binding code (manaflow-ai#14560)
6b4d976 ci(ios): read idle simulator minis live from the runners API (manaflow-ai#14542)
2f5d439 fix(ios): align hidden-marker and Iroh aggregation tests with build identity (manaflow-ai#14535)
bcf0122 Start a never-shown terminal before surface.read_text and read_screen (manaflow-ai#14673)
60469a3 ci: reuse unit xctestrun for numeric locale tests (manaflow-ai#13414)
2d1bf1b ci: give the receipt contract's guard fixture every workflow (manaflow-ai#14685)
ec52ce4 test: give the restore surface-context test its own socket (manaflow-ai#14680)

# Conflicts:
#	.github/workflows/ci-cache-receipts.yml
#	.github/workflows/ci-owned-warm-labels.yml
#	.github/workflows/seed-derived-data.yml
#	.github/workflows/test-e2e.yml
#	.github/workflows/test-ios.yml
teamleaderleo added a commit that referenced this pull request Sep 25, 2026
Stops attaching the per-resume relay MAC (_cmux_remote_relay_authentication_code). Nothing verified it after #14693. Ingress still strips the field from old senders; the relay-wide request MAC is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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