Skip to content

feat(mobile): name the machine after pairing - #22104

Merged
brennanb2025 merged 19 commits into
mainfrom
brennanb2025/mobile-host-display-resolution
Sep 25, 2026
Merged

brennanb2025 merged 19 commits into
mainfrom
brennanb2025/mobile-host-display-resolution

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 23 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1030 $\color{#cf222e}{\Huge{\mathbf{−}}}$​41 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​989
Prod 40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​814 $\color{#cf222e}{\Huge{\mathbf{−}}}$​175 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​639

ELI5

Each paired desktop now shows up on the phone under the name the desktop itself reports, with its operating system underneath. Rename the machine on the desktop, and the phone picks up the new name the next time it connects. A name you type on the phone still wins, but only on that phone. If it disagrees with the machine that actually answers, the real machine name shows under it, so a "Windows-Low Spec" row that is really a Mac can no longer hide.

What Changed

Before: pairing saved every desktop as Host 1, Host 2, and so on. People renamed them from memory, and nothing on the phone showed which machine actually answered. A row labelled "Windows-Low Spec" could be a Mac, and work landed on the wrong computer.

After, using the machine name each desktop now publishes (#22094):

  • Pairing saves the host immediately, the same flow as before, now named after the desktop's machine name.
  • Every connection refreshes that name and the OS, so a rename on the desktop reaches the phone.
  • A name typed on the phone (the host's Edit screen) is kept as a phone-only override that wins. Clearing the field returns the row to the desktop's name.
  • Rows and the host header always show the OS. When a phone name hides the machine name, the line reads macOS · m4airs-Air. The line stays while the desktop is offline, including right after the app restarts, and the row's own connection status says it is offline.
  • Desktop Settings → Remote Servers follows the same rule for its server labels.
  • Desktops too old to report a name keep Host N, exactly as today.

Mechanism:

  • Stored fields. Each stored host gains three optional fields: the phone override (personalName) and the last name and OS the desktop reported (lastKnownMachineName, lastKnownHostPlatform). name stays stored as the resolved value, so older app builds and existing readers keep working.
  • One place for the rules. host-name-identity.ts owns them, and host-store applies them inside its serialized write queue, so the name and its sources are always written together.
  • The connection layer does the reading. It asks each connected desktop for its status once per connection and retries through a relay↔direct switch. One recorder writes both the live copy and the stored copy. The existing push-capability check is now a view of that same retrying probe.
  • Existing hosts migrate on read. A stored Host N counts as desktop-named and gets replaced on the next connect. Any other stored name was typed by the user, so it becomes the phone override.
  • The paired web page receives the same fields as optional values. An unreadable value drops only that field, never the host.

Why

The desktop is the one place that knows what it is, so the phone takes the name from it rather than asking the user to remember. The phone keeps an explicit override field instead of guessing whether a stored name was typed. That lets a later desktop rename flow through for hosts the user never renamed, while never overwriting one they did.

Alternatives considered:

  • A naming screen during pairing. An earlier version of this PR had one. Holding an unsaved, already-authorized pairing open while the user typed produced most of the bugs found in review (cancel during save, app killed mid-screen, re-scans blocked). Saving immediately and renaming afterwards has no in-between state.
  • Keeping the machine name only in memory. Then an offline desktop would lose its identity after an app restart, and that is exactly when you need to tell two machines apart. So the last reported name and OS are stored per host.
  • Deriving the title at read time everywhere. Older app builds and pages served by older desktops read name directly, so name stays a stored, maintained value.

Known limits:

  • Downgrading the app and upgrading again. An older build drops the new fields when it writes, so on the way back a name the phone had taken from the desktop is treated as a typed override. The user can clear it in Edit.
  • Relay credential re-saves. They write a connection's copy of the profile, which is existing behaviour on main. This PR keeps the name fields safe from it. Narrowing that save for the other fields is a separate follow-up.
  • One extra status read per connection. It is a small request, and it replaces the old one-shot home-screen read.

Linked Issue

No GitHub issue: reported internally as the mobile P0 where worktrees were created on the wrong machine because paired desktops could not be told apart. Desktop half: #22094.

Visual Proof

iOS Simulator (iPhone 17 Pro Max, iOS 26.5), paired over LAN to a dev desktop built from this branch (12757e60e2; the two offline shots re-captured at b3f2483324). The desktop's Machine name was set to QA-Desk. Every step was driven with the in-app controls.

After pairing (no naming step) Renamed on the phone Host header
Row titled QA-Desk with macOS beneath Row titled Windows-Low Spec with macOS · QA-Desk beneath Host header Windows-Low Spec with macOS · QA-Desk beneath
Title QA-Desk, macOS beneath Windows-Low Spec over macOS · QA-Desk Same rule in the host header
Phone name cleared Renamed on the desktop Desktop offline Offline, after an app restart
Row back to QA-Desk Row titled QA-Desk-2 macOS line kept while offline macOS line kept after restart
Back to the desktop's name QA-Desk-2 after reconnect Name and OS kept while offline Still named after an app restart

Before: the same pairing produced a row named Host 1, with no OS or machine line.

Desktop Settings → Remote Servers, with two dev Orca runtimes built from this branch (dd908acdc1; the unreachable shot re-captured at b3f2483324) paired directly over LAN. The remote's Machine name is QA-Remote, and the client labelled it Build Box:

Connected Remote quit
Build Box with macOS · QA-Remote beneath Build Box keeps macOS · QA-Remote while unreachable
Build Box over macOS · QA-Remote Machine line kept while unreachable

Testing

  • Automated tests added/updated

  • I manually tested these changes locally (see Visual Proof: iOS Simulator QA)

  • pnpm tc, mobile tsc --noEmit, and the mobile tests-typecheck ratchet.

  • The full mobile suite: 882 files, 9,558 tests. The RPC recordings are unchanged from main.

  • New tests cover:

    • legacy migration
    • adopting the desktop's name
    • keeping a phone rename across re-pair and across relay re-saves
    • clearing an override
    • the per-connection probe starting and stopping
    • the live title
    • the page's name fields
    • dropping an unreadable field without losing the host
  • Each of those tests was checked by deleting the behaviour it covers and watching it fail.

  • check:code-quality:changed, React Doctor, oxlint, and all four verify:localization-* scripts. The new desktop string is translated in all six locales.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable

Notes

  • Mobile back-compat: the new stored and bridge fields are optional and tolerant of bad values, and name is still written for older builds.
  • Mixed versions:
    • Older desktops report no name and keep Host N.
    • Older pages ignore the new fields.
    • Newer pages paired with older apps fall back to reading the stored name.
  • SSH and relay hosts get the same status read as direct ones.
  • Desktop code changes only the Remote Servers row.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@pullfrog pullfrog 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.

Important

Cancelling at the new naming step clears the relay journal after the relay credential install is already authoritatively committed, leaving an authorized credential on the desktop/relay with no saved host and no recovery path. See the inline comment.

Reviewed changes

  • Deferred pairing result: pre-profile-pairing-coordinator.ts now returns a PairingPendingResult (machine descriptor, suggested name, finalize/cancel) instead of writing the credential bundle, saving the host, and clearing the journal inline.
  • Naming step: pair-confirm.tsx and pair-scan.tsx gain naming/saving states and render the new PairingNameConfirmation, with cancel and save-failure error handling.
  • Shared display rule: src/shared/host-display-resolution.ts plus a shared host-platform-label.ts; MobileHostCard, HostScreenHeader, and the renderer runtime-server-row.tsx all render personal label first, descriptor beneath when it differs, and stale descriptors prefixed Last known · .
  • Descriptor persistence: machineName/machinePlatform/machineDescriptorSeenAt added to HostProfile/StoredHostProfile and written from use-mobile-home-host-connections.ts and use-host-screen-controller.ts; resolvePairingHostIdentity now reports isExisting.
  • Tests/goldens: resolver, host-card, coordinator, and identity tests extended; five pairing recording goldens re-recorded.

ℹ️ Nitpicks

  • mobile/src/transport/mobile-relay-pairing-recovery.ts:273 and :294 keep private relayHost and assertCommitted copies now that pairing-relay-host.ts exports equivalents; the two can drift.
  • mobile/src/components/MobileHostCard.tsx:48 — props.descriptorFresh ?? props.hostPlatform !== undefined treats the mere presence of a platform prop as "fresh"; a caller that passes a stored platform without descriptorFresh will present a stale descriptor as live. Defaulting to false is safer.
  • src/renderer/src/components/settings/runtime-server-row.tsx:108 introduces the user-facing Last known · string without translate(), unlike every other string in that row.
  • There is no pairing-pending-result.test.ts; the newly extracted cancel/finalize state machine is only covered indirectly through the coordinator tests.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 force-pushed the brennanb2025/mobile-host-machine-name branch from b30b287 to 1191973 Compare September 23, 2026 02:13
@brennanb2025 brennanb2025 mentioned this pull request Sep 23, 2026
8 tasks done
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".
@brennanb2025
brennanb2025 force-pushed the brennanb2025/mobile-host-display-resolution branch from d56890a to 1223c3e Compare September 24, 2026 01:18
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/mobile-host-machine-name to main September 24, 2026 01:19
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Host profiles now distinguish phone-specific names from desktop-reported names and store the latest machine name and platform. Runtime status probes capture descriptors for connected hosts and pairing results. Mobile host views and desktop runtime rows display resolved host names and descriptor details, marked as last known when not live.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to b8eeb

Overlong host identity data can prevent the embedded page from initializing, and leaving pairing during finalization can still result in a saved host; Japanese users also see a misleading stale-value label. These impacts are bounded to affected hosts, localization, and a narrow timing window, so the change is mergeable with owner awareness and follow-up.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 32.58% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 89 functions across 68 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly describes the primary change: naming paired machines from the machine identity after pairing.
Description check ✅ Passed The description is complete and directly related to the changes. It includes the user impact, implementation details, rationale, compatibility notes, visual proof, testing, and checklist. The Linked I…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

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: 6


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: bb9e439d-642e-42d8-b431-f8957ef98262

📥 Commits

Reviewing files that changed from the base of the PR and between f2ac9f2 and 1223c3e.

📒 Files selected for processing (56)
  • config/scripts/mobile-web-app-session-terminal-closure.test.mjs
  • mobile/app/pair-confirm.tsx
  • mobile/app/pair-scan.tsx
  • mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json
  • mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json
  • mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json
  • mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json
  • mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json
  • mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json
  • mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json
  • mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json
  • mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json
  • mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json
  • mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json
  • mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json
  • mobile/src/components/MobileHostCard.test.ts
  • mobile/src/components/MobileHostCard.tsx
  • mobile/src/components/PairingNameConfirmation.tsx
  • mobile/src/home/MobileHomeHostList.tsx
  • mobile/src/home/mobile-home-host-descriptor-fetch.test.ts
  • mobile/src/home/mobile-home-host-descriptor-fetch.ts
  • mobile/src/home/use-mobile-home-host-connections.ts
  • mobile/src/host-screen/host-screen-header.tsx
  • mobile/src/host-screen/host-screen-primary-styles.ts
  • mobile/src/host-screen/use-host-screen-controller.ts
  • mobile/src/test-support/rpc-recording/adapters/pairing-journal-mount-adapters.ts
  • mobile/src/transport/host-descriptor-persistence.ts
  • mobile/src/transport/host-descriptor-persistence.web.ts
  • mobile/src/transport/host-descriptor-store.test.ts
  • mobile/src/transport/host-descriptor-store.ts
  • mobile/src/transport/host-metadata-store.ts
  • mobile/src/transport/host-name-endpoint-updater.ts
  • mobile/src/transport/host-removal-lifecycle.test.ts
  • mobile/src/transport/host-removal-lifecycle.ts
  • mobile/src/transport/host-status-gates.test.ts
  • mobile/src/transport/host-status-gates.ts
  • mobile/src/transport/host-status-reply-schema.test.ts
  • mobile/src/transport/host-status-reply-schema.ts
  • mobile/src/transport/host-store.test.ts
  • mobile/src/transport/host-store.ts
  • mobile/src/transport/pairing-candidate-race.ts
  • mobile/src/transport/pairing-pending-result.ts
  • mobile/src/transport/pairing-relay-host.ts
  • mobile/src/transport/pre-profile-pairing-coordinator.test.ts
  • mobile/src/transport/pre-profile-pairing-coordinator.ts
  • mobile/web-entry/web-overrides.json
  • src/renderer/src/components/settings/runtime-server-row.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/host-display-resolution.test.ts
  • src/shared/host-display-resolution.ts
  • src/shared/host-platform-label.ts

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

Comment thread mobile/app/pair-confirm.tsx Outdated
Comment on lines +56 to +62
const cancel = useCallback(() => {
if (pendingPairing) {
void pendingPairing.cancel()
setPendingPairing(null)
}
router.replace('/')
}, [router])
}, [pendingPairing, router])

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,80p' mobile/src/transport/pairing-pending-result.ts
sed -n '40,240p' mobile/app/pair-confirm.tsx

Repository: stablyai/orca

Length of output: 9242


Block cancel while finalize is in progress.

During saving, the header back button and hardware Back handler still call cancel(). finalize() sets settled only after writeCredentialBundle, saveHost, and journal cleanup complete. Therefore, cancel() can clear the journal while finalize() is still awaiting, navigate home, and allow the host save to continue. If the save then fails, no journal remains for recovery.

🐛 Proposed fix
   const cancel = useCallback(() => {
+    if (status === 'saving') {
+      return
+    }
     if (pendingPairing) {
       void pendingPairing.cancel()
       setPendingPairing(null)
     }
     router.replace('/')
-  }, [pendingPairing, router])
+  }, [pendingPairing, router, status])
📝 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
const cancel = useCallback(() => {
if (pendingPairing) {
void pendingPairing.cancel()
setPendingPairing(null)
}
router.replace('/')
}, [router])
}, [pendingPairing, router])
const cancel = useCallback(() => {
if (status === 'saving') {
return
}
if (pendingPairing) {
void pendingPairing.cancel()
setPendingPairing(null)
}
router.replace('/')
}, [pendingPairing, router, status])

