Skip to content

test: split an expression Xcode 27 cannot type-check - #13073

Closed
teamleaderleo wants to merge 2 commits into
manaflow-ai:mainfrom
teamleaderleo:test/xcode27-typecheck
Closed

teamleaderleo wants to merge 2 commits into
manaflow-ai:mainfrom
teamleaderleo:test/xcode27-typecheck

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift builds its replay bytes as Data(("…" + "…" + … ).utf8): six string literals concatenated inside one expression. On Xcode 27.0 / Swift 6.4 the type checker gives up on it: error: the compiler is unable to type-check this expression in reasonable time, at line 140, and build-for-testing for the cmux-unit scheme fails.
  • Split it into a typed String and a typed Data. Same bytes, no behaviour change.

Testing

On a MacBook Air M5, Xcode 27.0 (27A266a), xcodebuild -scheme cmux-unit -configuration Debug build-for-testing:

  • main (4c67b4d8c5): ** TEST BUILD FAILED **, the one error above (957 test files compiled before it stops).
  • with this change: ** TEST BUILD SUCCEEDED **, 0 type-check errors.

CI uses Xcode 26.3, where the original expression still compiles, so this only shows up for people who have moved to Xcode 27. Not run: the test itself (the app-host test run needs the full app test environment); the change is to how a constant is spelled, not to what the test does.

Demo Video

Not applicable: test-only change.

Checklist

  • I tested the change locally
  • I added or updated tests for behavior changes (no behaviour change)
  • I updated docs/changelog if needed (not needed)

🤖 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 cmux-unit test build on Xcode 27 by splitting a long string-concatenation expression that Swift 6.4 can't type-check. Replay bytes are identical, so there is no behavior change. CI still uses Xcode 26.3, so this only affects local Xcode 27 builds.

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

Review in cubic

Summary by CodeRabbit

  • Refactor
    • Simplified internal test data construction without changing user-visible behavior.

@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 19, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

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: 1f593dd6-7b02-4498-8832-7b61961cd192

📥 Commits

Reviewing files that changed from the base of the PR and between 02f9437 and f7b5b9b.

📒 Files selected for processing (1)
  • cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift

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


📝 Walkthrough

Walkthrough

The SSH PTY regression test now constructs its replay payload through a local replayText constant before converting the text to Data. The replay string remains unchanged.

Changes

SSH PTY replay test

Layer / File(s) Summary
Replay payload construction
cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift
The test stores the terminal-query replay string in replayText and converts it with Data(replayText.utf8).

Priority: ⬇️ Low

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

Change: Refactor

Suggested reviewers: austinywang

🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 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: splitting an expression to resolve an Xcode 27 type-checking failure.
Description check ✅ Passed The description includes a clear summary, testing details, demo-video disposition, and checklist. It omits the Review Trigger section and two review-resolution checklist items, but it remains mostly c…
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 pull request changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. It replaces one inline Data construction with typed String and Data constants. The replay string c…
Cmux Swift Actor Isolation ✅ Passed PASS. The pull request changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. The diff only splits a test fixture into typed String and Data values. It does not change production…
Cmux Swift Blocking Runtime ✅ Passed PASS: The PR changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. It refactors a test fixture from inline Data construction to typed String and Data values. The diff adds no …
Cmux Browser Automation Off-Main ✅ Passed PASS. The PR changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. It splits a replay string into typed String and Data values. The diff adds no browser.* command, WebKit/AppK…
Cmux Expensive Synchronous Load ✅ Passed PASS. The reviewed range changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. It replaces one inline string-to-Data expression with typed String and Data constants. The diff …
Cmux Cache Substitution Correctness ✅ Passed PASS: The review-scoped diff changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. It splits a test replay payload into a typed String and a typed Data; it does not replace an a…
Cmux No Hacky Sleeps ✅ Passed PASS. The authoritative diff changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. It only splits a test string expression into typed String and Data values. It introduces no sl…
Cmux Algorithmic Complexity ✅ Passed PASS. The PR changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. The change splits a fixed string construction into typed String and Data values. It adds no collection scan, s…
Cmux Swift Concurrency ✅ Passed PASS. The pull request changes only one test expression. It assigns the existing concatenated text to a typed String, then creates the same typed Data. The diff adds no Dispatch, Combine, completi…
Cmux Swift @Concurrent ✅ Passed PASS: The PR changes only the synchronous construction of replayText and replay in a test. The authoritative diff adds no async, await, nonisolated, @concurrent, @MainActor, Task, or a…
Cmux Swift Package Boundaries ✅ Passed PASS: The authoritative diff changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift, which belongs to the cmuxTests test target. The change only splits a test replay expression into…
Cmux Swiftpm Lockfiles ✅ Passed PASS. The reviewed range changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. The patch splits a test string into typed String and Data values. It does not change `Package.swif…
Cmux Swift Logging ✅ Passed PASS: The diff only refactors replay-string construction in a test. It adds no print, debugPrint, dump, NSLog, file logging, Logger declaration, or diagnostic output. The changed file is under…
Cmux User-Facing Error Privacy ✅ Passed PASS: The PR changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. It splits a test replay payload into typed String and Data values. The rule explicitly allows tests, and the d…
Cmux Full Internationalization ✅ Passed PASS. The authoritative diff changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. The changed strings are test fixture data and terminal protocol queries, not production user-facin…
Cmux Swiftui State Layout ✅ Passed PASS. The pull request changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. The diff only splits a local terminal replay expression into typed String and Data constants. It add…
Cmux Architecture Rethink ✅ Passed PASS: The diff changes only a test-local replay payload construction. It replaces one inline Data expression with a typed String and Data, while preserving the same literals and call sites. It i…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS. The PR changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift. It splits a test replay string into typed String and Data values. The diff introduces no NSWindow, NSPanel…
Cmux Source Artifacts ✅ Passed PASS. The PR changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift, a hand-written Swift test source. The added lines define a String and convert it to Data; they do not add logs…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS. The review-scoped diff changes only cmuxTests/CLISSHPTYAttachProbeReplyRegressionTests.swift, which is outside the custom check's **/Sources/** production-source scope. The patch only splits…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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.

@greptile-apps

greptile-apps Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge because the test-only refactor preserves the replay bytes while restoring compilation under Xcode 27.

Summary

The PR resolves an Xcode 27 / Swift 6.4 test-target compilation failure by assigning the replay payload to an explicitly typed String before converting its UTF-8 bytes to Data.

  • Preserves the replay payload and test behavior.
  • Reduces type-checker complexity without changing production code.
  • Introduces no repository-rule or security concerns.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into test/xcode27-ty..."

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Continued in #13126 (same commits, in-org branch test/xcode27-typecheck) so its macOS jobs run on the repository's configured runners. Push further changes to test/xcode27-typecheck on manaflow-ai/cmux, not to the fork.

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