Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between e6dbdb751ef09a1e857a09d821d95ea1c9ed6ebc and fe88b883c5f59de298fd329c6b7b866fa75389bd. 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughPTY ownership resolution now considers both live terminal layout bindings and persisted per-tab PTY mappings. Related state types and test helpers include 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0938959f-4ba3-4e83-a7d3-1b886a43bcec
📥 Commits
Reviewing files that changed from the base of the PR and between 505967e and e6dbdb751ef09a1e857a09d821d95ea1c9ed6ebc.
📒 Files selected for processing (5)
src/renderer/src/hooks/useIpcEvents.tssrc/renderer/src/lib/mobile-terminal-tab-mount.test.tssrc/renderer/src/lib/mobile-terminal-tab-mount.tssrc/renderer/src/lib/terminal-tab-for-pty-id.test.tssrc/renderer/src/lib/terminal-tab-for-pty-id.ts
Mobile focus/reveal was creating a second desktop tab for the same PTY when ownership only lived in layout or ptyIdsByTabId. Resolve ownership through all live bindings and adopt the existing tab instead of createTab (fixes stablyai#10486).
CodeRabbit on stablyai#10556: createTerminal skipped resolveTerminalTabIdForPtyId when a direct tab match existed, so stale layout duplicates could adopt the first match, and ambiguous ownership returned null which then created another tab for the same PTY. Use resolveTerminalTabPtyOwnership as the sole decision path: owned reuses the tab, none may create, ambiguous fails instead of minting a duplicate.
fe88b88 to
8baf4fa
Compare
|
Thanks for digging into this @innocarpe — your diagnosis was right, and the ownership resolver here is the shape the fix needed. I've opened #11259 with a variant. Three things I ran into building on this:
#11259 ranks bindings instead: mounted pane ( Happy to close this in favour of that one, or fold it in — your call. |
|
Closing as superseded — the linked issue(s) for this PR were fixed by another change that has already been merged.
Superseding merge: #11259 Thank you for the contribution! If anything remains unaddressed, please open a new issue or PR against current |
|
Thanks for the detailed follow-up, Brennan. I agree #11259 is the stronger fix—the handler-level regression coverage, binding ranking, and non-throwing ambiguity path address the gaps in #10556 well. With #11259 landed, closing #10556 as superseded makes sense. Glad the original diagnosis helped, and I’ll make sure future handler fixes include a regression test that fails when the wiring is reverted. |
Summary
Fixes #10486 — viewing an active host terminal from a paired mobile client no longer opens a second desktop tab with the same session.
When mobile focus/reveal asks the host to surface a live PTY, the renderer must adopt the existing tab that already owns that PTY. Ownership was only checked via
tab.ptyId/ a partial map path; if the binding lived only interminalLayoutsByTabId(or the liveptyIdsByTabIdmap was not consulted by the resolver),createTab({ initialPtyId })minted a duplicate UI tab on the same content.Changes
resolveTerminalTabIdForPtyIdalso consultsptyIdsByTabId.onCreateTerminalreuses a tab resolved via that full ownership check before creating.ptyIdsByTabIdfor consistent resolution.Test plan
terminal-tab-for-pty-id.test.ts(incl. live map ownership)mobile-terminal-tab-mount.test.tsELI5
Viewing a live desktop terminal from mobile opened a second duplicate tab on the host. The host now reuses the existing tab that already owns that session instead of creating another one.