Comment on lines +31 to +35
export function recordHostDescriptor(hostId: string, descriptor: HostMachineDescriptor): void {
loadStartedHostIds.add(hostId)
adoptableLoadHostIds.delete(hostId)
const wasFresh = freshHostIds.has(hostId)
freshHostIds.add(hostId)

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 | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP -C4 'useHostDescriptor\s*\(' mobile/src
rg -nP -C3 '\bfresh\b' mobile/src/home/MobileHomeHostList.tsx mobile/src/host-screen

Repository: stablyai/orca

Length of output: 4496


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- host descriptor store ---'
cat -n mobile/src/transport/host-descriptor-store.ts | sed -n '1,180p'
printf '%s\n' '--- home host list ---'
cat -n mobile/src/home/MobileHomeHostList.tsx | sed -n '1,155p'
printf '%s\n' '--- host screen controller ---'
cat -n mobile/src/host-screen/use-host-screen-controller.ts | sed -n '50,95p'
printf '%s\n' '--- freshness and connection references ---'
rg -n -P -C4 'descriptorFresh|descriptor\.fresh|connState|connectionState|ConnectionState|connected' mobile/src/home mobile/src/host-screen mobile/src/transport

Repository: stablyai/orca

Length of output: 45535


🏁 Script executed:

cat -n mobile/src/transport/host-descriptor-store.ts | sed -n '1,180p'; printf '\n---\n'; cat -n mobile/src/home/MobileHomeHostList.tsx | sed -n '90,140p'; printf '\n---\n'; cat -n mobile/src/host-screen/use-host-screen-controller.ts | sed -n '60,85p'; printf '\n---\n'; rg -n -P -C5 'resolveHostDisplay|descriptorFresh|descriptor\.fresh' mobile/src

Repository: stablyai/orca

Length of output: 17321


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- forget callers ---'
rg -n -P -C5 '\bforgetHostDescriptor\b' mobile/src
printf '%s\n' '--- descriptor consumers ---'
rg -n -P -C8 'MobileHostCard|resolveHostDisplay|descriptorFresh|descriptor\.fresh' mobile/src/home mobile/src/host-screen

Repository: stablyai/orca

Length of output: 16536


Combine descriptor freshness with connection state.

recordHostDescriptor marks a host fresh after any readable status reply. forgetHostDescriptor runs only when the host is removed, not when its connection disconnects. Both MobileHostCard and the host header pass descriptor.fresh directly to the display logic, so a disconnected host can omit the Last known · prefix.

Use the current connection state when setting descriptorFresh:

Suggested fix
--- a/mobile/src/components/MobileHostCard.tsx
+++ b/mobile/src/components/MobileHostCard.tsx
@@
-    descriptorFresh: descriptor.fresh,
+    descriptorFresh: descriptor.fresh && connected,
--- a/mobile/src/host-screen/use-host-screen-controller.ts
+++ b/mobile/src/host-screen/use-host-screen-controller.ts
@@
-    descriptorFresh: descriptor.fresh,
+    descriptorFresh: descriptor.fresh && connState === 'connected',

return
}
successes.push(candidate)
successes.push({ ...candidate, status: readHostStatusGates(reply) })

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

