Repository navigation
fix(mobile): the page offers no control whose only effect is a re-dial it cannot make - #22326
Conversation
…ng dials Six failed-load screens share one Retry shape: re-dial a host that is not connected, otherwise re-read. On the page the re-dial is inert (`client-context.web.tsx:55`) and each screen's load already re-runs when the shell's client reconnects, so in the disconnected state that Retry did nothing at all. `connectionRetryAction` makes the decision once and answers null when a re-dial is needed and none exists; agent history, the file explorer root, the file preview, git history, the source-control status gate and the diff review render no Retry for null. The explorer's per-folder Retry keeps its control: it queues the folder, and the queue drains on the next `connected` whoever brought it back. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
`forceReconnect` on the page was `() => Promise.resolve()`: the shell owns the connection and nothing in the document can re-dial it. The host header's Reconnect and the session header's "tap to retry" were wired to it and did nothing there. The context member is now nullable and the page's provider hands out null, so the compiler found every caller: both headers render no reconnect affordance for null, and the session status keeps the verdict label without promising a tap. Native providers and the recording adapters still pass a function, so nothing a phone renders changes. The session route's host-JSX parity hash moves for the header's extra null check; the page test doubles that stubbed the old inert re-dial now stub null. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Three comments and the banner's override reason still said the page's `forceReconnect` was an inert `() => Promise.resolve()`, and cited `client-context.web.tsx` lines the previous commit moved. They now say null and point at the lines that hold it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
`connection-retry-action.ts` is the one module the Retry fix adds to the session route's page closure, reached through the explorer, source control and git history it docks. Measured on this head with all five generators run first, and diffed against the pre-change closure: one local module added, none removed. Session route closure 4207 -> 4208 modules, local 1021 -> 1022. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The push fence excluded `runtime-capability-probe.ts` because the session route and the host screen run it. The session half holds, and the probe works there: `status.get` carries no client identity and makes no write, the shell forwards it like any non-`native.` request, and the desktop's mobile allowlist admits it. The host-screen half no longer does: `codex-reset-credit-capability.ts` is reached only from `accounts.tsx`, which the bundle carries and the page hands to the native screen. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The formatter wrapped the cast onto the line after the disable comment, which left it uncovered. The cast now sits on its own line directly below the SAFETY note. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Conflicts: - config/scripts/mobile-web-app-session-terminal-closure.test.mjs: main's two paragraphs (terminal submit seam, page Back claim) kept first in landing order; this branch's Retry-decision paragraph re-measured on top. Session route closure 4211 -> 4212 modules, local 1025 -> 1026: the one joiner is src/transport/connection-retry-action.ts, this branch's only new source file, found in the measured closure list. - mobile/src/session/mobile-session-route-parity.test.ts: host-JSX hash moved by both sides (the dock fields' submit seam and the header's reconnect null check); set from the measured value on the merged head. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…doff reads Main's page route handoff now subscribes to `usePathname` (#22300), and the Retry suite this branch added mounts that handoff with an `expo-router` mock that lacked it. Same one-line addition main made to the back-handoff suite. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe transport contract now represents Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is identified in the supplied review context. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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: Advanced
Run ID: ec34e39d-b172-43de-9c3a-a7e7ca0e5e8a
📒 Files selected for processing (49)
config/scripts/mobile-web-app-push-subsystem-closure.test.mjsconfig/scripts/mobile-web-app-session-terminal-closure.test.mjsmobile/app/h/[hostId]/edit.tsxmobile/src/agent-history/MobileAgentSessionHistoryPanel.tsxmobile/src/agent-history/agent-history-back-handoff.test.tsxmobile/src/agent-history/agent-history-retry.test.tsxmobile/src/agent-history/use-mobile-agent-history-state.tsmobile/src/browser/use-browser-binary-screencast-grant.web.test.tsxmobile/src/components/AuthFailedBannerActions.tsxmobile/src/components/AuthFailedBannerActions.web.tsxmobile/src/components/MobileDiffReviewBody.tsxmobile/src/components/MobileDiffReviewScreenView.tsxmobile/src/components/auth-failed-banner-actions-page.test.tsxmobile/src/components/use-html-preview-link-grant.web.test.tsxmobile/src/files/MobileFileExplorerPanel.test.tsmobile/src/files/MobileFileExplorerPanel.tsxmobile/src/files/MobileFilePreviewBody.tsxmobile/src/files/MobileFilePreviewScreen.tsxmobile/src/files/mobile-file-preview-retry.test.tsxmobile/src/home/MobileHomeScreen.tsxmobile/src/host-screen/host-screen-header-reconnect.test.tsxmobile/src/host-screen/host-screen-header.tsxmobile/src/host-screen/host-workspace-list.tsxmobile/src/mobile-web-shell/bridge/use-native-verbs.test.tsxmobile/src/navigation/route-handoff.web.test.tsxmobile/src/platform/clipboard.web.test.tsxmobile/src/platform/dictation-capture-bridge-budget.test.tsxmobile/src/platform/dictation-capture.web.test.tsxmobile/src/platform/media-picker.web.test.tsxmobile/src/session/MobileSessionHeader.tsxmobile/src/session/mobile-dictation-mic-control.web.test.tsxmobile/src/session/mobile-diff-review-retry.test.tsxmobile/src/session/mobile-session-connection-retry.test.tsxmobile/src/session/mobile-session-route-parity.test.tsmobile/src/session/use-mobile-diff-review-controller.tsmobile/src/session/use-mobile-diff-review-interactions.tsmobile/src/session/use-mobile-session-presentation.tsmobile/src/source-control/MobileGitHistoryList.test.tsxmobile/src/source-control/MobileGitHistoryList.tsxmobile/src/source-control/MobileSourceControlPanel.tsxmobile/src/source-control/source-control-status-retry.test.tsxmobile/src/transport/client-context.web.test.tsxmobile/src/transport/client-context.web.tsxmobile/src/transport/connection-retry-action.test.tsmobile/src/transport/connection-retry-action.tsmobile/src/transport/force-reconnect-page-seam.test.tsxmobile/src/transport/host-client-hooks.tsmobile/src/transport/rpc-client-context-contract.tsmobile/web-entry/web-overrides.json
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — initial review of the full branch (49 files, 8 commits; base main @ 11db2b9a7d, head c4a901b2bb).
- Nullable re-dial seam —
RpcClientContextValue.forceReconnectbecomesForceReconnect = ((hostId: string) => Promise<void>) | null, and the page provider returnsnullinstead of an inert promise, so the compiler forces every caller to decide. connectionRetryAction— newmobile/src/transport/connection-retry-action.tscentralises the "reload / re-dial / offer nothing" decision for a failed screen's Retry.- Controls hidden on the page — host-header Reconnect, session-header tap-to-retry, and Retry in agent history, file-explorer root, file preview, diff review, git history and source-control status; native renders as before.
- File-explorer per-folder Retry kept — it queues the read, which drains when the shell's client reconnects.
- Tests & census pins — one behavioural case per hidden control, a real-hook page-seam pin, the helper's unit test, and refreshed
SESSION_ROUTE_MODULES/HEAD_HOST_JSX_SHA256pins.
I re-ran the affected suites (13 files / 49 tests), the two closure censuses, the forceReconnect consumer suites, the RPC-recording pilot goldens, the mobile tests-typecheck ratchet and the changed-code quality gate — all green.
ℹ️ Auto-reload-on-reconnect is pinned for only one of the six hidden Retries
The safety argument for hiding a Retry is that the screen's load re-runs on its own when the shell's client reconnects. The explorer's per-folder retry test pins that drain, but agent history, file preview, diff review, git history and source-control status are only tested for the Retry's absence — their auto-reload rests on the load effects' client/connState dependencies, which I confirmed in source but which no test pins. Not blocking and no change requested; noting it only because it is the load-bearing assumption behind the change.
Technical details
# Auto-reload coverage asymmetry
## Affected sites
- mobile/src/files/MobileFileExplorerPanel.test.ts — pins the folder-queue drain on reconnect (the one positive case).
- mobile/src/agent-history/use-mobile-agent-history-state.ts:152-155 — load effect re-runs via `loadSessions` deps `[..., client, connState, ...]`; no reconnect-reload test.
- mobile/src/files/MobileFilePreviewScreen.tsx:156-158 — effect re-runs via `loadPreview` deps `[client, connState, ...]`; no reconnect-reload test.
- mobile/src/session/use-mobile-diff-review-controller.ts:113-115 — effect re-runs via `loadReviewData` deps `[client, connState, worktreeId]`; no reconnect-reload test.
- mobile/src/source-control/MobileGitHistoryList.tsx:57-82 — effect deps include `client, connState`; no reconnect-reload test.
- mobile/src/source-control/use-mobile-source-control-state.ts — `loadStatus` re-runs on reconnect per the panel comment; no reconnect-reload test.
## Required outcome
- None; this is an informational observation, not a defect or a requested change.
## Open questions for the human
- Is the explorer drain test intended as the representative proof of the auto-reload premise, or would a reload-on-reconnect case per hidden Retry be worth the extra suites?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Taking the observation: the premise behind hiding a Retry is that the load re-runs when the shell's client reconnects, and one pinned site out of six is thin for a load-bearing assumption. Adding one reload-on-reconnect case per hidden site (agent history, file preview, diff review, git history, source-control status), each shown to go red when the |
Hiding a Retry on the page rests on the screen's load re-running when the shell's client reconnects, because nothing on the page re-dials. Only the explorer's folder drain pinned that. Each other site now has a case that starts unreachable with no Retry and asserts the load goes out on the client and state the reconnect delivers: agent history (status.get), file preview (the preview read), diff review (the snapshot load), git history (git.history) and source-control status (git.status, in the loaders suite because the panel test mocks the state hook). Each goes red when the `client`/`connState` dependencies it guards are removed; for source control that is both `loadStatus` and the `loadBranchCompare` it depends on. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Conflict: config/scripts/mobile-web-app-session-terminal-closure.test.mjs. Main's #22299 paragraph (4211 -> 4212, `agent-session-journal-producer.ts`) kept first in landing order; this branch's Retry-decision paragraph re-measured on top of it. Session route closure 4212 -> 4213 modules, local 1026 -> 1027: the one joiner is `src/transport/connection-retry-action.ts`, this branch's only new source file, read off the measured closure list. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… loaders test CI's native code-quality audit denies the duplicate-import warning the reload pin added. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the delta since the prior pullfrog review (c4a901b2bb → b6c31480af, 2 commits): a test-only follow-up that closes the auto-reload-on-reconnect coverage gap flagged in that review.
- Reload-on-reconnect cases for the five remaining hidden Retries — agent history, file preview, diff review, git history and source-control status each drive the screen from an unreachable host (
client: null,reconnecting) to a live client and assert the load re-fires (astatus.get/git.history/git.statusrequest or aloadSnapshotcall). I revertedclient/connStateout ofloadSessions' dependency list and confirmed the agent-history case goes red, so the new cases pin the real dependency rather than an incidental re-render. - Session-header tap-to-retry case — new
mobile-session-connection-retry.test.tsxrunsuseMobileSessionPresentationwithforceReconnectHostnull and non-null, pinning both theshowConnectionRetrygate and the "Can't reach desktop" vs "— tap to retry" summary split. - Census and docs refresh —
SESSION_ROUTE_MODULES4212 → 4213 for theconnection-retry-action.tsjoiner, and the capability-probe comment explaining whystatus.getlegitimately stays on the page.
I re-ran the nine affected mobile suites (38 tests), both mobile closure censuses, the session route-parity pins and the mobile tests-typecheck ratchet — all green.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…e machine live Pairing: - An unreadable status.get reply no longer strands the pairing race: the descriptor read ran inside the race's success handler and threw, so the candidate was never counted and a direct-only pairing sat on "Connecting..." until the timeout. The race now reads the status through a reader that returns null instead of throwing. - A pending pairing is now a small state machine: a save in flight owns the outcome (Cancel, back, or unmount no longer clear the journal under it), a failed save stays pending and the naming screen shows the error with Save still available, and Cancel never rejects. - When the desktop refuses relay provisioning, the journal is cleared before the naming step instead of at save, so an app kill on that screen no longer blocks every later scan with "recovery pending". - A pairing that resolves after the screen went away is cancelled rather than left with its journal. - The screens keep their root ref callbacks stable (the latest pending pairing is read from a ref) instead of re-creating them per pairing. - The label field's placeholder shows the name that an empty label saves. - "Is this an existing host" is derived from the id identity resolution hands back, so host-store and its tests go back to main's shape. Machine descriptor: - Mobile keeps the host-reported machine name and OS in memory only, filled by the status reads that already happen, and labels it "Last known" from the row's own connection state. This drops the per-host AsyncStorage copy, its web sibling and web-overrides entry, and the removal cleanup. It also fixes a latch: freshness used to stay true for the whole process once a host had answered. - Desktop reads the descriptor through lastVerifiedRuntimeStatus and marks it "Last known" using the same reachability verdict as the row's dot. - Drops the unused hostname/previousPlatform resolver inputs and moves the "OS · machine" formatting into the shared resolver. Also restores main's page-only Reconnect gate in the host header (#22326), undoes the no-op toStoredHostProfile reformat, and re-measures the web session route at 4222 modules (one fewer: the dropped web persistence file).
* feat(mobile): confirm host identity after pairing * refactor(mobile): unify host descriptor state * chore(i18n): translate the last-known host descriptor label The remote-host row's "Last known" label shipped in English only. Every other locale now carries it, worded as each catalog already words "last known". * fix(mobile): make the pairing naming step safe to abandon and show the machine live Pairing: - An unreadable status.get reply no longer strands the pairing race: the descriptor read ran inside the race's success handler and threw, so the candidate was never counted and a direct-only pairing sat on "Connecting..." until the timeout. The race now reads the status through a reader that returns null instead of throwing. - A pending pairing is now a small state machine: a save in flight owns the outcome (Cancel, back, or unmount no longer clear the journal under it), a failed save stays pending and the naming screen shows the error with Save still available, and Cancel never rejects. - When the desktop refuses relay provisioning, the journal is cleared before the naming step instead of at save, so an app kill on that screen no longer blocks every later scan with "recovery pending". - A pairing that resolves after the screen went away is cancelled rather than left with its journal. - The screens keep their root ref callbacks stable (the latest pending pairing is read from a ref) instead of re-creating them per pairing. - The label field's placeholder shows the name that an empty label saves. - "Is this an existing host" is derived from the id identity resolution hands back, so host-store and its tests go back to main's shape. Machine descriptor: - Mobile keeps the host-reported machine name and OS in memory only, filled by the status reads that already happen, and labels it "Last known" from the row's own connection state. This drops the per-host AsyncStorage copy, its web sibling and web-overrides entry, and the removal cleanup. It also fixes a latch: freshness used to stay true for the whole process once a host had answered. - Desktop reads the descriptor through lastVerifiedRuntimeStatus and marks it "Last known" using the same reachability verdict as the row's dot. - Drops the unused hostname/previousPlatform resolver inputs and moves the "OS · machine" formatting into the shared resolver. Also restores main's page-only Reconnect gate in the host header (#22326), undoes the no-op toStoredHostProfile reformat, and re-measures the web session route at 4222 modules (one fewer: the dropped web persistence file). * test(mobile): re-record RPC goldens for the deferred pairing save Repins baseline to the pairing fix commit and re-records every golden. Against main, 781 goldens move only in the header (baseline everywhere, adapterSha256 for the pairing adapter family). Six pairing goldens move in the body, and only in effect order: the pairing now resolves (closing its candidate sockets) before the naming step saves the host, and a refused relay provision clears its journal before the save rather than after. The set of effects and every outcome match main. This also removes the unhandled-rejection effects and the failed result-absent/result-null cells that the previous recording captured from the pairing race's throwing status read. * fix(mobile): keep the machine name out of the host header title while the label loads The host screen starts with an empty saved label and loads it asynchronously. With a descriptor already in memory, the resolver fell back to the machine name as the title for that window, so opening "Windows-Low Spec" briefly titled the header with the Mac's name. Read the descriptor only once the label is known. * test(mobile): build the pending-pairing status through its schema so the test typechecks The mobile tests typecheck ratchet rejected a partial status literal: the reply type keeps every optional field as a required key. Parsing the literal through the status schema yields that shape without a type assertion. * test(mobile-web): re-pin the session route closure after merging main #22301 added two src/shared modules this route reaches; its own CI never ran this suite, so the merged branch read 4224 against the 4222 pin. Measured on the merge. * feat(mobile): name each host by what its desktop reports Pairing saves the host immediately again and names it after the machine name the desktop publishes; every connection refreshes that name and OS, so a rename on the desktop reaches the phone. A name typed on the phone's Edit screen is kept as a phone-local override that wins; clearing it returns to the desktop's name. - Stored host profiles gain optional personalName, lastKnownMachineName and lastKnownHostPlatform; `name` stays the resolved value older builds read. Legacy records classify a generated "Host N" as desktop-named and any other name as a phone override. - The connection layer runs one retrying status probe per connected host and records the descriptor; the capability probe becomes a projection of it. - Rows and the header always show the OS, add the machine name under a phone override that hides it, and mark it "Last known" while the host is offline. - Removes the deferred-save naming screen and the one-shot home status fetch. - Name rules move to host-name-identity.ts and the host-list mutation queue to host-list-mutation-queue.ts; an unchanged mutation no longer rewrites storage. * test(mobile): restore the RPC recordings to main's Pairing saves the host back to back again and the recording adapter is main's, so every recording matches main byte for byte; the earlier deferred-save re-record and its baseline repin no longer apply. * fix(mobile): keep stored host name identity across snapshot saves and on the web page A connection re-saves its host profile snapshot on relay credential rotation or relay re-resolution. The re-pair merge let that snapshot's name identity win, so a phone rename cleared or changed since connect came back, and a newer desktop machine name rolled back. The stored record now keeps the name identity on every save; the save supplies the rest. The web page receives only the app's resolved host name, with no identity fields, so the docked host header treated a phone rename as "no override" and titled the host with the live machine name. The display hook now reads such a source the way storage reads a legacy record: a non-generated name is the user's label. * fix(mobile): hand the web page the host's stored name identity The page received only the app's resolved host name, so it had to guess whether that name was the phone's override or the desktop's name. It guessed "override" for any non-generated name, which froze a desktop-adopted name as the title after the desktop was renamed, and left an offline page header without the last-known OS and machine name. The shell now puts the stored personalName and last-known descriptor on the init host as optional fields. The page reads them exactly as the app does; a page handed its host by an older shell still falls back to classifying the name, and an older page ignores the fields. * fix(mobile): drop an unreadable host name field, not the whole host The stored host record and the page's init host checked the platform against a closed list and required non-empty names. A value this build does not know, such as a platform added in a later build, failed the whole record: the host list dropped the paired host and the next write persisted the list without it, and the page refused its init message. Those three optional fields are now salvaged, so an unreadable value drops only that field. Also states the one exception to the stored name rule (an OS reported without a machine name keeps the adopted name), and brings four mobile test files in line with the branch: the edit screen now saves `personalName`, and host opens now start a descriptor status probe. * refactor(mobile): name the shared host name fields for their role * fix(mobile): drop the "Last known" prefix from the host machine line The OS and machine name line under a host's name reads the same whether or not the host is connected; the connection status already says when it is offline, and a prefix that users could read as applying to the name added nothing. Removes the resolver's liveness input and the desktop row's translation key.

The page still offered controls whose only effect is a re-dial the page cannot make (follow-up from #22283). Inert today: the page shell only mounts in an
EXPO_PUBLIC_MOBILE_SHELL=otabuild; native renders every control as before.Fixed at the seam, not with
.websiblings.RpcClientContextValue.forceReconnectis nowForceReconnect = ((hostId) => Promise<void>) | null, and the page's provider (client-context.web.tsx) returnsnullinstead of a resolved promise. The compiler then listed every caller in the page closure, and each one was decided:transport/connection-retry-action.ts); a plain reload staysrelease,forgetHostClient,updateLastConnectedupdateHostNameAndEndpoint(edit.tsx)The rpc-recording adapters still pass a function, so no golden moves.
The capability probe stays on the page, and the fence comment now says why.
runtime-capability-probe.tssendsstatus.get, which carries no client identity and writes nothing; the bridge forwards it and the desktop's mobile allowlist admits it. Its other importer is reached only fromaccounts.tsx, which the page never serves.Tests: one behavioural case per hidden control against the page context (red on main's product files, green here) and the native counterpart for each. Reviewer-found gap closed: the premise behind hiding a Retry is that the screen reloads on its own when the shell's client reconnects, and only the explorer pinned that, so each of the other five sites (agent history, file preview, diff review, git history, source-control loaders) now has a reload-on-reconnect case that goes red when the
client/connStatedependency it guards is removed. Session-route closure pinSESSION_ROUTE_MODULES4,212→4,213, the one joiner beingconnection-retry-action.ts; session host-JSX parity hash re-measured; C1/C2/C3/C5 page-closure pins unchanged.Left as follow-ups:
/pair-scanfrom the page hands a rooted link to the shell and may open natively after all, unverified on a device; a pre-existing React Doctorprefer-useReducernote atMobileFileExplorerPanel.tsx:43.