Skip to content

Restore terminal-only tab icons#7824

Merged
austinywang merged 32 commits into
mainfrom
issue-7822-restored-agent-icon-clear
Jul 10, 2026
Merged

Restore terminal-only tab icons#7824
austinywang merged 32 commits into
mainfrom
issue-7822-restored-agent-icon-clear

Conversation

@austinywang

@austinywang austinywang commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Closes #7822

Summary

  • Restores the terminal tab icon behavior from cmux 0.64.17: every terminal tab uses terminal.fill.
  • Removes agent-specific terminal-tab icon resolution for live agents, process titles, restored sessions, Dock tabs, and detached transfers.
  • Keeps agent branding in agent-specific UI such as session lists and launch menus; only terminal tab icons are reverted.
  • Clears custom image and asset overrides when terminal panels are replaced or transferred so stale agent artwork cannot survive.
  • Keeps completed restored-agent metadata available for agent-specific history while shared continuation gates prevent input, fork, persistence, and hibernation behavior after exit—even after ordinary shell commands.

Root cause and decision

Terminal tabs gained several independent agent-icon sources after 0.64.17: live PID state, terminal-title classification, restored-agent snapshots, appearance rerendering, and Dock or transfer propagation. Fixing individual lifecycle edges kept exposing another stale path. The requested invariant is now structural: agent state no longer participates in terminal-tab icon selection.

Testing

  • Commit dbc9363619 adds behavior tests covering live registered agents, an agent-like process title, and a restored agent; the assertions fail against the previous agent-icon implementation.
  • Commit b7df74442e removes the override system and preserves terminal.fill with nil iconImageData and iconAsset.
  • Commits fbb60b581e / 744ab7e94e prove and fix completed-agent textbox routing.
  • Commits 43b5b0278e / b2e8ec5cf7 prove and fix completed-agent fork availability across context-menu and command-palette paths.
  • Commits c3a5a8330d / 40f398dc7a prove and fix the completed-agent snapshot being deleted by a later ordinary shell command.
  • Focused completed-input, completed-fork, and terminal-icon run: 5 tests across 3 Swift Testing suites passed.
  • All 65 CommandPaletteSearchEngineTests passed.
  • Tagged Debug app built and launched from HEAD 40f398dc7a with ./scripts/reload.sh --tag issue-7822-restored-agent-icon-clear --launch; the isolated CLI socket was verified.
  • ./scripts/lint-pbxproj-test-wiring.sh
  • ./scripts/check-pbxproj.sh
  • git diff --check
  • python3 scripts/swift_file_length_budget.py reports only the unchanged main-branch baseline overage in cmuxUITests/AutomationSocketUITests.swift (551 vs budget 528); that file and budget are absent from this PR diff.

Demo Video

  • Not recorded. The latest tagged Debug build was rebuilt, launched, and its isolated socket verified for dogfood at commit 40f398dc7a.

Review Trigger (Copy/Paste as PR comment)

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

Checklist

  • I tested the change locally
  • I added or updated tests for behavior changes
  • Docs/changelog are not needed; the PR restores the documented 0.64.17 icon behavior without changing user-facing text
  • I requested bot reviews after my latest commit
  • All code review bot comments are resolved
  • All human review comments are resolved

Localization

The only user-visible change is the icon. No user-facing strings, accessibility text, settings, docs, or web messages changed; localization catalogs are untouched.


Note

Medium Risk
Touches restored-agent resume/fork/persistence and tab chrome across Workspace, Dock, and command palette; behavior is intricate but heavily covered by new regression tests.

Overview
Restores terminal-only tab icons by removing agent-brand resolution from tabs (live PIDs, title-derived keys, restored snapshots, Dock/transfer paths, and appearance-driven rerenders). Terminal tabs no longer push custom iconImageData / iconAsset from agent state; updatePanelTitle and related paths only refresh titles.

Introduces a completedAgentExit restored-agent lifecycle backed by RestoredAgentLifecycleCoordinator and process-generation tracking (RestoredAgentCompletedGeneration, AgentPIDProcessIdentity now Hashable). When a restored agent finishes (shell prompt idle), the app marks completion instead of wiping snapshots, and allowsAgentContinuation / restoredAgentSnapshotForContinuation gate fork, command palette, persistence, hibernation, and agent-specific textbox routing. A newer live agent process can supersede completion via index reconciliation; stale hook/index updates cannot revive a completed session.