An uncaught error from readHostStatusGates drops candidates that answered the probe.

hostAnsweredStatusProbe(reply) accepts replies that hostStatusProbe.interpret rejects, for example ok: true with no result or with result: null. readHostStatusGates then throws RpcIncompatibleReplyError inside the success handler. The candidate is never pushed to successes, failures never increments, and the rejection has no handler. The consequences:

  • A direct-only pairing hangs until the 25-second timeout.
  • In a direct and relay race, the other path wins.
  • In matrix-pairing.pre-profile-direct-status, pairing now fails with "relay credential install result does not match pairing journal".

The regenerated goldens record these failures as expected behavior.

  • mobile/src/transport/pairing-candidate-race.ts#L36-L36: wrap readHostStatusGates(reply) in try/catch. On error, set status to null and still push the candidate.
  • mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json#L775-L806: re-record after the fix. The result-absent and result-null checkpoints must pair over direct again.
  • mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json#L726-L731: re-record after the fix. The d1d1b2f79c4f unhandled-rejection effect must be gone.
  • mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json#L483-L495: re-record after the fix. The 18dffeab46a1 effect must be gone.
  • mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json#L499-L514: re-record after the fix. The relay must win again in result-absent and result-null.
🐛 Proposed fix
-          successes.push({ ...candidate, status: readHostStatusGates(reply) })
+          let status: HostStatusReply | null = null
+          try {
+            status = readHostStatusGates(reply)
+          } catch {
+            // Why: the descriptor is display-only; an unreadable status must not disqualify a path that answered.
+            status = null
+          }
+          successes.push({ ...candidate, status })
📝 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
successes.push({ ...candidate, status: readHostStatusGates(reply) })
let status: HostStatusReply | null = null
try {
status = readHostStatusGates(reply)
} catch {
// Why: the descriptor is display-only; an unreadable status must not disqualify a path that answered.
status = null
}
successes.push({ ...candidate, status })
📍 Affects 5 files
  • mobile/src/transport/pairing-candidate-race.ts#L36-L36 (this comment)
  • mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json#L775-L806
  • mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json#L726-L731
  • mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json#L483-L495
  • mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json#L499-L514

