Skip to content

fix: keep accepted Cloud cwd visible while stale - #14293

Merged
austinywang merged 4 commits into
mainfrom
issue-14290-directory-unavailable-stale
Sep 25, 2026
Merged

austinywang merged 4 commits into
mainfrom
issue-14290-directory-unavailable-stale

Conversation

@austinywang

@austinywang austinywang commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Cloud terminal rows now keep the last cwd accepted by the remote daemon while a machine refresh or reconnect is stale. The catalog reads that cached value from the accepted `CloudVMState` for the exact machine and terminal identity, so optimistic launch paths, missing cwd values, deleted resources, and retired provider callbacks still render as unavailable instead of showing an invented or local path. The Cloud tree and workspace sidebar lifecycle tests cover stale visibility, missing cwd, current recovery, provider replacement, stale callbacks, and deletion.

Closes #14290.

Testing

  • Hosted pre-fix discriminator at `97d44fddb0`: run 36065304184 executed all 15 lifecycle tests and failed the new stale-known-path assertions.
  • Hosted final-head verification at `7472de47c8`: run 36068126611 built the corrected head and passed all 15 lifecycle tests.
  • `python3 scripts/verify-local.py --only swift-syntax --swift-changed origin/main`
  • `python3 scripts/verify-local.py --only test-wiring`
  • `python3 scripts/swift_file_length_budget.py`
  • `./scripts/localize-changes`
  • `python3 scripts/localization_catalog.py check`

No clean-environment visual flow or developer build was needed for this deterministic catalog presentation fix.

Demo Video

Not included; the behavior is covered by the hosted lifecycle suite and uses the existing localized sidebar presentation.

— CedarKite · pending
run: run_issue_14290_directory_stale_20260924
session: cmux175-14290-20260924

@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 24, 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: f95ac4a0-d60f-4d18-b65a-db2697cf78b1

📥 Commits

Reviewing files that changed from the base of the PR and between 9045f37 and 7472de4.

📒 Files selected for processing (1)
  • Sources/Surfaces/SurfaceCatalog+CloudDirectoryMetadata.swift

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


📝 Walkthrough

Walkthrough

Cloud terminal directory presentation retains a previously accepted remote cwd during stale observations. Missing or blank paths remain unavailable. Lifecycle tests cover stale snapshots, reconnects, provider replacement, and terminal deletion.

Changes

Cloud directory freshness

Layer / File(s) Summary
Project and display accepted stale directories
Sources/Surfaces/SurfaceCatalog+CloudDirectoryMetadata.swift, Sources/Cloud/CloudTreeTerminalRow+Directory.swift, cmuxTests/CloudDirectoryLifecycleTests.swift
Stale Cloud terminal projections and rows use a cached cwd only when an accepted terminal path exists. Tests cover unavailable paths, reconnects, provider replacement, and terminal deletion.

Priority: ⬇️ Low

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: teamleaderleo

Merge Risk: ⚪ Minimal · up to 7472d

Stale Cloud terminal rows retain an accepted remote directory, while missing directories remain unavailable. No actionable merge risk was identified in the reviewed changes.

🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue [#14290] requires retaining a known remote cwd during stale Cloud refresh or reconnect, preserving the unavailable state when no valid cwd exists, recovering current data, and handling provider …
Out of Scope Changes check ✅ Passed The production changes are limited to Cloud directory presentation and stale directory metadata. The tests cover the lifecycle cases required by [#14290], including stale state, provider replacement, …
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS. The review-scoped diff changes only Cloud directory presentation metadata and lifecycle tests. It does not change Cloud terminal creation, cmux-tui clients, physical transports, readiness gates,…
Cmux Swift Actor Isolation ✅ Passed The production diff adds no actor-isolated model, service protocol, Sendable reference type, or background access. The new SurfaceCatalog helper and metadata calls belong to the existing @MainActor Su…
Cmux Swift Blocking Runtime ✅ Passed The PR changes two production Swift files and one test file. The production diff only trims and projects cached Cloud cwd values and removes a freshness guard from directory presentation. It adds no s…
Cmux Browser Automation Off-Main ✅ Passed The PR changes only Cloud directory presentation and lifecycle tests. The authoritative diff contains no browser socket commands, WebKit waits, worker-router changes, main-actor routing changes, or br…
Cmux Expensive Synchronous Load ✅ Passed PASS. The production diff changes Cloud cwd presentation only. It reads an accepted in-memory CloudVMState.lookupIndex entry, trims the string, and updates the existing metadata projection. `resourc…
Cmux Cache Substitution Correctness ✅ Passed The diff does not replace a fresh disk/database read in a persistence, history, undo, or snapshot path. It adds an explicit, event-driven CloudVMState lookup for stale UI/catalog presentation. Cold st…
Cmux No Hacky Sleeps ✅ Passed PASS. The pull request changes only three Swift files. The custom rule applies to TypeScript, JavaScript, shell, and non-Swift build/runtime scripts. No covered non-Swift delay or sleep change exists …
Cmux Algorithmic Complexity ✅ Passed The production diff does not introduce a prohibited complexity pattern. acceptedStaleCloudDirectory performs direct dictionary lookups through cloudStates and CloudVMStateIndex.terminalsByID, so…
Cmux Swift Concurrency ✅ Passed The changed Swift code adds no legacy async pattern covered by the check. The production changes are synchronous directory lookup and projection logic in acceptedStaleCloudDirectory, `resourceForPre…
Cmux Swift @Concurrent ✅ Passed The PR changes only synchronous Swift code and lifecycle test assertions. The diff introduces no async, nonisolated, @concurrent, actor-isolation, or heavy async helper call-site changes. `resou…
Cmux Swift Package Boundaries ✅ Passed The production diff stays within app-lifecycle and presentation code. acceptedStaleCloudDirectory(for:) is a private helper on the existing @MainActor SurfaceCatalog; it reads catalog-owned Clou…
Cmux Swiftpm Lockfiles ✅ Passed The pull request changes only two Swift source files and one test file. It does not change Package.swift, Package.resolved, .gitignore, workflow files, or Xcode package references. Therefore, the Swif…
Cmux Swift Logging ✅ Passed The PR changes two production Swift files and one test file. The added and modified lines contain no print, debugPrint, dump, NSLog, Logger, file logging, or stdout/stderr diagnostics. The p…
Cmux User-Facing Error Privacy ✅ Passed PASS. The production diff changes Cloud directory selection and retains an accepted remote cwd during stale state. The value reaches the terminal tooltip and sidebar, but the diff adds no upstream ven…
Cmux Full Internationalization ✅ Passed The production diff changes stale Cloud directory data flow only. It adds no new user-facing copy, localization key, catalog entry, web message, or locale file. The existing fallback remains `String(l…
Cmux Swiftui State Layout ✅ Passed PASS. The PR changes pure directory presentation logic and lifecycle tests. It adds no ObservableObject, @Published, @StateObject, @EnvironmentObject, GeometryReader, lazy/list row store reference, or…
Cmux Architecture Rethink ✅ Passed PASS. The production diff is a local correctness fix owned by SurfaceCatalog. acceptedStaleCloudDirectory reads the existing accepted cloudStates graph and cloudStateObservations; it adds no m…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS. The PR changes only Cloud directory presentation logic and lifecycle tests in three Swift files. The diff adds no NSWindow, NSPanel, NSWindowController, SwiftUI Window, WindowGroup, window ident…
Cmux Source Artifacts ✅ Passed The diff changes only two hand-written Swift source files and one Swift lifecycle test. No local logs, screenshots, recordings, caches, build output, dependency checkout, temp directory, broad scratch…
Cmux No Test Or Debug Seam In Production Source ✅ Passed The PR changes two production Swift files, but neither adds a test-build guard, debug/test-named member, visibility widening, or wrapper accessor for test observation. The new `private func acceptedSt…
Title check ✅ Passed The title clearly and concisely summarizes the primary change: preserving the accepted Cloud cwd while the state is stale.
Description check ✅ Passed The description includes a clear summary, detailed testing results, and an explicit rationale for omitting a demo video. The repository checklist is not included, but the core required information is …
  • 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.

@austinywang
austinywang merged commit 57d3d7c into main Sep 25, 2026
59 checks passed
@austinywang
austinywang deleted the issue-14290-directory-unavailable-stale branch September 25, 2026 00:39
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 25, 2026
488b058 ci: count the 12vcpu macOS pool at 5 machines, the most it ran with a queue (manaflow-ai#14330)
bcb162c Merge pull request manaflow-ai#14121 from manaflow-ai/issue-13640-terminal-paste-latency
24efd87 test(focus-recovery): run the automatic apply against a pinned tiny surface (manaflow-ai#14322)
57d3d7c Merge pull request manaflow-ai#14293 from manaflow-ai/issue-14290-directory-unavailable-stale
e1a5ea3 ci: never abandon a run the owned pool rescue cancelled (manaflow-ai#14326)
a76f47a web: contain Hexclave failures on every page (manaflow-ai#14316)
fc7f80d ci: start macOS compile admission beside the fast Linux jobs (manaflow-ai#14314)
85f3d9f ci: roll a PR run over to the next pool when one is full (manaflow-ai#14323)
04e8a05 ci: let E2E runs take an owned Mac with a free slot (manaflow-ai#14311)
034025f reload: resolve the cmux-tui client before the build (manaflow-ai#14313)
7472de4 fix: pass projected resource to stale cwd resolver
9045f37 Merge remote-tracking branch 'origin/main' into issue-14290-directory-unavailable-stale
51a9004 fix: retain accepted Cloud cwd while stale
97d44fd test: retain known Cloud cwd during stale refresh
f6df46e fix: retain rich text fallback for lossy paste data
f3f43ed fix: retain rich text fallback for lossy paste data
5d8258b test: preserve rich paste fallback and text fidelity
a9c54ba fix: keep mixed rich text paste on the fast plain-text path
d284b6a test: cover fast paste for mixed plain and HTML clipboard

# Conflicts:
#	.github/workflows/ci-guards.yml
#	.github/workflows/ci-macos.yml
#	.github/workflows/ci-owned-pool-rescue.yml
#	.github/workflows/ci.yml
#	.github/workflows/test-e2e.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.

Cloud workspace intermittently shows Directory unavailable

1 participant