Skip to content

Keep Cloud focus lookup indexed - #17995

Closed
azooz2003-bit wants to merge 2 commits into
mainfrom
fix/cloud-focus-indexed-lookup
Closed

azooz2003-bit wants to merge 2 commits into
mainfrom
fix/cloud-focus-indexed-lookup

Conversation

@azooz2003-bit

Copy link
Copy Markdown
Collaborator

Problem

Cloud pointer and input focus convergence repeatedly resolves the owning workspace on the terminal event path. The resolver then scans the manager's full workspace array, adding avoidable latency as a window accumulates workspaces and making the visible focus ring more likely to lag behind the pane receiving input.

Fix

Use TabManager.workspacesById for the final ownership lookup. The index is maintained whenever the workspace collection changes, so Cloud focus convergence remains constant time while retaining the existing ownership and retired-workspace checks.

Follow-up to #16271.

Validation

  • git diff --check
  • python3 scripts/verify-local.py --swift-changed (16/16 selected checks passed; native checks skipped on the MacBook Air)

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

Uses the maintained workspacesById index for cloud pointer and input focus ownership lookup instead of scanning the full workspace array, keeping focus convergence constant time as a window accumulates workspaces. Also moves the vmReadyPollInterval override test into the CLI target, where the CLI type lives, so cmuxTests compiles.

Written for commit 0990d11. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Performance

    • Workspace retrieval now uses a direct lookup, which can make accessing a live workspace more efficient. The behavior of workspace access remains unchanged.
  • Tests

    • Added coverage for how the CLI handles valid, missing, and invalid virtual-machine readiness polling interval settings.

Migrated from #16348 after correcting the PR author identity. The original head commit 0990d11 is preserved.

@coderabbitai

coderabbitai Bot commented Oct 6, 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 26 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: ddc359e6-82e2-4216-a5cb-7600e60220a5
📥 Commits

Reviewing files that changed from the base of the PR and between ccefb63 and 0990d11.

📒 Files selected for processing (4)
  • Sources/Surfaces/Workspace+CloudManualMirror.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxCLITests/CLIVMReadyPollIntervalTests.swift
  • cmuxTests/CLIVMTransferTests.swift
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Note

Pull Request opener @azooz2003-bit is not an author or co-author of any commit in this PR (commit identities: teamleaderleo, austinywang). The CLA check will still proceed and requires every listed identity plus @azooz2003-bit to have signed.

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

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.

2 participants