// A connected host exposes Disconnect; otherwise Connect.
const isReachable = isRuntimeServerTransportConnected(connectionState)
const actionBusy = connecting || switching || disconnecting || removing
const descriptorStatus = runtimeStatusEntry?.status ?? runtimeStatusEntry?.snapshot?.status

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 | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Inspect the details type and the producers of both status sources.
rg -n -C 4 'type RuntimeHostDetails|interface RuntimeHostDetails|runtimeStatusByEnvironmentId' src/renderer/src
rg -n -C 5 'RuntimeServerRow|runtimeStatus:' src/renderer/src/components/settings

Repository: stablyai/orca

Length of output: 45543


🏁 Script executed:

set -eu
printf '%s\n' '--- runtime-server-row.tsx ---'
sed -n '1,155p' src/renderer/src/components/settings/runtime-server-row.tsx
printf '%s\n' '--- RuntimeHostDetails ---'
sed -n '1,90p' src/renderer/src/components/settings/runtime-environment-host-details.ts
printf '%s\n' '--- RuntimeStatus declarations ---'
rg -n -C 8 'export (type|interface) RuntimeStatus|type RuntimeStatus|interface RuntimeStatus|machineName|hostPlatform' src/shared src/renderer/src | head -n 240
printf '%s\n' '--- runtimeStatusByEnvironmentId producers ---'
rg -n -C 8 'runtimeStatusByEnvironmentId\s*[:=]|setRuntimeStatusByEnvironmentId|runtimeStatusByEnvironmentId\.set|runtimeStatusByEnvironmentId:' src/renderer/src src/shared | head -n 300
printf '%s\n' '--- PR diff for row ---'
git diff --unified=25 7216d5af25367daeb3fa02091359720534d5f5eb 1223c3efd4f138d5070b9b6f7e7549b249d3fef9 -- src/renderer/src/components/settings/runtime-server-row.tsx

Repository: stablyai/orca

Length of output: 41508


🏁 Script executed:

sed -n '60,130p' src/renderer/src/components/settings/runtime-server-row.tsx
sed -n '1,40p' src/renderer/src/components/settings/runtime-environment-host-details.ts
rg -n -C 6 'export (type|interface) RuntimeStatus|type RuntimeStatus|interface RuntimeStatus' src/shared src/renderer/src
rg -n -C 6 'runtimeStatusByEnvironmentId' src/renderer/src/store* src/renderer/src/stores src/renderer/src/components/settings src/renderer/src/runtime 2>/dev/null | head -n 240
git diff --unified=15 7216d5af25367daeb3fa02091359720534d5f5eb 1223c3efd4f138d5070b9b6f7e7549b249d3fef9 -- src/renderer/src/components/settings/runtime-server-row.tsx

Repository: stablyai/orca

Length of output: 41496


🏁 Script executed:

set -eu
printf '%s\n' '--- RuntimeStatus descriptor fields ---'
sed -n '60,145p' src/shared/runtime-session-contracts.ts
printf '%s\n' '--- related descriptor declarations ---'
rg -n -C 5 'machineName|hostPlatform' src/shared/runtime-session-contracts.ts src/shared/runtime-types.ts src/shared/runtime-host-status.ts
printf '%s\n' '--- catalog details producer ---'
sed -n '34,135p' src/renderer/src/components/settings/use-runtime-environment-catalog.ts
printf '%s\n' '--- status-map producer symbols ---'
rg -n -C 10 'applyRuntimeHostStatusSnapshot|refreshEnvironmentStatus|setRuntimeStatus|runtimeStatusByEnvironmentId' src/renderer/src/store/slices/runtime-status.ts src/renderer/src/store/slices/runtime-status-hydration.ts src/renderer/src/store/slices/runtime-status-types.ts

Repository: stablyai/orca

Length of output: 39676


Use details.runtimeStatus when no status-map entry exists.

details.runtimeStatus contains machineName and hostPlatform. The status-map snapshot read can fail or return no entry before the catalog stores this status in details. The current expression then omits the descriptor. Treat this fallback as fresh data.

