Skip to content

test: create cwd fixtures that new terminals resolve on disk - #16538

Merged
teamleaderleo merged 3 commits into
mainfrom
fix/cwd-tmp-regression
Oct 2, 2026
Merged

teamleaderleo merged 3 commits into
mainfrom
fix/cwd-tmp-regression

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

#16248 changed RemoteTerminalWorkingDirectoryResolver on purpose. A missing local startup cwd now resolves to its nearest existing parent, so a restored agent cannot resume in another workspace's directory. Several tests passed made-up paths such as /tmp/cmux-split-startup-<uuid> or /repo/left/live to splits, new tabs, respawn and surface.create. Those paths now resolve to /tmp or /, so the tests failed.

The product change is intended and has its own coverage. This PR leaves it alone and makes the affected tests create their directories:

  • WorkspaceTerminalWorkingDirectoryFallbackTests.newTerminalSurfaceFallsBackToRequestedWorkingDirectoryWhenReportedDirectoryIsStale
  • WorkspaceSplitStartupCommandTests split and respawn tests
  • WorkspaceTerminalTabWorkingDirectoryTests: Cmd+T after restore, new terminal to right, surface.create
  • WorkspacePanelGitBranchTests.testSidebarBranchDirectoryEntriesStayStableAcrossFocusedSplitChanges, which showed the extra / entry

Testing

CI; no local build per team rule. swiftc -parse passes on each edited test file.

Changelog

none

🤖 Generated with Claude Code

https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK


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 tests that broke after #16248, which changed RemoteTerminalWorkingDirectoryResolver to resolve a missing local startup cwd to its nearest existing parent. Tests passed made-up paths such as /tmp/cmux-split-startup-<uuid> or /repo/left/live, which now resolve to /tmp or / and fail. The affected tests now create their directories on disk before exercising splits, new tabs, respawn, surface.create, and the sidebar branch directory test. No product behavior changes.

Written for commit 2fdf4cc. Summary will update on new commits.

Review in cubic

#16248 resolves a missing local startup cwd to its nearest existing
parent, so tests that requested fake /tmp or /repo paths saw "/tmp" or
"/". Create those directories so the tests keep checking inheritance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 3225b246-4a0e-48f8-bb8a-f948e55f88a4

📥 Commits

Reviewing files that changed from the base of the PR and between 8b8762a and 2fdf4cc.

📒 Files selected for processing (4)
  • cmuxTests/WorkspaceSplitStartupCommandTests.swift
  • cmuxTests/WorkspaceTerminalTabWorkingDirectoryTests.swift
  • cmuxTests/WorkspaceTerminalWorkingDirectoryFallbackTests.swift
  • cmuxTests/WorkspaceUnitTests.swift
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

Copy link
Copy Markdown
Collaborator Author

Subagent review at a2f4c9e: approve. #16248 intentionally resolves a missing local cwd to its nearest existing parent; see its test missingLocalRestoreDirectoryUsesItsNearestExistingParent. The resolver doesn't canonicalise symlinks, so the created temp dirs come back unchanged. Each defer cleanup is registered right after its create. The newly throws XCTest methods are still discovered. The sidebar test now asserts against real absolute temp dirs.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

CI failure attribution

CI passes on 2fdf4cc06a (run 36944182095 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.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="cmuxTests/WorkspaceUnitTests.swift">

<violation number="1" location="cmuxTests/WorkspaceUnitTests.swift:7497">
P3: This PR touches a non-UI unit test in `cmuxTests` and leaves it in `XCTestCase`, but repo policy prefers Swift Testing for touched tests even in files that already contain XCTestCase suites (file-level mixing is accepted when suites are separated). Convert the touched tests to a `@Suite`/`@Test` block, as `WorkspaceTerminalTabWorkingDirectoryTests.swift` already does in the same PR.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

}

func testSidebarBranchDirectoryEntriesStayStableAcrossFocusedSplitChanges() {
func testSidebarBranchDirectoryEntriesStayStableAcrossFocusedSplitChanges() throws {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This PR touches a non-UI unit test in cmuxTests and leaves it in XCTestCase, but repo policy prefers Swift Testing for touched tests even in files that already contain XCTestCase suites (file-level mixing is accepted when suites are separated). Convert the touched tests to a @Suite/@Test block, as WorkspaceTerminalTabWorkingDirectoryTests.swift already does in the same PR.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At cmuxTests/WorkspaceUnitTests.swift, line 7497:

<comment>This PR touches a non-UI unit test in `cmuxTests` and leaves it in `XCTestCase`, but repo policy prefers Swift Testing for touched tests even in files that already contain XCTestCase suites (file-level mixing is accepted when suites are separated). Convert the touched tests to a `@Suite`/`@Test` block, as `WorkspaceTerminalTabWorkingDirectoryTests.swift` already does in the same PR.</comment>

<file context>
@@ -7494,12 +7494,20 @@ final class WorkspacePanelGitBranchTests: XCTestCase {
     }
 
-    func testSidebarBranchDirectoryEntriesStayStableAcrossFocusedSplitChanges() {
+    func testSidebarBranchDirectoryEntriesStayStableAcrossFocusedSplitChanges() throws {
         let workspace = Workspace()
-        let leftLiveDirectory = "/repo/left/live"
</file context>

@cursor

cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Green at 2fdf4cc; landing. Resource check: test-only. Each test creates a few empty temp directories and removes them in defer. No product code changes, so no runtime CPU, memory or disk impact.

@teamleaderleo
teamleaderleo merged commit 7dceaac into main Oct 2, 2026
51 checks passed
@teamleaderleo
teamleaderleo deleted the fix/cwd-tmp-regression branch October 2, 2026 00:31
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

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

rustybret pushed a commit to rustybret/bmux that referenced this pull request Oct 2, 2026
0bfd027 test(cloud): fix the Cloud header and moved-panel focus tests that never ran (manaflow-ai#16539)
c5c4345 localization: accept numbered placeholders in any order (manaflow-ai#16376)
456edeb fix(settings): replace custom sidebar mockups with real previews (manaflow-ai#16569)
98dc3ab Prototype: cmux Cloud as a remote MCP server (manaflow-ai#16568)
6c22525 test(remote): isolate tmux stale-surface fixture (manaflow-ai#16566)
3ec9918 Re-land "fix(coderouter): initialize Cloud VM account pools (manaflow-ai#16397)" (manaflow-ai#16572)
2b895a5 Fix browser paste routing with terminal text box beta (manaflow-ai#6380) (manaflow-ai#16560)
2bd3455 localization: check Swift defaultValue literals against their catalog en value (manaflow-ai#16396)
c43086e test(cli): expect --mark-read to mark every listed inbox message (manaflow-ai#16537)
fcda4f0 test(feed): wait for zero-wait Codex permission acceptance before checking attention (manaflow-ai#16536)
7d57a03 fix(remote): evict stale persistent SSH bridge leases (manaflow-ai#16558)
d630cb8 docs: add protected-folder diagnostics for tmux sessions (manaflow-ai#12219)
7dceaac test: create cwd fixtures that new terminals now resolve on disk (manaflow-ai#16538)
28cc575 docs: cover surface resume binding CLI contract (manaflow-ai#16473)
5c7dca1 Fix idle zsh PR probes triggering chpwd hooks (manaflow-ai#16553)

# Conflicts:
#	.github/workflows/ci-guards.yml
teamleaderleo added a commit that referenced this pull request Oct 2, 2026
#16248 resolves a missing local startup cwd to its nearest existing
parent, so a split from a made-up /tmp path now inherits "/tmp". #16538
fixed the other tests with this pattern; this one was missed.

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