Detached surface transfers now carry shellActivityState and restoredAgentCompletedGeneration so completion survives workspace/Dock moves. Session snapshot building uses index entries and reconciles completed agents before accepting restored metadata.

Reviewed by Cursor Bugbot for commit 06a7430. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Improved restored-agent lifecycle handling after an agent exits, preventing stale sessions from being resumed or forked.
    • Fork actions and command-palette options are now unavailable when continuation is no longer valid.
    • Terminal tab icons remain stable during agent, title, restore, detach, and reattach activity.
    • Prompt-idle shells no longer display stale live-agent status.
    • Preserved terminal titles and shell activity more reliably across surface transfers and session restoration.
  • Tests
    • Added regression coverage for completed-agent handling, input routing, continuation availability, and terminal tab icons.

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cmux Canceled Canceled Jul 10, 2026 2:48pm
cmux-staging Building Building Preview, Comment Jul 10, 2026 2:48pm

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Restored-agent lifecycle handling now records completed generations, gates continuation and fork availability, suppresses stale terminal icon fallbacks, preserves completion state across surface transfers, and adds regression coverage for lifecycle, routing, icons, and CI setup.

Changes

Restored-agent lifecycle

Layer / File(s) Summary
Completion state and reconciliation
Sources/RestoredAgentLifecycleCoordinator.swift, Sources/Workspace+AgentLifecycle.swift, Sources/Workspace.swift
Restored agents transition to .completedAgentExit, retain completed-generation identities, reconcile newer process generations, and suppress completed snapshots from restoration paths.
Continuation and fork gating
Sources/ContentView*.swift, Sources/Workspace+ForkAgentConversationAvailability.swift, Sources/Workspace.swift
Fork actions, command-palette availability, context menus, and terminal context use continuation-specific snapshots and reject completed agents.
Terminal icon and title state
Sources/TerminalTabAgentIcon.swift, Sources/DockSplitStore*.swift, Sources/Workspace+PanelLifecycle.swift, Sources/Workspace+TitleOwnership.swift
Prompt-idle shells suppress live-agent icon evidence, restored icon fallback is resume-state-gated, and derived terminal icon synchronization and title-status tracking are removed.
Surface transfer and validation
Sources/Workspace+DetachedSurfaceTransfer.swift, Sources/DockSplitStore+SurfaceTransfer.swift, cmuxTests/*, cmux.xcodeproj/project.pbxproj
Detached surfaces preserve shell activity and completed-generation state; new tests cover completion, fork availability, input routing, icon persistence, and transfer behavior.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

  • manaflow-ai/cmux#7607 — directly concerns terminal tab agent icon resolution and surface-transfer icon seeding.
  • manaflow-ai/cmux#7352 — directly concerns fork availability from restored and live agent snapshots.
  • manaflow-ai/cmux#7740 — overlaps with title-based stale agent PID cleanup and terminal icon refresh behavior.
🚥 Pre-merge checks | ✅ 3 | ❌ 22

❌ Failed checks (2 warnings, 20 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR also changes restored-agent lifecycle, fork/input routing, CI, and tests beyond the icon-fix scope of #7822. Split the broader lifecycle, CI, and test updates into separate PRs or document why they are required for #7822.
Docstring Coverage ⚠️ Warning Docstring coverage is 9.17% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Cmux Swift Actor Isolation ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Blocking Runtime ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Browser Automation Off-Main ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Expensive Synchronous Load ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Cache Substitution Correctness ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Hacky Sleeps ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Algorithmic Complexity ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Concurrency ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift @Concurrent ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift File And Package Boundaries ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swiftpm Lockfiles ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Logging ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux User-Facing Error Privacy ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Full Internationalization ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swiftui State Layout ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Architecture Rethink ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Auxiliary Window Close Shortcuts ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Source Artifacts ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Test Or Debug Seam In Production Source ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Ambient Global State ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes remove agent-driven terminal-tab icon fallbacks and restore terminal.fill behavior, matching #7822.
Title check ✅ Passed The title is concise and directly describes the main change: restoring terminal tab icons.
Description check ✅ Passed The description covers summary, rationale, testing, demo status, trigger, and checklist items, matching the template closely.
✨ 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-7822-restored-agent-icon-clear

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 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restores generic terminal tab icons while preserving agent-specific behavior outside the tab icon slot. The main changes are:

  • Removes agent-derived terminal tab icon resolution and appearance syncing.
  • Clears terminal icon image and asset overrides during replacement and transfer paths.
  • Adds completed restored-agent lifecycle state for exited restored sessions.
  • Gates input, fork, continuation, persistence, and hibernation paths after restored-agent completion.
  • Carries restored-agent completion and shell activity metadata through detach and reattach flows.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
Sources/RestoredAgentLifecycleCoordinator.swift Adds the restored-agent completion coordinator and only reopens continuation for a newer live process generation.
Sources/Workspace+AgentLifecycle.swift Moves restored-agent continuation checks and state transitions into shared workspace helpers.
Sources/ContentView.swift Updates command-palette fork availability and cache cleanup to use the shared continuation gate.
Sources/Workspace+ForkAgentConversationAvailability.swift Updates context-menu fork selection to use continuation-gated restored snapshots.
Sources/DockSplitStore+SurfaceTransfer.swift Carries shell activity and completed-generation transfer metadata while clearing terminal icon overrides.
Sources/Workspace.swift Updates restore, snapshot, hibernation, detach, reattach, and fork paths for the new completed-agent lifecycle.

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

Comment thread Sources/TerminalTabAgentIcon.swift Outdated
Comment thread Sources/TerminalTabAgentIcon.swift Outdated
Comment thread Sources/TerminalTabAgentIcon.swift Outdated
Comment thread Sources/TerminalTabAgentIcon.swift Outdated
Comment thread Sources/TerminalTabAgentIcon.swift Outdated
Comment thread Sources/Workspace.swift Outdated
Comment thread Sources/TerminalTabAgentIcon.swift Outdated

@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: 1

🤖 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 `@Sources/Workspace.swift`:
- Around line 433-437: The completed-agent exclusion lacks direct
persistence-level test coverage. Add or extend the `.promptIdle` transition test
to assert that the resulting
`sessionSnapshot(...).panels.first?.terminal?.agent` and relevant `.hibernation`
agent are nil after `completedAgentExit` is set, alongside the existing
resume-state assertion. Use the test’s existing session snapshot and panel
identifiers to verify the stale agent cannot be persisted or restored.
🪄 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: 07376511-0e48-4e74-ab15-4e26376bf360

📥 Commits

Reviewing files that changed from the base of the PR and between 9d90da5 and 1374b3f.

📒 Files selected for processing (4)
  • Sources/TerminalTabAgentIcon.swift
  • Sources/Workspace.swift
  • cmuxTests/AgentSessionAutoResumeSwiftTests.swift
  • cmuxTests/TerminalTabAgentIconTests.swift

Comment thread Sources/Workspace.swift
@austinywang austinywang changed the title Clear restored agent tab icon after shell exit Restore terminal-only tab icons Jul 10, 2026
Comment thread Sources/Workspace+AgentLifecycle.swift
Comment thread Sources/Workspace.swift
Comment thread Sources/Workspace.swift
Comment thread Sources/Workspace+AgentLifecycle.swift
@austinywang austinywang enabled auto-merge (squash) July 10, 2026 09:50
Comment thread Sources/Workspace.swift
Comment thread Sources/Workspace.swift Outdated
Comment thread Sources/Workspace.swift Outdated

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b2e8ec5. Configure here.

Comment thread Sources/Workspace+TitleOwnership.swift
@austinywang

Copy link
Copy Markdown
Contributor Author

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@cubic-dev-ai

cubic-dev-ai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

@austinywang I can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 241,631 of the 240,000 allowed lines of code this month. Reviews resume on 1 August 2026 (in 22 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews.

To help optimise your usage, you can tune cubic to get the most out of your usage limits:

Learn more →

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@austinywang I'll review the changes now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Sources/Workspace.swift (1)

4586-4614: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

.completedAgentExit also blocks the live fork path. allowsAgentContinuation(forPanelId:) sits in front of both the restored snapshot lookup and the SharedLiveAgentIndex.shared fallback, so once a panel reaches .completedAgentExit the fork/continuation UI stays disabled until some separate seed/clear path rewrites that panel state. Split the restored-session gate from live-agent discovery so a later agent in the same terminal can still be forked.

🤖 Prompt for 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.

In `@Sources/Workspace.swift` around lines 4586 - 4614, Update
allowsAgentContinuation(forPanelId:) so restored-session resume states,
including .completedAgentExit, only gate restored snapshot handling and do not
block live-agent discovery. Preserve the restored snapshot lookup behavior, but
allow the method to fall through to SharedLiveAgentIndex.shared for panels with
a later live agent, enabling fork/continuation after the original restored agent
exits.

Source: Path instructions

🤖 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 `@Sources/ContentView`+ForkAgentConversation.swift:
- Around line 154-163: Change the default value of allowsAgentContinuation from
true to false in commandPalettePanelHasForkableAgent,
commandPaletteImmediateForkExecutionSnapshot, and
commandPaletteImmediateForkExecutionSnapshotSelection, or remove the defaults to
require explicit caller decisions; update any affected call sites to pass the
intended value explicitly and preserve fail-closed behavior.

In `@Sources/Workspace`+PanelLifecycle.swift:
- Around line 414-418: Replace the duplicated restored-agent metadata removals
in the panel-close path with a call to clearRestoredAgentSnapshot(panelId:),
while retaining discardAgentRuntimeState as needed. Use the existing helper as
the single source of truth for clearing restored snapshot, resume-state, and
working-directory data.

In `@Sources/Workspace`+TitleOwnership.swift:
- Around line 82-94: In the panel-title update block, avoid calling updateTab
for an unchanged custom-title state as well as an unchanged title. Compare
panelCustomTitles[panelId] != nil with existing.hasCustomTitle, and only invoke
bonsplitController.updateTab when either value differs; pass nil for unchanged
fields where supported, mirroring the no-op guards in installSubscription and
the terminal-title branch.

---

Outside diff comments:
In `@Sources/Workspace.swift`:
- Around line 4586-4614: Update allowsAgentContinuation(forPanelId:) so
restored-session resume states, including .completedAgentExit, only gate
restored snapshot handling and do not block live-agent discovery. Preserve the
restored snapshot lookup behavior, but allow the method to fall through to
SharedLiveAgentIndex.shared for panels with a later live agent, enabling
fork/continuation after the original restored agent exits.
🪄 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: ef7f6852-ebc8-4c19-8226-b165eccfa417

📥 Commits

Reviewing files that changed from the base of the PR and between 1374b3f and 40f398d.

📒 Files selected for processing (20)
  • Sources/AppDelegate+ResolvedIconRendering.swift
  • Sources/ContentView+ForkAgentConversation.swift
  • Sources/ContentView.swift
  • Sources/DockSplitStore+SurfaceTransfer.swift
  • Sources/DockSplitStore.swift
  • Sources/ResolvedIconAppearanceObserver.swift
  • Sources/TerminalTabAgentIcon.swift
  • Sources/Workspace+AgentLifecycle.swift
  • Sources/Workspace+ForkAgentConversationAvailability.swift
  • Sources/Workspace+PanelLifecycle.swift
  • Sources/Workspace+TitleOwnership.swift
  • Sources/Workspace.swift
  • Sources/WorkspaceContentView.swift
  • Sources/cmuxApp.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/CompletedRestoredAgentForkAvailabilityTests.swift
  • cmuxTests/CompletedRestoredAgentInputRoutingTests.swift
  • cmuxTests/RemoteTmuxSessionRenameTitleTests.swift
  • cmuxTests/TerminalTabAgentIconTests.swift
  • cmuxTests/TerminalTabIconRegressionTests.swift
💤 Files with no reviewable changes (5)
  • Sources/AppDelegate+ResolvedIconRendering.swift
  • Sources/ResolvedIconAppearanceObserver.swift
  • cmuxTests/TerminalTabAgentIconTests.swift
  • Sources/cmuxApp.swift
  • Sources/TerminalTabAgentIcon.swift

Comment thread Sources/ContentView+ForkAgentConversation.swift
Comment thread Sources/Workspace+PanelLifecycle.swift
Comment thread Sources/Workspace+TitleOwnership.swift
Comment thread Sources/RestoredAgentLifecycleCoordinator.swift Outdated
Comment thread Sources/RestoredAgentLifecycleCoordinator.swift Outdated
austinywang and others added 4 commits July 10, 2026 05:30
DockTerminalReattachTests names PanelShellActivityState in a helper
signature but never imported its defining module, breaking all four
app-host unit test shards at compile time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Tart macOS-15 runner images that MACOS_RUNNER_15 now routes to have
no node on PATH, so the claude wrapper regressions in the CLI no-socket
step fail with "exec: node: not found" on every run (main has been red
since the runner flip). Pin setup-node for the focused-regression shard
so the step is self-sufficient on any runner, matching the nightly.yml
precedent for the same failure mode.

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

🤖 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 `@Sources/RestoredAgentCompletedGeneration.swift`:
- Around line 4-7: Mark the RestoredAgentCompletedGeneration struct as
nonisolated so this Sendable pure value model remains actor-agnostic under Swift
6 default isolation.
🪄 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: ca105e8e-a7b0-438f-8c57-6a045fa627ec

📥 Commits

Reviewing files that changed from the base of the PR and between 40f398d and 9c0ab58.

📒 Files selected for processing (20)
  • .github/workflows/ci.yml
  • Sources/AgentPIDProcessIdentity.swift
  • Sources/ContentView+ForkAgentConversation.swift
  • Sources/ContentView.swift
  • Sources/DockSplitStore+SurfaceTransfer.swift
  • Sources/RestorableAgentSession.swift
  • Sources/RestoredAgentCompletedGeneration.swift
  • Sources/RestoredAgentLifecycleCoordinator.swift
  • Sources/Workspace+AgentLifecycle.swift
  • Sources/Workspace+DetachedSurfaceTransfer.swift
  • Sources/Workspace+ForkAgentConversationAvailability.swift
  • Sources/Workspace+PanelLifecycle.swift
  • Sources/Workspace+TitleOwnership.swift
  • Sources/Workspace.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/CommandPaletteSearchEngineTests.swift
  • cmuxTests/CompletedRestoredAgentGenerationTests.swift
  • cmuxTests/DockPortalReconcileTests.swift
  • cmuxTests/DockTerminalReattachTests.swift
  • cmuxTests/WorkspaceUnitTests.swift

Comment on lines +4 to +7
struct RestoredAgentCompletedGeneration: Sendable {
let completedAt: TimeInterval
let processIdentities: Set<AgentPIDProcessIdentity>
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Mark this Sendable value model nonisolated.

Under Swift 6 default @MainActor isolation, this new pure value-model struct becomes implicitly main-actor-isolated even though it is Sendable and semantically actor-agnostic (it is also carried through DetachedSurfaceTransfer). Declare it nonisolated so it isn't implicitly bound to the main actor.

As per coding guidelines: "In Swift 6, mark Codable, Identifiable, Sendable, and pure value-model structs as nonisolated when they should not be implicitly @MainActor-isolated."

♻️ Proposed change
-/// Records the process generation that a restored terminal already completed.
-struct RestoredAgentCompletedGeneration: Sendable {
+/// Records the process generation that a restored terminal already completed.
+nonisolated struct RestoredAgentCompletedGeneration: Sendable {
     let completedAt: TimeInterval
     let processIdentities: Set<AgentPIDProcessIdentity>
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
struct RestoredAgentCompletedGeneration: Sendable {
let completedAt: TimeInterval
let processIdentities: Set<AgentPIDProcessIdentity>
}
/// Records the process generation that a restored terminal already completed.
nonisolated struct RestoredAgentCompletedGeneration: Sendable {
let completedAt: TimeInterval
let processIdentities: Set<AgentPIDProcessIdentity>
}
🤖 Prompt for 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.

In `@Sources/RestoredAgentCompletedGeneration.swift` around lines 4 - 7, Mark the
RestoredAgentCompletedGeneration struct as nonisolated so this Sendable pure
value model remains actor-agnostic under Swift 6 default isolation.

Source: Coding guidelines

…gent-icon-clear

# Conflicts:
#	.github/workflows/ci.yml
@austinywang austinywang merged commit 58f38dc into main Jul 10, 2026
30 checks passed
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.

Tab keeps Claude icon after quitting to plain shell — restored-agent snapshot fallback survives #7740

1 participant