Suggested fix
-  const descriptorStatus = runtimeStatusEntry?.status ?? runtimeStatusEntry?.snapshot?.status
+  const descriptorStatus =
+    runtimeStatusEntry?.status ??
+    runtimeStatusEntry?.snapshot?.status ??
+    (runtimeStatusEntry === undefined ? details?.runtimeStatus : undefined)
+  const descriptorFresh =
+    runtimeStatusEntry !== undefined
+      ? runtimeStatusEntry.status !== null && runtimeStatusEntry.status !== undefined
+      : details?.runtimeStatus !== null && details?.runtimeStatus !== undefined
   const hostDisplay = resolveHostDisplay({
     personalLabel: environment.name,
     machineName: descriptorStatus?.machineName,
     platform: descriptorStatus?.hostPlatform,
-    descriptorFresh:
-      runtimeStatusEntry?.status !== null && runtimeStatusEntry?.status !== undefined,
+    descriptorFresh,

Comment thread src/renderer/src/i18n/locales/ja.json Outdated
"missionControlConflict": "Mission Control によってブロックされています。ここで再割り当てするか、システム設定で変更してください。"
},
"RuntimeServerRow": {
"lastKnownDescriptor": "最後に取得 · {{descriptor}}"

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 | 🟡 Minor | ⚡ Quick win

Use a Japanese equivalent of “Last known.”

最後に取得 means “last retrieved.” This label marks a stale descriptor as the last known value, so the current text can misstate its meaning.

Comment thread src/shared/host-display-resolution.ts Outdated
descriptorPlatform !== null &&
input.previousPlatform !== descriptorPlatform
const personalLabelAgrees = personalLabel !== null && personalLabel === descriptorName
const canCollapse = personalLabelAgrees && input.descriptorFresh && !platformChanged

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 | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n 'previousPlatform' mobile src
sed -n '1,60p' src/shared/host-display-resolution.ts

Repository: stablyai/orca

Length of output: 4307


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- resolveHostDisplay call sites ---'
rg -n -C 8 'resolveHostDisplay' mobile/src/components/MobileHostCard.tsx mobile/src/host-screen/use-host-screen-controller.ts src/renderer/src/components/settings/runtime-server-row.tsx src mobile 2>/dev/null | head -n 260

printf '%s\n' '--- named caller files ---'
for f in \
  mobile/src/components/MobileHostCard.tsx \
  mobile/src/host-screen/use-host-screen-controller.ts \
  src/renderer/src/components/settings/runtime-server-row.tsx
do
  if [ -f "$f" ]; then
    printf '\n### %s\n' "$f"
    wc -l "$f"
    rg -n -C 12 'resolveHostDisplay|platform|descriptor|host' "$f" | head -n 240
  else
    printf 'MISSING %s\n' "$f"
  fi
done

printf '%s\n' '--- candidate platform history/state declarations ---'
rg -n -i -C 3 'previousPlatform|platform.*previous|previous.*platform|platform\s*[:=]|platform\?' mobile/src src --glob '*.{ts,tsx}' | head -n 360

Repository: stablyai/orca

Length of output: 42068


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- resolveHostDisplay call sites ---'
rg -n -C 10 'resolveHostDisplay' mobile/src/components/MobileHostCard.tsx mobile/src/host-screen/use-host-screen-controller.ts src/renderer/src/components/settings/runtime-server-row.tsx src mobile 2>/dev/null | head -n 320

printf '%s\n' '--- named caller files ---'
for f in \
  mobile/src/components/MobileHostCard.tsx \
  mobile/src/host-screen/use-host-screen-controller.ts \
  src/renderer/src/components/settings/runtime-server-row.tsx
do
  if [ -f "$f" ]; then
    printf '\n### %s\n' "$f"
    wc -l "$f"
    rg -n -C 14 'resolveHostDisplay|platform|descriptor|host' "$f" | head -n 280
  else
    printf 'MISSING %s\n' "$f"
  fi
done

printf '%s\n' '--- candidate platform history/state declarations ---'
rg -n -i -C 4 'previousPlatform|platform.*previous|previous.*platform|platform\s*[:=]|platform\?' mobile/src src --glob '*.{ts,tsx}' | head -n 420

Repository: stablyai/orca

Length of output: 41750


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- mobile descriptor store ---'
fd -i 'host-descriptor-store' mobile src
for f in $(fd -i 'host-descriptor-store' mobile src); do
  printf '\n### %s\n' "$f"
  cat -n "$f"
done

printf '%s\n' '--- runtime status/store bindings ---'
rg -n -i -C 5 'runtimeStatusEntry|snapshot|hostPlatform|machineName|remotePlatform' src/renderer/src/runtime src/renderer/src/store src/renderer/src/components/settings src/shared --glob '*.{ts,tsx}' 2>/dev/null | head -n 360

printf '%s\n' '--- exact display branches ---'
sed -n '40,125p' mobile/src/components/MobileHostCard.tsx
sed -n '65,95p' mobile/src/host-screen/use-host-screen-controller.ts
sed -n '95,145p' src/renderer/src/components/settings/runtime-server-row.tsx
sed -n '35,95p' mobile/src/host-screen/host-screen-header.tsx

Repository: stablyai/orca

Length of output: 41829


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- runtime status slice ---'
if [ -f src/renderer/src/store/slices/runtime-status.ts ]; then
  cat -n src/renderer/src/store/slices/runtime-status.ts
else
  printf '%s\n' 'runtime-status.ts not found'
  fd -i 'runtime-status' src/renderer/src
fi

printf '%s\n' '--- runtime server row state selection ---'
sed -n '1,115p' src/renderer/src/components/settings/runtime-server-row.tsx

printf '%s\n' '--- runtime status types and update references ---'
rg -n -C 6 'RuntimeStatusEntry|snapshot:|runtimeStatusEntry|setRuntime|applyRuntime|hostPlatform' src/renderer/src/store src/renderer/src/runtime src/shared/runtime-host-status.ts src/shared/runtime-types.ts --glob '*.{ts,tsx}' 2>/dev/null | head -n 420

Repository: stablyai/orca

Length of output: 42343


Preserve OS-change information in host display resolution.

resolveHostDisplay detects an OS change only when previousPlatform is supplied. The three callers do not supply it, and their stores do not expose a previous platform. Therefore, when the personal label and fresh machine name are both Workstation, a changed OS still sets showDescriptor to false.

This hides the platform/name sub-line. On mobile, it also removes that descriptor from the accessibility label. The primary label and descriptor state remain intact.

Keep this as a minor issue. Retain and pass the previous platform, or change the collapse rule so the descriptor remains visible when platform history is unavailable.

@pullfrog pullfrog 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.

Important

A status.get reply this app cannot decode now makes racePairingCandidates hang instead of counting the candidate as an answered path. Fix inline.

Reviewed changes

Reviewed the two commits since the prior pullfrog review — the host-descriptor refactor and the locale commit — against the full 56-file PR diff.

  • Descriptor state unified: machineName/machinePlatform/machineDescriptorSeenAt moved off HostProfile/StoredHostProfile into a dedicated host-descriptor-store.ts with its own per-host persistence and a {descriptor, fresh} snapshot.
  • Descriptor producers: recorded from every readable status.get (host-status-gates.ts), on home reconnect (mobile-home-host-descriptor-fetch.ts), and at pairing finalize; forgotten on host removal.
  • Shared display: MobileHostCard, HostScreenHeader, and RuntimeServerRow now consume resolveHostDisplay plus the useHostDescriptor snapshot, with host-status-reply-schema.ts carrying hostPlatform/machineName as salvaged optionals.
  • Localization: the renderer's Last known · label now goes through translate(), with all six locales updated.
  • Identity/refactor: resolvePairingHostIdentity reports isExisting; host-name-endpoint-updater.ts extracted; new host-descriptor-store and home-fetch tests added.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…ost-display-resolution

# Conflicts:
#	config/scripts/mobile-web-app-session-terminal-closure.test.mjs
…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).
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.

@pullfrog pullfrog 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.

ℹ️ No new issues in this delta — the pairing-race hang is fixed by a non-throwing status reader, and the naming step is now a proper state machine. One earlier concern remains open and unchanged (a committed relay credential install abandoned by Cancel); its thread stays open.

Reviewed changes

Reviewed the two commits since the prior pullfrog review — the pairing naming-step rework plus the golden re-record — against the full 827-file PR diff (≈760 of which are header-only golden re-records).

  • Pending pairing state machine: PairingPendingResult now tracks pending/saving/saved/cancelled, so a save in flight owns the outcome (Cancel/unmount no longer clear the journal under it), a failed save stays retryable on the naming screen, and cancel() never rejects.
  • Race hang fixed: the pairing race reads the status.get reply through the new non-throwing readPairingCandidateStatus, so an undecodable ok reply counts as an answered candidate and the race settles; the re-recorded goldens drop the old unhandled-rejection effects.
  • Refused relay provisioning: the coordinator clears the journal before the naming step and hands the pending result journal: null, so an app kill on that screen no longer blocks later scans with "recovery pending".
  • Memory-only descriptor: host-descriptor-store.ts dropped its AsyncStorage persistence, its .web.ts sibling, forgetHostDescriptor, the web-overrides entry, and the removal-lifecycle call; freshness now comes from the reader's connection state, fixing the previous process-long freshness latch.
  • Shared descriptor formatting: resolveHostDisplay emits a single OS · machine descriptorLabel (and dropped the unused hostname/previousPlatform inputs); the mobile card, host header, and desktop settings row all consume it, with the desktop reading via lastVerifiedRuntimeStatus and marking stale from entryReachable.
  • Identity and header cleanup: resolvePairingHostIdentity back to {id, name} with isExisting derived from the id; host-store/toStoredHostProfile restored to main's shape; host-name-endpoint-updater.ts removed; page-only Reconnect gate restored; session-route pin re-measured to 4222.
  • Goldens: baseline repinned to the pairing fix commit and every golden re-recorded; the pairing goldens move only in effect order, matching main.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

… 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.

@pullfrog pullfrog 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.

ℹ️ No new issues in this delta — the host header now suppresses the machine descriptor until the saved personal label has loaded. One earlier concern remains open and unchanged: a committed relay credential install abandoned by Cancel still has no recovery path, so its thread stays open.

Reviewed changes

Reviewed the single commit since the prior pullfrog review (0afaadafc9) against the full 827-file PR diff (≈760 of which are header-only golden re-records). The only functional change is a one-line gate in the host screen controller.

  • Header descriptor gating: useHostScreenController now calls useHostDescriptor(state.hostName ? hostId : undefined), so while the saved personal label is still loading the descriptor is suppressed and resolveHostDisplay cannot title the header with the machine name before the label arrives; the header falls back to Host for that tick. Verified this cannot permanently hide the descriptor: saved host names are coerced non-empty at pairing save (name.trim() || suggestedName) and state.hostName is always populated for a found host, so the read resumes the moment the label loads.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…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.
#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.
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.
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.
…ost-display-resolution

# Conflicts:
#	config/scripts/mobile-web-app-session-terminal-closure.test.mjs
#	src/renderer/src/i18n/locales/fr.json

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Reviewed the commits since the prior pullfrog review (0afaadafc9) against the full 57-file PR diff. The core change is fc5b452bc2, which replaces the deferred-save naming step with "save at pairing, then name from what the desktop reports"; the rest is test/golden restoration and route-pin bookkeeping.

  • Immediate pairing save restored: the naming screen, PairingPendingResult, and PairingNameConfirmation are gone; pairing saves the host again, and the coordinator records the race winner's status so the row adopts the desktop's machine name (pre-profile-pairing-coordinator.ts, pair-confirm/pair-scan back to main's immediate-save flow). A name typed on the Edit screen is kept as a personalName override that wins; clearing it returns to the desktop's name.
  • Name-identity rules: new host-name-identity.ts (classifyLegacyHostName, mergeHostNameIdentity, withPersonalName, withReportedDescriptor) with legacy Host N classification, and host-list-mutation-queue.ts extracting the serialized RMW pass; stored profiles gain personalName/lastKnownMachineName/lastKnownHostPlatform while name stays the resolved value older builds read.
  • Descriptor recording unified: host-descriptor-recorder.ts writes both the in-memory host-descriptor-store.ts and the durable profile; the connection layer starts one retrying runtime-status-probe.ts per connect (reaching the no-op on web), and runtime-capability-probe.ts becomes a projection of it.
  • Display rule: resolveHostDisplay now returns title/descriptorLine/lastKnown, and use-host-display.ts resolves phone override → live machine name → stored name; the mobile card, host header, and desktop settings row all consume it.
  • Tests and goldens: name-identity, descriptor-store/recorder, status-probe, and display tests added; df18276931 restores the RPC recordings to main's byte-for-byte, so the golden re-record from the deferred-save design no longer applies.

ℹ️ PR description still describes the removed confirmation step

The description's ELI5 and "What Changed" walk through a post-pairing confirmation screen ("the phone now asks what to call the desktop", "saves the host only after confirmation"), and "Visual Proof" cites QA on the earlier stacked build. fc5b452bc2 removes that screen — pairing saves immediately and names the host from the desktop's reported machine name. A reviewer following the description will look for code that is no longer in the diff, so it is worth rewriting those sections (and noting QA was not re-run on this rebuild).

Technical details
# PR body describes the pre-rewrite design

## Affected sites
- PR body (`## ELI5`, `## What Changed`, `## Visual Proof`) — describes a "confirmation screen" that suggests the machine-reported name and saves only after confirmation.
- `mobile/app/pair-confirm.tsx`, `mobile/app/pair-scan.tsx` — restored to main's immediate-save flow; no `naming`/`saving` states.
- `mobile/src/transport/pre-profile-pairing-coordinator.ts` — `saveHost` runs during pairing and `recordWinnerDescriptor` adopts the reported name afterward.

## Required outcome
- The description matches the code: save-at-pairing, then name from the desktop report; a phone rename is an override.

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

… 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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Reviewed the single commit since the prior pullfrog review (6f7545ac0e) — a focused identity-rollback fix — against the full 58-file PR diff. Focused mobile run passed (host-name-identity, use-host-display, host-store: 54 tests).

  • Stopped a save from rolling back stored name identity: mergeHostNameIdentity now drops the save payload's personalName/lastKnownMachineName/lastKnownHostPlatform and keeps the stored record's identity and existing.name. A connection re-saving its connect-time snapshot (relay credential rotation or re-resolution) can no longer resurrect a cleared rename or revert to an older machine name. Only persistHost calls it, and every caller that renames goes through updateHostNameAndEndpoint, so nothing legitimate is lost.
  • Read the web page's host name as a label: use-host-display.ts passes its source through classifyLegacyHostName, so a source with no identity fields treats a non-generated name as the phone's override. BridgeInitHost carries only id/name/endpoint/lastConnected, so a renamed host was being retitled by the live machine name; the rename now leads and the machine sits on the descriptor line. Native sources are classified on parse already, so the extra call is a no-op there.
  • Re-pinned the session route closure: SESSION_ROUTE_MODULES 4227 → 4229 (ten local modules), comment updated to name host-name-identity.ts and host-names.ts.
  • Tests: added the snapshot-rollback case to host-name-identity.test.ts (fails under the old incoming-wins merge) and a use-host-display.test.ts covering the no-identity label path.

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

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 149bbcc7-ff70-427c-9473-c1ebadc76197

📥 Commits

Reviewing files that changed from the base of the PR and between 6f7545a and 64904f5.

📒 Files selected for processing (5)
  • config/scripts/mobile-web-app-session-terminal-closure.test.mjs
  • mobile/src/transport/host-name-identity.test.ts
  • mobile/src/transport/host-name-identity.ts
  • mobile/src/transport/use-host-display.test.ts
  • mobile/src/transport/use-host-display.ts

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

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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Reviewed the single commit since the prior pullfrog review (64904f5ee7) — an additive bridge-contract change — against the full 62-file PR diff.

  • Handed the page the stored name identity: BridgeInitHostSchema gains optional personalName / lastKnownMachineName / lastKnownHostPlatform (the platform reuses the stored profile's z.enum(NODE_PLATFORM_NAMES)), and use-page-host-snapshot.ts spreads them from the stored host. The page's display rule can now tell a phone rename from the desktop's name without guessing from name alone.
  • Wire compatibility holds in both directions: the new fields are optional, so an older shell omits them (the page still classifies name as before) and an older page bundle strips the unknowns through its plain z.object schema.
  • Tests: bridge-envelope.test.ts pins pass-through of all three fields through readBridgeHostMessage, use-page-host-snapshot.test.tsx pins the identity spread, and use-host-display.test.ts adds the live-rename-over-stored-machine-name case. All assert exact values, so the schema or spread dropping a field would fail them.
  • Comment accuracy: the no-identity fallback comment in use-host-display.ts now describes an older shell rather than the normal page projection, which matches the new behavior.

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

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: bacf5cdb-0999-449d-91c4-b07c7697d94e

📥 Commits

Reviewing files that changed from the base of the PR and between 64904f5 and b8eeb40.

📒 Files selected for processing (6)
  • mobile/src/mobile-web-shell/bridge/bridge-envelope.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-envelope.ts
  • mobile/src/mobile-web-shell/use-page-host-snapshot.test.tsx
  • mobile/src/mobile-web-shell/use-page-host-snapshot.ts
  • mobile/src/transport/use-host-display.test.ts
  • mobile/src/transport/use-host-display.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • mobile/src/transport/use-host-display.ts

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

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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Reviewed the single commit since the prior pullfrog review (b8eeb40bdc) — a portability hardening for the name-identity fields — against the full 64-file PR diff. Focused mobile run passed: host-name-identity, bridge-envelope, host-edit-save-flow, host-descriptor-recorder, use-mobile-web-bundle-probe, host-open-recovery (177 tests); confirmed the new stored-host case fails under the pre-commit closed-enum schema.

  • Salvaged the stored name-identity fields: HostProfileSchema and StoredHostProfileSchema now parse personalName / lastKnownMachineName / lastKnownHostPlatform through a shared hostNameIdentityShape using salvagedOptional, so a value this build cannot read (a newer build's platform, an empty string) drops only that field instead of failing the whole record and losing the paired host on the next write.
  • Salvaged the bridge init host: BridgeInitHostSchema uses the same combinator for the three identity fields, so a newer shell's unreadable platform no longer makes the page refuse its init.
  • Documented the one name-invariant exception: withReportedDescriptor's OS-without-a-machine-name case is now stated in the host-name-identity.ts and types.ts headers.
  • Test files brought in line with the branch: the edit screen's personalName save, the opener's started descriptor probe, and host-descriptor-recorder parsing through hostStatusSchema; new exact-assertion cases cover the stored-record drop and the bridge drop.

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

…ost-display-resolution

# Conflicts:
#	config/scripts/mobile-web-app-session-terminal-closure.test.mjs
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: ready for review at dd908acdc1

Summary: the change was redesigned during review. Review then converged, and mobile emulator QA passed. The only red CI checks are a README link check that fails on other open PRs too.

What changed during review

  • The naming screen is gone. The first version asked the user to confirm a phone label before saving the pairing. Holding an unsaved pairing open while the user typed caused most of the bugs review found: cancel during save, the app killed mid-screen, re-scans blocked.
  • The phone now takes the name from the desktop. Pairing saves immediately under the name the desktop publishes (feat: name runtime machines #22094), and every connection refreshes the name and OS. A name typed on the phone's Edit screen is a phone-only override. The machine name shows under it when the two differ. See the PR description for the full before/after and how it works.
  • Fixes from review, beyond the redesign:
    • A relay credential re-save could undo a phone rename. The stored record now owns the name fields.
    • The paired web page ignored phone renames. It now receives the stored name fields.
    • An unreadable stored value could delete a whole host. Now only that field is dropped.
    • The pairing race could hang on an unreadable status reply.
    • Stale-rebase reverts of fix(mobile): the page offers no control whose only effect is a re-dial it cannot make #22326 in the host header were undone.
    • Four stale tests were fixed.
  • Merged with main twice, with conflicts resolved. The PR no longer changes any RPC recordings.

Review

  • Review/fix loops: 3 on the original design, then 4 on the redesign. The last loop came back clean with no changes.
  • Independent architecture reviews: 2. The first recommended replacing the deferred save, which led to the redesign. The second recommended keeping the redesigned architecture.
  • Readiness checklist, start and end: end verdict pass with risk, no P0 or P1. Its one merge-blocking lint finding (a symbol name) is fixed in dd908acdc1.

QA

iOS Simulator (iPhone 17 Pro Max) paired to a dev desktop built from this branch. 7 of 7 mobile scenarios pass, with screenshots in the description:

  1. Pairing without a naming step.
  2. Phone rename with the machine name shown under it.
  3. The host header.
  4. Clearing the rename.
  5. A desktop rename reaching the phone.
  6. The desktop offline shows "Last known".
  7. "Last known" still shows after an app restart.

Not exercised live: the desktop Settings → Remote Servers row, which needs a second reachable Orca runtime. Unit tests cover it.

Validation

  • pnpm tc, mobile tsc and the mobile tests-typecheck ratchet pass.
  • The full mobile suite passes: 9,558 tests.
  • check:code-quality:changed, React Doctor, the anti-slop audit, oxlint and localization checks pass.
  • Each new behavior test was checked by deleting the code it covers.

CI

18 checks pass. Three are red, all from the README local-link check (check-readme-local-links, 102 broken links under docs/assets):

  • root directory guard
  • tests node 24 8/8
  • verify, which rolls those two up

This PR touches no README or docs files, and the same check fails on other open PRs (#22748, #22746, #22744, #22743, #22742).

Worth knowing (disclosed in the description)

  • Downgrade and upgrade again: after that round trip, a name the phone had taken from the desktop is treated as a typed name. Clearing it in Edit restores the desktop's name.
  • Timing of desktop renames: a rename reaches the phone on its next connection. Pull-to-refresh on a live connection does not re-ask.
  • One more status read per connection.
  • Relay re-saves of connection snapshots: this is existing main behavior for fields other than names. Narrowing that save is a separate follow-up.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

QA update: desktop Remote Servers row verified live. I paired two dev Orca runtimes built from dd908acdc1 directly over LAN, with no relay. The remote's Machine name was QA-Remote, and the client labelled it Build Box.

  • Connected: the row shows Build Box with macOS · QA-Remote beneath it. PASS
  • Remote quit: the row shows Last known · macOS · QA-Remote. PASS
  • Not tested: a server label that matches the machine name. Settings has no way to rename a saved server, so this case is covered by unit tests only.

The screenshots are in the description under Visual Proof. Every surface this PR changes has now been exercised live: 9 of 9 scenarios pass across the iOS Simulator and desktop.

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.

@pullfrog pullfrog 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.

ℹ️ No critical issues — one stale comment left over from the label removal.

Reviewed changes

Reviewed the single commit since the prior pullfrog review (dd908acdc1) — the "Last known" label removal — against the full 57-file PR diff.

  • Removed the stale-descriptor qualifier: resolveHostDisplay drops its live input and lastKnown output, and useHostDisplay drops its connected parameter; the mobile card, host header, and desktop Remote Servers row now render descriptorLine verbatim, so an offline host shows the same OS · machine line as a live one (the row's own connection status still reports offline).
  • Removed the now-unused string: the RuntimeServerRow.lastKnownDescriptor key is gone from en.json and all five translated locales; no reference remains anywhere.
  • Tests updated: the lastKnown/live assertions in host-display-resolution.test.ts, MobileHostCard.test.ts, and host-screen-header-reconnect.test.tsx were replaced with plain descriptor expectations, and the dedicated "last known exactly when not live" case was deleted.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

/**
* The one writer of host descriptor state. Every readable status reply that arrives with a known
* host id lands here: the in-memory store repaints connected rows immediately, and the persisted
* copy is what an offline or freshly restarted app shows as "Last known". Persistence is

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.

This header still says the persisted copy is what an offline app shows as "Last known", but b3f2483324 removed that qualifier from every surface. Worth a one-line update so the comment matches what is rendered.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Removed the "Last known ·" prefix in b3f2483324, on the phone's host rows, the host header, and the desktop Remote Servers row. The OS and machine-name line now looks the same whether or not the host is connected. The row's own status (Can't connect / Reconnecting) already says when it is offline. The prefix read as if it described the name, and the flag behind it is deleted, not just hidden: the display rule no longer tracks whether the host is live. The translation added only for this prefix is removed from all six locales.

Re-captured the three offline screenshots on b3f2483324 with the same real pairing and the same two-runtime desktop setup. All three pass:

  • desktop offline
  • desktop offline after an app restart
  • remote server unreachable

The description now shows the new images. Typechecks, the mobile tests-typecheck ratchet, the affected mobile and desktop tests, lint, and localization checks all pass.

@brennanb2025
brennanb2025 merged commit 8f7cbad into main Sep 25, 2026
32 checks passed
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