Repository navigation
Fix main CI Swift file length budget - #3676
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR extends the events subcommand with full CLI option parsing, event-stream frame handling, and cursor-based resumption. A new process execution utility provides subprocess management with timeout support. The ChangesEvents Command & Process Execution
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR extracts two groups of helpers out of
Confidence Score: 5/5Safe to merge — all moved code is byte-for-byte identical to what was removed, the Xcode project is wired correctly, and the only access-level changes are the minimum needed to cross Swift's file-private boundary. The change is a pure extraction: no logic is added, removed, or reordered. The two access changes (private to implicit internal on authenticateClientIfNeeded and runEventsCommand) are structurally required and have no effect outside the CLI app target. The new file stays well within file-boundary thresholds, and the pre-existing DispatchSemaphore in the process runner is covered by the blocking-runtime rule's explicit exception for existing, unmoved code. No files require special attention; all four changed files contain straightforward mechanical moves with no logic alterations. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["CLI/cmux.swift\n(main entry, SocketClient, CMUXCLI body)"]
B["CLI/CMUXCLI+Events.swift\n(runEventsCommand, cursor r/w,\nframe parsing, int64Value,\nwaitBeforeReconnect)"]
C["CLI/CMUXCLI+Process.swift\n(CLIProcessResult,\nCLIProcessRunner.runProcess)"]
A -->|"calls internal\nauthenticateClientIfNeeded"| B
A -->|"calls internal\nrunEventsCommand"| B
A -->|"calls static\nCLIProcessRunner.runProcess"| C
B -->|"calls internal\nauthenticateClientIfNeeded\n(defined in cmux.swift)"| A
style B fill:#d4edda,stroke:#28a745
style C fill:#d4edda,stroke:#28a745
style A fill:#fff3cd,stroke:#ffc107
Reviews (1): Last reviewed commit: "Split CLI helpers to restore main CI bud..." | Re-trigger Greptile |
Main CI is failing in the workflow guard because CLI/cmux.swift grew past its file length budget: https://github.com/manaflow-ai/cmux/actions/runs/25471460485\n\nThis splits the event command helpers and process runner out of CLI/cmux.swift without changing behavior.\n\nVerification:\n- ./scripts/swift_file_length_budget.py --budget .github/swift-file-length-budget.tsv\n- xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux-cli -configuration Debug -destination 'platform=macOS' -derivedDataPath /tmp/cmux-fix-main-ci-cli-budget-cli build
Note
Low Risk
Primarily a refactor to move existing CLI helper code into separate files; behavior should be unchanged aside from possible access-level/compilation integration issues.
Overview
Refactors the CLI to satisfy the Swift file-length budget by moving the
eventscommand implementation (option parsing, frame parsing, cursor read/write, reconnect logic) out ofCLI/cmux.swiftintoCMUXCLI+Events.swift.Extracts the process execution utilities (
CLIProcessRunner/CLIProcessResult) into a newCMUXCLI+Process.swift, updates Xcode project sources accordingly, and relaxesauthenticateClientIfNeededvisibility so the extractedeventscode can call it.Reviewed by Cursor Bugbot for commit 061c2b3. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes main CI failure by bringing
CLI/cmux.swiftback under the file-length budget. Extracts event streaming and process runner code into dedicated files with no behavior changes.CLI/CMUXCLI+Events.swift(options parsing, cursor I/O, frame parsing, reconnect/backoff).CLI/CMUXCLI+Process.swiftwithCLIProcessRunnerandCLIProcessResult; removed fromCLI/cmux.swiftand updated the project file.CMUXCLI.authenticateClientIfNeedednon-private so extensions can call it.Written for commit 061c2b3. Summary will update on new commits.
Summary by CodeRabbit