Skip to content

Fix main build: two compile errors from PR 8690 - #8869

Merged
azooz2003-bit merged 3 commits into
mainfrom
fix-docksplit-workspaces-import
Jul 24, 2026
Merged

azooz2003-bit merged 3 commits into
mainfrom
fix-docksplit-workspaces-import

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator

Current main fails to compile the macOS app: Sources/DockSplitStore+RestoredAgentLifecycle.swift:13: error: cannot find type 'PanelShellActivityState' in scope (seen on the cloud reload builder, https://github.com/manaflow-ai/cmux/actions/runs/30104418455).

PanelShellActivityState lives in the CmuxWorkspaces package, and #8690 merged this file importing only Foundation, a semantic merge miss since sibling users of the type like Sources/Workspace+AgentLifecycle.swift import CmuxWorkspaces. One-line import fix.

🤖 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

Fixes the macOS app build by importing CmuxWorkspaces, adding an explicit return switch in surfacePromptForResumeApproval, and annotating closure result types in DockSplitStore+SessionSnapshot. Resolves the missing PanelShellActivityState type, a trailing switch compile error, and type inference failures on Xcode 26.5.

Written for commit a75a633. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability during session restoration by ensuring required workspace functionality is available.
  • Refactor
    • Improved resume approval logic so the selected resume policy is consistently returned from the approval prompt.
    • Tightened internal session snapshot computations with clearer, explicit return types (no behavior change).

…Lifecycle

PanelShellActivityState moved into the CmuxWorkspaces package, and
#8690 merged a file that references it
with only a Foundation import, so current main fails to compile the macOS app
(cannot find type 'PanelShellActivityState' in scope). Sibling users of the
type such as Workspace+AgentLifecycle.swift already import CmuxWorkspaces.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a missing CmuxWorkspaces import, explicit closure return types in Dock session restoration code, and a returned modal-result switch expression for resume approval without changing behavior.

Changes

Swift compilation fixes

Layer / File(s) Summary
Clarify Dock restore types
Sources/DockSplitStore+RestoredAgentLifecycle.swift, Sources/DockSplitStore+SessionSnapshot.swift
Adds the CmuxWorkspaces import and explicit closure return types for session snapshot and agent-session matching logic.
Return resume approval policy
Sources/ControlSurfaceResumeTarget.swift
Returns the alert.runModal() switch expression while preserving the .auto, .prompt, and .manual mappings.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

  • manaflow-ai/cmux-dev-artifacts#5706: Addresses the same Swift type-inference failures in DockSplitStore+SessionSnapshot.swift.
  • manaflow-ai/cmux-dev-artifacts#5526: Addresses related closure type-inference errors in the session snapshot code.
  • manaflow-ai/cmux-dev-artifacts#5730: Addresses the same resume approval switch-return compilation failure.
  • manaflow-ai/cmux-dev-artifacts#5724: Addresses the same resume approval switch-return compilation failure.

Possibly related PRs

Suggested reviewers: austinywang

🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the fix, but it omits required template sections like Testing, Demo Video, Review Trigger, and Checklist. Add the missing template sections, especially Testing, Review Trigger, and the Checklist; note Demo Video as N/A if not applicable.
✅ Passed checks (24 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 Swift Actor Isolation ✅ Passed The diff only adds an import, switches to expression form, and tightens closure return types; it adds no new cross-actor access or isolation changes, and the touched stores/types are already @MainA...
Cmux Swift Blocking Runtime ✅ Passed Diff only adds an import, return switch, and closure type annotations; no semaphores, sleeps, sync waits, polling, or locks were added.
Cmux Browser Automation Off-Main ✅ Passed The PR only changes DockSplitStore+SessionSnapshot closure annotations; no browser.*, socket-worker routing, WebKit/AppKit wait, or main-actor automation code is touched.
Cmux Expensive Synchronous Load ✅ Passed Diff only adds closure type annotations in sessionSnapshot; no new RestorableAgentSessionIndex.load() or other heavy sync load appears.
Cmux Cache Substitution Correctness ✅ Passed Diff only adds explicit closure result types in a snapshot helper; no fresh-read-to-cache substitution appears in persistence/history/snapshot paths.
Cmux No Hacky Sleeps ✅ Passed Diff touches only a Swift file; the no-hacky-sleeps rule is scoped to non-Swift runtime/scripts, and no delay code was introduced.
Cmux Algorithmic Complexity ✅ Passed The diff only adds closure return-type annotations in session snapshot; it չի introduce new scans, sorts, joins, or other asymptotic changes.
Cmux Swift Concurrency ✅ Passed Diff only adds an import, a return switch, and explicit closure types; no new DispatchQueue, Combine, completion-handler, or fire-and-forget Task patterns appear.
Cmux Swift @Concurrent ✅ Passed PASS: The diff only changes imports, a sync return switch, and closure type annotations; no async/@Concurrent changes or UI-isolation hop issues are introduced.
Cmux Swift Package Boundaries ✅ Passed Only app-target glue/compile fixes changed; no reusable domain logic was added or moved across SwiftPM boundaries.
Cmux Swiftpm Lockfiles ✅ Passed PR only changes three Swift source files; no Package.swift, Package.resolved, .gitignore, or Xcode project files are in the diff.
Cmux Swift Logging ✅ Passed The diff only adds an import and minor control-flow/type-annotation tweaks; no print/debugPrint/dump/NSLog, Logger constants, or sensitive logging were added.
Cmux User-Facing Error Privacy ✅ Passed Only import/control-flow/type-annotation changes were made; no user-facing error, alert, or recovery copy was added or altered.
Cmux Full Internationalization ✅ Passed Diff is implementation-only type annotations; no user-facing text or locale/catalog/web i18n assets were changed.
Cmux Swiftui State Layout ✅ Passed Touched files only change imports, control flow, and closure annotations; no SwiftUI state/layout patterns appear in the diff.
Cmux Architecture Rethink ✅ Passed The real diff only tightens closure types in DockSplitStore+SessionSnapshot; no timing hacks, observers, duplicate wiring, or split ownership were introduced.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed Diff only changes DockSplitStore+SessionSnapshot.swift type annotations; no NSWindow/NSPanel/WindowGroup code or cmux.* close-shortcut ownership changes are present.
Cmux Source Artifacts ✅ Passed Only changed path is Sources/DockSplitStore+SessionSnapshot.swift, a normal source edit; no logs, tmp dirs, caches, or other artifacts were added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed Diff only adds an import, a return-switch tweak, and type annotations; no new DEBUG/test hook seam appears in production Sources.
Cmux No Ambient Global State ✅ Passed Diff only adds an import, an explicit return switch, and closure type annotations inside existing extension methods; no new file-scope state or static namespace was introduced.
Title check ✅ Passed The title accurately describes the main change: fixing build errors from PR 8690.
✨ 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 fix-docksplit-workspaces-import

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 Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes two compile errors introduced by the merge of PR #8690 that were blocking the macOS app build on CI. Both fixes are minimal and surgical with no behavioral changes.

  • DockSplitStore+RestoredAgentLifecycle.swift: Adds the missing import CmuxWorkspaces so PanelShellActivityState resolves in scope, matching the pattern already used in sibling files like Workspace+AgentLifecycle.swift.
  • ControlSurfaceResumeTarget.swift: Adds return before the switch expression in surfacePromptForResumeApproval so the selected policy is actually returned instead of discarded.
  • DockSplitStore+SessionSnapshot.swift: Adds explicit closure return-type annotations ((UUID, UUID)? and RestorableAgentSessionIndex.Entry?) to help the Swift type checker resolve ambiguity introduced by the same merge.

Confidence Score: 5/5

All three changes are minimal compile-error fixes with no behavioral side effects beyond unblocking the build.

Each change is a one-line correction — a missing import, a missing return keyword, and two explicit closure type annotations. None touch logic, data flow, actor isolation, or lifecycle ordering. The return switch fix actually restores the intended behavior (returning the user's selection) that was silently broken before.

No files require special attention.

Important Files Changed

Filename Overview
Sources/DockSplitStore+RestoredAgentLifecycle.swift Adds missing import CmuxWorkspaces to resolve PanelShellActivityState compile error; one-line import fix with no logic changes.
Sources/ControlSurfaceResumeTarget.swift Adds return before switch expression so surfacePromptForResumeApproval correctly returns the selected approval policy instead of silently discarding it.
Sources/DockSplitStore+SessionSnapshot.swift Adds explicit closure return-type annotations to two compactMap/flatMap closures to resolve type-inference ambiguity; no behavioral changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[surfacePromptForResumeApproval] --> B[Build NSAlert with 3 buttons]
    B --> C[alert.runModal]
    C -->|.alertFirstButtonReturn| D[return .auto]
    C -->|.alertSecondButtonReturn| E[return .prompt]
    C -->|default| F[return .manual]
    D & E & F --> G[ResumeApprovalPolicy returned to caller]

    H[updatePanelShellActivityState] --> I{import CmuxWorkspaces}
    I --> J[PanelShellActivityState resolves in scope]
    J --> K[switch state, resumeState]
Loading

Reviews (3): Last reviewed commit: "Fix main build: annotate closure result ..." | Re-trigger Greptile

surfacePromptForResumeApproval ended with a bare switch statement whose
cases are contextless member expressions (.auto/.prompt/.manual), which
does not compile as a statement. Use 'return switch' so the cases get
their contextual type from the return type.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@azooz2003-bit azooz2003-bit changed the title Fix main build: import CmuxWorkspaces in DockSplitStore+RestoredAgentLifecycle Fix main build: two compile errors from PR 8690 Jul 24, 2026
…onSnapshot

The Xcode 26.5 toolchain on the reload builder cannot infer result types of
multi-statement closures that return nil-or-value, failing with 'generic
parameter could not be inferred' at the Dictionary(uniqueKeysWithValues:
compactMap) pair builder and the observation.flatMap guard. Annotate both
closures with their concrete result types.

Co-Authored-By: Claude Fable 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