Skip to content

revert(mobile): hold the relay reconnect path and cache-first reconnect for a separate mobile pass - #19265

Merged
Jinwoo-H merged 2 commits into
mainfrom
revert/mobile-relay-connect-lanes
Sep 7, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
revert/mobile-relay-connect-lanes

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​74 $\color{#cf222e}{\Huge{\mathbf{−}}}$​899 $\color{#cf222e}{\Huge{\mathbf{−}}}$​825
Prod 22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​91 $\color{#cf222e}{\Huge{\mathbf{−}}}$​756 $\color{#cf222e}{\Huge{\mathbf{−}}}$​665

Reverts #19258 and #19236. Both were merged as part of the relay connect-speed work; the owner wants mobile and desktop changes reviewed in a separate pass, and neither is a pure fix (#19236 is a reconnect-path perf change, #19258 is a cache-first reconnect feature).

The cloud-side changes (#19232, #19241) stay: they are additive and do not depend on either mobile change.

The original branches remain open for the mobile pass: mobile/relay-connect-critical-path and mobile/cache-first-reconnect.

@pullfrog

pullfrog Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Pullfrog  | View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit d74f8cb into main Sep 7, 2026
22 of 23 checks passed
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The mobile session UI no longer persists or renders cached tab-strip previews. It renders live tabs directly and uses the standard loading state during reconnects. Relay sessions now publish connected after resume confirmation and capability negotiation. Relay liveness uses one probe profile. Direct probing holds the operation mutex across dialing, and relay recovery uses a pending replacement flag instead of an intent queue.

Merge Risk: 🟡 Moderate · up to 7e50c

Some reconnecting sessions can appear blank instead of showing loading feedback, and rejected direct probes can duplicate disconnect processing. Resolve these before merge to avoid confusing reconnect behavior and transport side effects.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the revert scope and rationale, but it does not use the required template sections or provide the required linked issue, visual proof statement, testing details, checklist sta… Complete the required template sections: ELI5, What Changed, Why, Linked Issue with a valid Fixes # reference, Visual Proof or N/A with a reason, Testing with manual and automated test details, AI Disclosure, Review, Agent skill upstream bo…
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 12 functions across 14 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the mobile relay reconnect and cache-first reconnect changes being reverted for separate review.
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.
Full details: Description check

Explanation

The description explains the revert scope and rationale, but it does not use the required template sections or provide the required linked issue, visual proof statement, testing details, checklist status, and review notes.

Resolution

Complete the required template sections: ELI5, What Changed, Why, Linked Issue with a valid Fixes # reference, Visual Proof or N/A with a reason, Testing with manual and automated test details, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Preserve the existing explanation of the reverted PRs and separate mobile review scope.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 855390fa-9859-4209-8a0f-18264b48b33f

📥 Commits

Reviewing files that changed from the base of the PR and between 0ba7f8d and 7e50ca9.

📒 Files selected for processing (32)
  • mobile/src/cache/session-tab-strip-cache.test.ts
  • mobile/src/cache/session-tab-strip-cache.ts
  • mobile/src/session/MobileSessionActiveContent.tsx
  • mobile/src/session/MobileSessionHeader.tsx
  • mobile/src/session/mobile-session-frame-styles.ts
  • mobile/src/session/mobile-session-reconnect-view-state.test.ts
  • mobile/src/session/mobile-session-reconnect-view-state.ts
  • mobile/src/session/mobile-session-route-parity.test.ts
  • mobile/src/session/mobile-session-route-source-family.test-support.ts
  • mobile/src/session/mobile-session-tab-strip-entries.ts
  • mobile/src/session/use-mobile-session-controller.ts
  • mobile/src/session/use-mobile-session-presentation.ts
  • mobile/src/session/use-mobile-session-tab-strip-cache.ts
  • mobile/src/transport/host-removal-lifecycle.test.ts
  • mobile/src/transport/host-removal-lifecycle.ts
  • mobile/src/transport/mobile-direct-return-probe.ts
  • mobile/src/transport/mobile-endpoint-lifecycle.ts
  • mobile/src/transport/mobile-endpoint-supervisor-contract.ts
  • mobile/src/transport/mobile-endpoint-supervisor-direct-probe.test.ts
  • mobile/src/transport/mobile-endpoint-supervisor-test-fakes.ts
  • mobile/src/transport/mobile-endpoint-supervisor.test.ts
  • mobile/src/transport/mobile-endpoint-supervisor.ts
  • mobile/src/transport/mobile-relay-credential-rotation.ts
  • mobile/src/transport/mobile-relay-rpc-session-liveness.test.ts
  • mobile/src/transport/mobile-relay-rpc-session.test.ts
  • mobile/src/transport/mobile-relay-rpc-session.ts
  • mobile/src/transport/mobile-relay-runtime-failover.test.ts
  • mobile/src/transport/mobile-relay-session-establisher.ts
  • mobile/src/transport/relay-recovery-intent-queue.ts
  • mobile/src/transport/rpc-session-liveness-watchdog.ts
  • mobile/src/transport/unpaired-host-credential-deletion.test.ts
  • mobile/src/transport/unpaired-host-credential-deletion.ts
💤 Files with no reviewable changes (18)
  • mobile/src/transport/relay-recovery-intent-queue.ts
  • mobile/src/transport/host-removal-lifecycle.ts
  • mobile/src/session/mobile-session-frame-styles.ts
  • mobile/src/transport/unpaired-host-credential-deletion.test.ts
  • mobile/src/transport/mobile-relay-credential-rotation.ts
  • mobile/src/transport/unpaired-host-credential-deletion.ts
  • mobile/src/transport/mobile-endpoint-supervisor-test-fakes.ts
  • mobile/src/transport/mobile-endpoint-supervisor.test.ts
  • mobile/src/session/use-mobile-session-tab-strip-cache.ts
  • mobile/src/session/mobile-session-reconnect-view-state.ts
  • mobile/src/session/mobile-session-route-source-family.test-support.ts
  • mobile/src/transport/mobile-endpoint-supervisor-direct-probe.test.ts
  • mobile/src/cache/session-tab-strip-cache.ts
  • mobile/src/transport/host-removal-lifecycle.test.ts
  • mobile/src/cache/session-tab-strip-cache.test.ts
  • mobile/src/session/mobile-session-reconnect-view-state.test.ts
  • mobile/src/session/mobile-session-tab-strip-entries.ts
  • mobile/src/transport/mobile-relay-runtime-failover.test.ts

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

<Text style={styles.emptyText}>{reconnectViewState.label}</Text>
</View>
) : showLoadingState ? (
return showLoadingState ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🤖 get_repo_knowledge executed:

get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions

Length of output: 15546


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- changed file diff ---'
git diff -- mobile/src/session/MobileSessionActiveContent.tsx
printf '%s\n' '--- component ---'
cat -n mobile/src/session/MobileSessionActiveContent.tsx
printf '%s\n' '--- related symbols ---'
rg -n -S "MobileSessionActiveContent|showLoadingState|connState|reconnect|visibleTabs|tabsLoaded" mobile/src mobile --glob '*.{ts,tsx}' | head -250

Repository: stablyai/orca

Length of output: 39426


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- session files ---'
fd -t f . mobile/src/session | sort
printf '%s\n' '--- controller state definitions and return ---'
rg -n -C 12 -S "showLoadingState|showEmptyState|activePendingTerminalTab|isPendingTerminalRecoveryParked|connState" mobile/src/session --glob '*.{ts,tsx}'
printf '%s\n' '--- connection state contract and client state transitions ---'
rg -n -C 8 -S "type ConnectionState|ConnectionState|reconnecting|handshaking|connecting|disconnected" mobile/src/transport mobile/src --glob '*.{ts,tsx}' | head -260

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- files defining the presentation flags ---'
rg -l -S "showLoadingState|showEmptyState" mobile/src/session --glob '*.{ts,tsx}' | sort
printf '%s\n' '--- exact flag definitions ---'
rg -n -B 20 -A 30 -S "showLoadingState|showEmptyState" mobile/src/session --glob '*.{ts,tsx}' | head -180
printf '%s\n' '--- connection type ---'
rg -n -B 5 -A 12 -S "export type ConnectionState|type ConnectionState" mobile/src/transport mobile/src --glob '*.ts' | head -80
printf '%s\n' '--- session controller composition ---'
rg -n -B 8 -A 16 -S "useMobileSessionController|MobileSessionController" mobile/src/session --glob '*.{ts,tsx}' | head -180

Repository: stablyai/orca

Length of output: 34943


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- current and parent presentation component ---'
git show HEAD:mobile/src/session/MobileSessionActiveContent.tsx | sed -n '70,115p'
git show HEAD~1:mobile/src/session/MobileSessionActiveContent.tsx | sed -n '70,125p'
printf '%s\n' '--- presentation inputs and active-tab derivation ---'
rg -n -B 12 -A 35 -S "activeMarkdownTab|activeFileTab|activeBrowserTab|activePendingTerminalTab|visibleTabs|terminalsLoaded" mobile/src/session/use-mobile-session-screen-state.ts mobile/src/session/use-mobile-session-foundation.ts mobile/src/session --glob '*.{ts,tsx}' | head -260
printf '%s\n' '--- reconnect lifecycle around session tabs ---'
rg -n -B 12 -A 22 -S "connState !== 'connected'|connState === 'connected'|fetchSessionTabs|applySessionTabs|lastKnown|cached" mobile/src/session/use-mobile-session-tabs-reconciliation.ts mobile/src/session/use-mobile-session-tab-reconciliation.ts mobile/src/session/use-mobile-session-screen-state.ts mobile/src/session --glob '*.{ts,tsx}' | head -260

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- exact visible-tab and active-tab definitions ---'
rg -n -l -S "const visibleTabs|const activeMarkdownTab|activePendingTerminalTab|activeBrowserTab" mobile/src/session --glob '*.{ts,tsx}' | sort
for f in $(rg -l -S "const visibleTabs|const activeMarkdownTab|activePendingTerminalTab|activeBrowserTab" mobile/src/session --glob '*.{ts,tsx}' | sort); do
  echo "--- $f"
  rg -n -B 18 -A 28 -S "const visibleTabs|const activeMarkdownTab|activePendingTerminalTab|activeBrowserTab|activeFileTab" "$f"
done
printf '%s\n' '--- terminal frame fallback semantics ---'
sed -n '168,245p' mobile/src/session/MobileSessionActiveContent.tsx

Repository: stablyai/orca

Length of output: 19837


Restore loading feedback during reconnect.

When connState is 'reconnecting' and no active tab or terminal exists, both showLoadingState and showEmptyState are false. The component then renders an empty terminalFrame with no loading indicator. Include the reconnecting, no-tabs case in the loading branch.

// Both early returns leave the candidate to the finally, which owns it until
// migration takes over — closing here too would double-close it.
if (!this.hooks.hysteresis.recordDirectSuccess(this.deps.now())) {
successful.client.close()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Avoid the redundant close() call.

When hysteresis rejects a direct candidate, successful.client.close() runs before finally. The finally block calls close() again. DirectRpcClient.close() still publishes disconnected and rejects pending requests on the second call. Clear successful after the first call.

       if (!this.hooks.hysteresis.recordDirectSuccess(this.deps.now())) {
         successful.client.close()
+        successful = null
         return
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
successful.client.close()
successful.client.close()
successful = null

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