Skip to content

Fix connection reliability and polish mobile, desktop, and web connection UX#835

Merged
arul28 merged 8 commits into
mainfrom
ade/connections-mobile-polish-6a6c8bdf
Jul 16, 2026
Merged

Fix connection reliability and polish mobile, desktop, and web connection UX#835
arul28 merged 8 commits into
mainfrom
ade/connections-mobile-polish-6a6c8bdf

Conversation

@arul28

@arul28 arul28 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

Dogfooding follow-up to #834: fixes the two live connection bugs and polishes every connection surface.

Backend

  • Relay bridge validation runs proactively (control-socket open + listener bind), fixing the bootstrap deadlock that blocked PIN-less phone adoption on fresh machines; publisher gate stays fail-closed.
  • Live LAN addresses keep their canonical route kind (no more saved relabeling), so directory records publish real LAN endpoints.
  • Machine names publish with a Beta/Alpha channel suffix (stable stays clean).
  • Project registry v2: catalogVisibility (recent/system) with registration intent on every path, desktop recents mirroring, one-time migration hiding legacy auto-registered rows, and the active sync-host project always included in catalog + roster. Interactive ade code/ade code remote selections register as recent.

iOS

  • Project switching: proven-route fast path, early entry on hello_ok with parallel hydration, bounded MRU scope pre-warm, catalog stays mounted with a row spinner; top-bar crossfade.
  • Hero-minimal first-open ("Sign in" primary), real-logo sign-in sheet, quick-connect cards on the no-machine home, Settings reordered (account → status → machines top-3 + See-all) with inline per-row errors.
  • PIN keypad grid alignment, auto-submit, wrong-code shake, and a "no pairing code set" state (QR pinConfigured hint + typed pin_not_set failure, with "Enter code anyway" for stale QRs).
  • Push diagnostics collapsed; notifications button honest while unpaired; voice-input toggle removed (always available); analytics default-on within existing budgets; Chats moved to a top-bar icon; shared MachineRowView across all machine lists.

Desktop

  • Clerk avatar hosts allowlisted in renderer CSP (fixes the missing profile pictures) + monogram fallback; This-Mac card gets a "This Mac" chip, laptop icon, live reachability + version lines; Connect-a-phone row removed (Phone tab owns it); machine menu portaled; per-tab connected dots.

Web

  • Masthead web-client primary button; /pair is an app-first fallback that reads nothing from the fragment; hosted client signed-out state is sign-in-only.

Testing

  • /quality dual-review (0 Blockers; all HIGHs fixed with regression tests: host-project visibility invariant, machine-row consolidation).
  • /test: logging gate PASS (provisioner spec valid), docs validator green (193 files), mobile contract parity 5/5 both skew directions, 890 TUI + 301 CLI + 2522 desktop tests green, CI-style shard green, xcodebuild build + build-for-testing green.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Improved project catalog organization with explicit visibility and registration source, plus smarter desktop/CLI/mobile recent handling.
    • Enhanced sync status with dedicated formatting and account-directory health details; faster/safer sync bridge validation.
    • Pairing QR now carries PIN-configured state for more accurate pairing flows.
    • iOS hub quick-connect improvements, PIN entry UX updates, and added in-product capture for sign-in/machine/pairing outcomes.
  • Bug Fixes
    • Better auth-expired messaging by safely extracting short directory error reasons; improved connection snapshot freshness handling.
    • Fixed avatar fallback and upgraded machine menus to behave more reliably.
  • Documentation
    • Updated CLI docs to describe project registry metadata (visibility + registration source).

Greptile Summary

This PR updates connection reliability and connection-related UX across backend, iOS, desktop, and web. The main changes are:

  • Proactive sync listener and relay bridge validation before publishing endpoints.
  • Project registry v2 metadata for catalog visibility and registration source.
  • Mobile and desktop connection UI polish, including PIN, machine list, and account status flows.
  • Web /pair fallback changed to an app-first iPhone install page.

Confidence Score: 4/5

Mostly safe to merge after the registry migration bug is fixed.

One contained issue affects legacy project catalog visibility. The reviewed sync, relay, pairing, and UI paths otherwise have clear guards around the changed behavior.

apps/ade-cli/src/services/projects/projectRegistry.ts

T-Rex T-Rex Logs

What T-Rex did

  • Verified that the migration surfaces the hidden legacy git root as a recent item with catalogVisibility 'recent' and registrationSource 'runtime-auto', and that listRecent() returns the same root.
  • Reviewed the focused ProjectRegistry repro artifacts—the migration script and the legacy v1 registry fixture—to confirm the test setup and expected outcomes.
  • Validated the web-connection UX trace confirms the fallback CTA text and the homepage Open Web Client link, indicating the web client path is visible.
  • Noted the Playwright run completed with exit code 0 and only an unrelated React warning about fetchPriority, indicating clean execution.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
apps/ade-cli/src/services/projects/projectRegistry.ts Adds registry v2 catalog visibility/source metadata; legacy migration currently promotes all existing git roots to recent, exposing auto-registered rows.
apps/desktop/src/main/services/runtime/machineStateMigration.ts Updates machine-state migration to preserve desktop recents as recent and feed legacy recent roots into registry upgrade.
apps/ade-cli/src/services/sync/rosterBuilder.ts Filters roster projects to recent entries plus the active host project.
apps/ade-cli/src/services/account/accountMachinePublisherService.ts Adds proactive route-health-gated machine publishing and channel-suffixed machine names.
apps/ade-cli/src/services/sync/sharedSyncListener.ts Adds loopback validation, relay bridge proofing, and improved listener bind retry/parking behavior.
apps/ade-cli/src/services/sync/syncTunnelClientService.ts Validates the local relay bridge before accepting relay opens and forwards early frames safely.
apps/web/src/app/pages/PairPage.tsx Changes /pair from fragment forwarding to app-first iPhone install fallback without reading the URL payload.
apps/ios/ADE/Views/Settings/SettingsPinSheet.swift Adds auto-submit PIN entry, wrong-code feedback, and a no-pairing-code flow.
apps/desktop/src/main/rendererCsp.ts Extends renderer image CSP to allow scoped Clerk avatar hosts and uploads.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
  participant CLI as ADE CLI/Runtime
  participant Registry as ProjectRegistry v2
  participant Listener as SharedSyncListener
  participant Relay as ADE Relay
  participant Directory as Account Directory
  participant Phone as iOS/Web Client

  CLI->>Registry: add/touch project with visibility + source
  CLI->>Listener: ensureListening(port candidates)
  Listener->>Listener: bind + assert loopback nonce
  Listener-->>CLI: loopback validated status
  CLI->>Relay: open signed control socket
  CLI->>Listener: validate relay bridge to local listener
  CLI->>Directory: publish reachable endpoints gated by route health
  Phone->>Directory: read machine endpoints/catalog
  Phone->>Relay: connect via published relay endpoint
  Relay->>CLI: open pipe request
  CLI->>Listener: bridge WebSocket with private proof
  Listener-->>Phone: sync hello/catalog/roster
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
  participant CLI as ADE CLI/Runtime
  participant Registry as ProjectRegistry v2
  participant Listener as SharedSyncListener
  participant Relay as ADE Relay
  participant Directory as Account Directory
  participant Phone as iOS/Web Client

  CLI->>Registry: add/touch project with visibility + source
  CLI->>Listener: ensureListening(port candidates)
  Listener->>Listener: bind + assert loopback nonce
  Listener-->>CLI: loopback validated status
  CLI->>Relay: open signed control socket
  CLI->>Listener: validate relay bridge to local listener
  CLI->>Directory: publish reachable endpoints gated by route health
  Phone->>Directory: read machine endpoints/catalog
  Phone->>Relay: connect via published relay endpoint
  Relay->>CLI: open pipe request
  CLI->>Listener: bridge WebSocket with private proof
  Listener-->>Phone: sync hello/catalog/roster
Loading

Comments Outside Diff (2)

  1. apps/desktop/src/shared/pairingQr.ts, line 164 (link)

    P1 Preserve QR compatibility
    pinConfigured is an optional additive field, but raising the parser floor to version >= 3 makes every existing v2 pairing QR from an older desktop fail before the payload is read. That breaks mixed-version pairing when the phone/web client updates before the Mac; accept the previous payload version and treat the missing pinConfigured as undefined/nil.

    Artifacts

    Repro: focused Vitest harness for legacy v2 pairing QR parser compatibility

    • Contains supporting evidence from the run (text/typescript; charset=utf-8).

    Repro: verbose Vitest output showing v2 parses as null and comparable v3 parses successfully

    • Keeps the command output available without making the summary code-heavy.

    View artifacts

    T-Rex Ran code and verified through T-Rex

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/desktop/src/shared/pairingQr.ts
    Line: 164
    
    Comment:
    **Preserve QR compatibility**
    `pinConfigured` is an optional additive field, but raising the parser floor to `version >= 3` makes every existing v2 pairing QR from an older desktop fail before the payload is read. That breaks mixed-version pairing when the phone/web client updates before the Mac; accept the previous payload version and treat the missing `pinConfigured` as `undefined`/`nil`.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code

  2. apps/ade-cli/src/services/projects/projectRegistry.ts, line 334-337 (link)

    Preserve hidden legacy rows
    This migration promotes every legacy v1 record whose rootPath still contains a .git directory to recent, even when it was not in the desktop recent set. A v1 registry populated by runtime auto-registration therefore republishes old/system-only projects in listRecent(), so the mobile catalog and roster surface rows the migration is supposed to hide.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Artifacts

    Repro: focused ProjectRegistry migration script

    • Contains supporting evidence from the run (text/typescript; charset=utf-8).

    Repro: legacy v1 registry fixture used by the script

    • Contains supporting evidence from the run (application/json; charset=utf-8).

    Repro: command output showing migrated catalogVisibility and listRecent result

    • Keeps the command output available without making the summary code-heavy.

    View artifacts

    T-Rex Ran code and verified through T-Rex

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/ade-cli/src/services/projects/projectRegistry.ts:334-337
**Preserve hidden legacy rows**
This migration promotes every legacy v1 record whose `rootPath` still contains a `.git` directory to `recent`, even when it was not in the desktop recent set. A v1 registry populated by runtime auto-registration therefore republishes old/system-only projects in `listRecent()`, so the mobile catalog and roster surface rows the migration is supposed to hide.

Reviews (5): Last reviewed commit: "Let online saved machines override stale..." | Re-trigger Greptile

arul28 and others added 3 commits July 16, 2026 12:54
Backend: relay bridge validation now runs proactively on control-socket open
and listener bind (fixes the bootstrap deadlock that blocked PIN-less phone
adoption); live LAN addresses keep their canonical route kind instead of
degrading to 'saved'; machine names publish with a Beta/Alpha channel suffix;
project registry gains catalogVisibility with registration intent, desktop
recents mirroring, and a migration that hides legacy auto-registered rows
from the mobile catalog and roster.

iOS: switch fast-path over the last-proven route, early entry on hello_ok
with parallel hydration, bounded MRU scope pre-warm, and the Hub catalog
stays mounted during switches; hero-minimal first-open and real-logo sign-in;
quick-connect cards on the no-machine home; Settings reordered with a
top-3 + See-all machines list and inline per-row connection errors; PIN
keypad grid alignment, auto-submit, wrong-code shake, and a "no pairing code
set" state fed by the QR payload and a typed pin_not_set failure; push
diagnostics collapsed with an honest disabled state for notifications;
voice-input toggle removed (always available); analytics default-on with all
existing budgets and a coarse event set for sign-in/adoption/pairing/
quick-connect; Chats moved to a top-bar icon.

Desktop: Clerk avatar hosts allowlisted in the renderer CSP with a monogram
fallback; This-Mac card gets a chip, laptop icon, and live reachability/
version lines; Connect-a-phone row removed (Phone tab owns it); machine menu
portaled above cards; per-tab connected dots.

Web: masthead web-client primary button; /pair is now an app-first fallback
that reads nothing from the fragment; hosted client signed-out state is
sign-in-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- The mobile roster and project catalog always include the active sync-host
  project even when its registry record is system-visibility (restores the
  documented host-inclusion invariant; regression-tested).
- Registry visibility writes skip the file rewrite when nothing changes.
- iOS machine rows consolidate into one MachineRowView (row/card surfaces)
  with unified device-symbol and status-copy helpers; identical sameSyncHost
  comparators hoisted to one function; quick-connect cluster extracted to
  HubQuickConnect.swift (HubComponents back under 1k lines).
- Stale pairing QRs no longer dead-end: "Enter code anyway" returns to the
  keypad when a code was set after the QR was captured.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Interactive `ade code` attaches and explicit `ade code remote --project`
  selections register as recent/cli-explicit so actively-used projects appear
  in the mobile catalog; non-interactive probes stay system (regression
  tests added; add() never demotes).
- `ade projects list --text` shows the visibility column; ade-cli README
  documents the v2 registry fields.
- Feature docs updated for proactive relay validation, pinConfigured QR
  hint, visibility-filtered catalog/roster with host inclusion, channel
  suffixes, switch fast-path/prewarm, new iOS view files, and the app-first
  /pair fallback (validator green, 193 files).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Jul 16, 2026 10:03pm

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds project catalog metadata and migration, account-directory health reporting, credential/session notifications, sync bridge validation, pairing payload updates, iOS analytics and connection flows, desktop connection UI changes, and web pairing and navigation updates.

Changes

Project catalog and sync infrastructure

Layer / File(s) Summary
Project registry and registration wiring
apps/ade-cli/src/services/projects/*, apps/ade-cli/src/cli.ts, apps/ade-cli/src/multiProjectRpcServer.ts, apps/desktop/src/main/services/{localRuntime,remoteRuntime}/*
Project records now include catalog visibility and registration source, migrate to registry version 2, and propagate registration metadata through CLI, RPC, TUI, local runtime, remote runtime, and desktop migration paths.
Account and sync health
apps/ade-cli/src/services/account/*, apps/ade-cli/src/services/credentials/*, apps/ade-cli/src/services/sync/*
Credential read state, sign-in notifications, account-directory publisher health, sync status reporting, listener validation, tunnel bridge validation, and recent-scope prewarming are added.
Validation coverage
apps/ade-cli/src/**/*.test.ts, apps/desktop/src/main/services/**/*.test.ts
Tests cover registry migration, registration metadata, publisher outcomes, sync status, pairing candidates, and runtime project behavior.

Desktop surfaces

Layer / File(s) Summary
Desktop runtime and account UI
apps/desktop/src/main/*, apps/desktop/src/renderer/components/account/*, apps/desktop/src/renderer/components/app/*
Desktop runtime registration and forgetting flows are updated; account menus use portals, avatar failures fall back to initials, and connection tabs reject stale snapshots while showing active indicators.
Desktop sync and pairing UI
apps/desktop/src/renderer/components/settings/*, apps/desktop/src/shared/*
Account-directory health, reachable routes, app information, and pinConfigured pairing metadata are exposed in settings and QR payloads.
Desktop configuration and directory errors
apps/desktop/package.json, apps/desktop/src/main/rendererCsp.ts, apps/desktop/src/shared/accountDirectory.ts
Local-network metadata, constrained Clerk image sources, official directory resolution, and bounded directory error-reason parsing are updated.

iOS experience

Layer / File(s) Summary
Analytics, pairing, and sync contracts
apps/ios/ADE/Services/*, apps/ios/ADETests/*
Typed analytics outcomes, pairing PIN metadata, typed pairing failures, route probing, project-switch timing, and post-hello scheduling are added.
Machine and quick-connect flows
apps/ios/ADE/Views/{Components,Hub,Account}/*
Reusable machine rows, quick-connect cards, success feedback, chat badges, and project-switching indicators are introduced.
Settings and pairing interactions
apps/ios/ADE/Views/Settings/*
Machine settings, pairing-only presentation, PIN entry states, push diagnostics, and host matching are revised.

Web entry points

Layer / File(s) Summary
Pairing and marketing navigation
apps/web/src/app/pages/PairPage.tsx, apps/web/src/components/editorial/Masthead.tsx
The pairing route now presents iPhone and web-client destinations, while navigation visibility, ordering, and primary CTA styling are updated.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: desktop, ios, web, docs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. 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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the PR’s main focus on connection reliability and UX improvements across mobile, desktop, and web.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/connections-mobile-polish-6a6c8bdf

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.

@arul28 arul28 changed the title connections-mobile-polish -> Primary Fix connection reliability and polish mobile, desktop, and web connection UX Jul 16, 2026
@arul28

arul28 commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

Comment thread apps/desktop/src/main/services/runtime/machineStateMigration.ts
Migration adds from desktop recents now register recent/desktop instead of
system/runtime-auto (Greptile P1), pinned by a real-registry test; the
runtimeBridge clone-auth tests assert the new truthful connect payload shape.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@arul28

arul28 commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a649f6163f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/ade-cli/src/services/projects/projectScope.ts
Comment thread apps/desktop/src/shared/pairingQr.ts
…scovery on macOS 15

A signed-in Mac could silently fail to register in the account directory with
nothing surfacing why. The publisher now records a typed outcome for every
attempt and exposes it as routeHealth.accountDirectory (state + skipReason +
directoryOrigin + lastHttpStatus), shown in `ade sync status` and the desktop
This-Mac panel — no more invisible skips. Publishing fires immediately on
sign-in instead of waiting for the 30s heartbeat, and the brain resolves the
same directory origin as the desktop account bridge so a prod/dev issuer
mismatch can't cause a silent 401.

Also: add NSLocalNetworkUsageDescription + NSBonjourServices to the packaged
macOS app so it can browse `_ade-sync._tcp` under macOS 15 Local Network
privacy (a fresh install could advertise but not discover peers).

Review fixes: prewarm skips hidden system projects; desktop QR generation
threads the pinConfigured hint so scanned codes open the no-PIN state directly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@arul28

arul28 commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

const record = this.projectRegistry
.list()

P2 Badge Filter system projects before selecting the sync host

When ade serve starts without ADE_PROJECT_ROOT, this still chooses the most-recent row across the entire registry. This commit adds hidden system rows and updates their lastOpenedAt from automatic CLI registrations, so a background command run in an arbitrary repo can become the active phone-sync host after restart and leak that hidden project back into the phone catalog via the host inclusion path. Prefer listRecent() here, falling back only when there are no recent projects.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/ios/ADE/Services/ProductAnalytics.swift

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 19

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/ade-cli/src/services/projects/projectScope.ts (1)

211-257: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Serialize the entire sync-host transition.

syncHostTransitionDepth only observes overlap. Two concurrent calls can read the same previous host, then independently set and enable different targets, leaving multiple scopes host-enabled while syncHostProjectId names only one. Protect the deactivate→activate→restore transaction with a mutex or promise queue and test overlapping switches.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/ade-cli/src/services/projects/projectScope.ts` around lines 211 - 257,
The entire switchSyncHost transition must be serialized rather than only tracked
with syncHostTransitionDepth. Add or reuse a mutex/promise queue around the
complete deactivate, activate, failure-restore, and state-update flow in
switchSyncHost, ensuring overlapping calls cannot enable multiple sync hosts;
preserve the existing transition-depth cleanup and add coverage for concurrent
switches.
🧹 Nitpick comments (1)
apps/ade-cli/src/services/sync/rosterBuilder.ts (1)

489-504: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove redundant .slice() call.

The Array.prototype.filter() method returns a new array. Chaining .slice() before .sort() is unnecessary because mutating the filtered array with .sort() will not affect the original array returned by .list().

♻️ Proposed refactor
 export async function buildRosterSnapshot(args: BuildRosterSnapshotArgs): Promise<SyncRosterProject[]> {
   const records = args.projectRegistry
     .list()
     .filter(
       (record) =>
         record.catalogVisibility === "recent" ||
         record.projectId === args.hostProjectId,
     )
-    .slice()
     .sort((left, right) => right.lastOpenedAt - left.lastOpenedAt);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/ade-cli/src/services/sync/rosterBuilder.ts` around lines 489 - 504,
Remove the redundant .slice() call from the records construction in
buildRosterSnapshot, keeping the existing filter criteria and subsequent
most-recently-opened-first sort unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/ade-cli/src/services/account/accountMachinePublisherService.ts`:
- Around line 521-543: The account machine publisher wrapper must expose the
runtime sync state so publish can distinguish disabled sync. Update the
createAccountMachinePublisherService call and its surrounding options to provide
the isSyncEnabled callback, returning the CLI’s existing syncEnabled value while
preserving the other callbacks and configuration.

In `@apps/ade-cli/src/services/credentials/credentialStore.ts`:
- Around line 575-583: Update the unreadable-store catch path in the credential
deserialization method to continue returning an empty object for read-only
access, but throw the decryption/deserialization failure when called with
allowRewrite: true. Ensure setSync, deleteSync, and updateSync cannot rewrite
the store after an unreadable read, while preserving lastReadState =
"unreadable".

In `@apps/ade-cli/src/services/projects/projectRegistry.ts`:
- Around line 315-360: Update the registry-loading logic around the isLegacy
determination to treat only the explicitly supported legacy version as legacy;
preserve version 2 handling and reject unknown versions such as version 3 before
mapping or rewriting projects. Ensure the rejection path does not call
write(file), preventing future-version metadata from being downgraded or
discarded.

In `@apps/desktop/src/main/services/localRuntime/localRuntimeConnectionPool.ts`:
- Around line 969-971: Update the cache-hit condition in the project lookup flow
to require that the cached registration also matches the requested
registrationSource, in addition to system catalog visibility. Ensure
ensureProject sends a new registration when the source differs, while preserving
the existing cached return when both visibility and registrationSource match.

In `@apps/desktop/src/renderer/components/account/AccountPage.tsx`:
- Around line 459-475: Update the menu flow around openMenu, closeMenu, and the
portaled menu rendering to manage keyboard focus: retain the triggering element,
focus the menu item when the menu opens, close the menu on Escape, and restore
focus to the trigger on close. Apply the same behavior to the related menu
instances identified by the existing open/close handlers and rendered menu
blocks.

In `@apps/desktop/src/renderer/components/app/ConnectionsPanel.tsx`:
- Around line 328-341: Update the tab’s accessible name in the activeTabs
rendering path to include “active connection” when activeTabs[key] is true,
while keeping the decorative status dot’s aria-hidden attribute unchanged.
Locate the tab label or accessible-name element surrounding this indicator and
preserve the existing name for inactive tabs.
- Around line 235-263: Update the snapshot handling in the ConnectionsPanel
useEffect so both the initial getConnectionSnapshot() result and
onConnectionSnapshotChanged events only update state when their updatedAt is at
least as recent as the current connectionSnapshot. Preserve cancellation and
unsubscribe behavior, and ensure an older initial response cannot overwrite a
newer event.

In `@apps/desktop/src/renderer/components/settings/accountDirectorySummary.ts`:
- Around line 7-11: Update the accountSignedIn handling in
accountDirectorySummary to condition the nearby-device message on
pairingPinConfigured: retain the connection guidance when a pairing code exists,
but use concrete setup guidance such as “Set a pairing code so nearby devices
can connect” when it does not. Keep healthy false for the signed-out state.

In `@apps/ios/ADE/Services/SyncService.swift`:
- Around line 4859-4870: Clear the pairing failure state by resetting
lastPairingErrorCode and lastPairingFailure before calling
ensureDatabaseReady(). Keep these resets applied for every pairing attempt,
including when database initialization fails, so SettingsPinSheet cannot reuse
stale failure data.

In `@apps/ios/ADE/Views/Account/MobileAccessGateView.swift`:
- Around line 41-52: Update the sign-in button in MobileAccessGateView so
accountLoading displays a visible loading indicator and the unconfigured-account
state displays an explicit unavailable message. Preserve the existing enabled
button label and action for configured, non-loading accounts, while keeping the
control disabled whenever accountConfigured is false or accountLoading is true.
- Around line 16-82: Wrap the access-gate content in MobileAccessGateView’s
outer layout with a vertical ScrollView so the action buttons and
accountConnectionError remain reachable on compact screens and large Dynamic
Type. Preserve the existing spacing, styling, and centered appearance by
applying a minimum viewport-height container inside the scroll view rather than
relying on the fixed VStack height.

In `@apps/ios/ADE/Views/Hub/HubComponents.swift`:
- Around line 834-838: Make the no-machine Hub layout adaptive by constraining
the quick-connect content so primary reconnect and Settings controls remain
visible: in apps/ios/ADE/Views/Hub/HubComponents.swift:834-838, make the
no-machine content scrollable or give HubQuickConnectSection a bounded region;
in apps/ios/ADE/Views/Hub/HubQuickConnect.swift:45-64, cap the number of inline
cards and add navigation to the full machine list.

In `@apps/ios/ADE/Views/Hub/HubQuickConnect.swift`:
- Around line 22-36: Update the HubQuickConnect target-building flow around
onlineAccountMachines and onlinePairedHosts to coalesce records that represent
the same machine using deviceId/hostIdentity before rendering cards. Merge
matching account and saved records while combining their reachability state, and
ensure hasTargets and card generation consume the deduplicated collection rather
than independently filtered arrays.

In `@apps/ios/ADE/Views/Settings/ConnectionSettingsView.swift`:
- Around line 608-646: In ConnectionSettingsView.entries, replace the separate
account and saved-host passes with canonical targets grouped by stable machine
identity, merging account metadata with saved-host reachability and route
information before creating one Entry per machine. Preserve current-selection
detection across both identities. In HubQuickConnect.swift lines 22-36, consume
the same canonical target collection so account-paired machines are rendered
only once; both sites must use the shared merged representation rather than
independently deduplicating records.

In `@apps/ios/ADE/Views/Settings/SettingsPairingSection.swift`:
- Around line 228-234: Update sameSyncHost in
apps/ios/ADE/Views/Settings/SettingsPairingSection.swift (lines 228-234) to stop
using unconditional hostName equality; match only stable host identity, merge
key, or uniquely disambiguated address data. In
apps/ios/ADE/Views/Settings/ConnectionSettingsView.swift (lines 634-637), retain
host-name fallback only when no stable identity is available.

In `@apps/ios/ADE/Views/Settings/SettingsPinSheet.swift`:
- Around line 170-174: Update the cancel action in SettingsPinSheet’s Button
handler to reset isSubmitting before calling
syncService.disconnect(clearCredentials: false) and dismiss(). Preserve the
existing conditional disconnect behavior while ensuring post-pairing completion
handling is suppressed after cancellation.

In `@apps/ios/ADE/Views/Settings/SettingsPushDeliverySection.swift`:
- Around line 96-129: Update enableNotificationsControl to derive the permission
affordance from pushService.permissionStatus, which is refreshed by
refreshNotificationSettings(), rather than snapshot.permissionStatus. Refresh
notification settings before the relay/status request in the .task sequence, and
use the current service status for the denied-state label and Settings action
while preserving the existing pairing and enable flows.

In `@apps/web/src/app/pages/PairPage.tsx`:
- Around line 44-46: Update the instructional copy in the PairPage component to
tell users to scan the pairing code again after installing ADE, while preserving
the existing installation guidance.

In `@apps/web/src/components/editorial/Masthead.tsx`:
- Around line 40-68: Update the Masthead navigation actions so narrow mobile
viewports do not overflow: below the sm breakpoint, use a compact label for the
web-client CTA while preserving the full “Open web client” label at larger
widths, and ensure the iOS, web-client, and Mac actions remain visible within
the existing non-wrapping navigation. Anchor the change to the web-client link
using LINKS.webClient and MARKETING_FEATURES.OPEN_WEB_CLIENT.

---

Outside diff comments:
In `@apps/ade-cli/src/services/projects/projectScope.ts`:
- Around line 211-257: The entire switchSyncHost transition must be serialized
rather than only tracked with syncHostTransitionDepth. Add or reuse a
mutex/promise queue around the complete deactivate, activate, failure-restore,
and state-update flow in switchSyncHost, ensuring overlapping calls cannot
enable multiple sync hosts; preserve the existing transition-depth cleanup and
add coverage for concurrent switches.

---

Nitpick comments:
In `@apps/ade-cli/src/services/sync/rosterBuilder.ts`:
- Around line 489-504: Remove the redundant .slice() call from the records
construction in buildRosterSnapshot, keeping the existing filter criteria and
subsequent most-recently-opened-first sort unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2c7c4b70-bfc9-47d0-ae93-314b8b852547

📥 Commits

Reviewing files that changed from the base of the PR and between 5b6f991 and 16a2aa5.

⛔ Files ignored due to path filters (6)
  • apps/ios/ADE.xcodeproj/project.pbxproj is excluded by !**/*.xcodeproj/project.pbxproj
  • docs/features/remote-runtime/README.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/README.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
  • docs/features/web-client/README.md is excluded by !docs/**
  • docs/logging.md is excluded by !docs/**
📒 Files selected for processing (87)
  • apps/ade-cli/README.md
  • apps/ade-cli/src/bootstrap.ts
  • apps/ade-cli/src/cli.test.ts
  • apps/ade-cli/src/cli.ts
  • apps/ade-cli/src/multiProjectRpcServer.test.ts
  • apps/ade-cli/src/multiProjectRpcServer.ts
  • apps/ade-cli/src/services/account/accountAuthService.test.ts
  • apps/ade-cli/src/services/account/accountAuthService.ts
  • apps/ade-cli/src/services/account/accountMachineDirectoryService.test.ts
  • apps/ade-cli/src/services/account/accountMachinePublisherService.test.ts
  • apps/ade-cli/src/services/account/accountMachinePublisherService.ts
  • apps/ade-cli/src/services/account/sharedAccountAuthService.test.ts
  • apps/ade-cli/src/services/account/sharedAccountAuthService.ts
  • apps/ade-cli/src/services/credentials/credentialStore.test.ts
  • apps/ade-cli/src/services/credentials/credentialStore.ts
  • apps/ade-cli/src/services/projects/projectRegistry.test.ts
  • apps/ade-cli/src/services/projects/projectRegistry.ts
  • apps/ade-cli/src/services/projects/projectScope.test.ts
  • apps/ade-cli/src/services/projects/projectScope.ts
  • apps/ade-cli/src/services/sync/rosterBuilder.test.ts
  • apps/ade-cli/src/services/sync/rosterBuilder.ts
  • apps/ade-cli/src/services/sync/sharedSyncListener.ts
  • apps/ade-cli/src/services/sync/syncPairingConnectInfo.test.ts
  • apps/ade-cli/src/services/sync/syncPairingConnectInfo.ts
  • apps/ade-cli/src/services/sync/syncRemoteCommandService.ts
  • apps/ade-cli/src/services/sync/syncService.ts
  • apps/ade-cli/src/services/sync/syncTunnelClientService.test.ts
  • apps/ade-cli/src/services/sync/syncTunnelClientService.ts
  • apps/ade-cli/src/tuiClient/__tests__/appPolling.test.tsx
  • apps/ade-cli/src/tuiClient/__tests__/connection.test.ts
  • apps/ade-cli/src/tuiClient/app.tsx
  • apps/ade-cli/src/tuiClient/connection.ts
  • apps/ade-cli/src/tuiClient/remoteLauncher.ts
  • apps/desktop/package.json
  • apps/desktop/src/main/main.ts
  • apps/desktop/src/main/rendererCsp.test.ts
  • apps/desktop/src/main/rendererCsp.ts
  • apps/desktop/src/main/services/account/accountBridge.ts
  • apps/desktop/src/main/services/ipc/registerIpc.ts
  • apps/desktop/src/main/services/ipc/runtimeBridge.test.ts
  • apps/desktop/src/main/services/localRuntime/localRuntimeConnectionPool.test.ts
  • apps/desktop/src/main/services/localRuntime/localRuntimeConnectionPool.ts
  • apps/desktop/src/main/services/remoteRuntime/remoteBootstrap.ts
  • apps/desktop/src/main/services/remoteRuntime/remoteConnectionPool.ts
  • apps/desktop/src/main/services/remoteRuntime/remoteConnectionService.ts
  • apps/desktop/src/main/services/runtime/machineStateMigration.test.ts
  • apps/desktop/src/main/services/runtime/machineStateMigration.ts
  • apps/desktop/src/renderer/components/account/AccountPage.test.tsx
  • apps/desktop/src/renderer/components/account/AccountPage.tsx
  • apps/desktop/src/renderer/components/app/ConnectionsPanel.test.tsx
  • apps/desktop/src/renderer/components/app/ConnectionsPanel.tsx
  • apps/desktop/src/renderer/components/settings/SyncDevicesSection.test.tsx
  • apps/desktop/src/renderer/components/settings/SyncDevicesSection.tsx
  • apps/desktop/src/renderer/components/settings/accountDirectorySummary.ts
  • apps/desktop/src/renderer/webclient/shell/MachinePicker.tsx
  • apps/desktop/src/renderer/webclient/shell/__tests__/MachinePicker.test.tsx
  • apps/desktop/src/shared/pairingQr.test.ts
  • apps/desktop/src/shared/pairingQr.ts
  • apps/desktop/src/shared/types/remoteRuntime.ts
  • apps/desktop/src/shared/types/sync.ts
  • apps/ios/ADE/PrivacyInfo.xcprivacy
  • apps/ios/ADE/Services/AccountService.swift
  • apps/ios/ADE/Services/PairingQrPayload.swift
  • apps/ios/ADE/Services/ProductAnalytics.swift
  • apps/ios/ADE/Services/PushNotificationService.swift
  • apps/ios/ADE/Services/SyncService.swift
  • apps/ios/ADE/Views/Account/AccountConnectionsSection.swift
  • apps/ios/ADE/Views/Account/AccountSignInView.swift
  • apps/ios/ADE/Views/Account/MobileAccessGateView.swift
  • apps/ios/ADE/Views/Components/DictationMicButton.swift
  • apps/ios/ADE/Views/Components/MachineRowView.swift
  • apps/ios/ADE/Views/Hub/HubComponents.swift
  • apps/ios/ADE/Views/Hub/HubQuickConnect.swift
  • apps/ios/ADE/Views/Hub/HubScreen.swift
  • apps/ios/ADE/Views/Settings/ConnectionSettingsView.swift
  • apps/ios/ADE/Views/Settings/SettingsAnalyticsSection.swift
  • apps/ios/ADE/Views/Settings/SettingsPairingSection.swift
  • apps/ios/ADE/Views/Settings/SettingsPinSheet.swift
  • apps/ios/ADE/Views/Settings/SettingsPushDeliverySection.swift
  • apps/ios/ADE/Views/Settings/SettingsVoiceInputSection.swift
  • apps/ios/ADEClip/PrivacyInfo.xcprivacy
  • apps/ios/ADETests/ADETests.swift
  • apps/ios/ADETests/PairingAndDpopTests.swift
  • apps/ios/ADETests/ProductAnalyticsPolicyTests.swift
  • apps/ios/ADEWidgets/PrivacyInfo.xcprivacy
  • apps/web/src/app/pages/PairPage.tsx
  • apps/web/src/components/editorial/Masthead.tsx
💤 Files with no reviewable changes (2)
  • apps/ios/ADE/Views/Settings/SettingsVoiceInputSection.swift
  • apps/ios/ADE/Views/Settings/SettingsAnalyticsSection.swift

Comment thread apps/ade-cli/src/services/account/accountMachinePublisherService.ts
Comment thread apps/ade-cli/src/services/credentials/credentialStore.ts
Comment thread apps/ade-cli/src/services/projects/projectRegistry.ts Outdated
Comment thread apps/desktop/src/main/services/localRuntime/localRuntimeConnectionPool.ts Outdated
Comment thread apps/desktop/src/renderer/components/account/AccountPage.tsx
Comment thread apps/ios/ADE/Views/Settings/SettingsPairingSection.swift Outdated
Comment thread apps/ios/ADE/Views/Settings/SettingsPinSheet.swift
Comment thread apps/ios/ADE/Views/Settings/SettingsPushDeliverySection.swift
Comment thread apps/web/src/app/pages/PairPage.tsx
Comment thread apps/web/src/components/editorial/Masthead.tsx
Token/account reliability:
- getAccessToken now decides refresh from the token's real JWT exp claim, not
  the stored expiresAt bookkeeping — a token whose metadata claims validity but
  whose JWT is expired is refreshed (or cleanly reported expired) instead of
  being shipped and 401'd. OAuth expires_in is only a fallback.
- On invalid_grant, re-read account.session.v1 and retry once if another process
  rotated the refresh token (desktop app ↔ brain rotation race).
- Capture the directory's 401 reason (token expired / invalid issuer / invalid
  audience, bounded 512B) into routeHealth.accountDirectory so failures are
  named in `ade sync status` and the desktop panel.

CI: credentialStore change-notification test is deterministic via a
checkForChangesNow() hook instead of real-time polling.

Review feedback (CodeRabbit/Greptile): registry rejects unknown versions and
never downgrades on cache hit; unreadable credential stores stay fail-closed on
read but throw on mutation instead of rewriting; publisher takes isSyncEnabled;
connection snapshots are timestamp-ordered across Run/TopBar/CommandPalette/
RemoteTargets; portaled account menu manages focus; iOS quick-connect/access-gate/
pin-sheet/push-permission/host-matching quick wins; web pair-page and masthead
copy. Analytics stays default-on with no opt-out by product decision.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@arul28

arul28 commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

Addressed this iteration's review threads. Two intentional non-changes:

  • ProductAnalytics.swift consent/opt-out: kept default-on with no opt-out per an explicit product decision (iOS analytics is deliberately always-on within the existing 20/day budget + dedup; Apple requires no prompt). Not a regression.
  • ConnectionSettingsView 'one canonical machine record' (heavy lift): deferred — MachineRowView already consolidates row rendering; a deeper shared machine-model unification is out of scope for this PR.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37361af6de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/ade-cli/src/multiProjectRpcServer.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/components/app/CommandPalette.tsx (1)

399-418: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clear the previous connection snapshot when reopening.

Because fetch failures are ignored and state survives closing, a reopened palette can indefinitely expose machines that are no longer connected.

Proposed fix
   useEffect(() => {
     if (!open) return;
+    setRemoteSnapshot(null);
     const remoteRuntime = window.ade.remoteRuntime;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/desktop/src/renderer/components/app/CommandPalette.tsx` around lines 399
- 418, Reset the previously applied remote connection snapshot when the command
palette is reopened, before fetching the current snapshot in the useEffect
guarded by open. Ensure failed fetches cannot leave stale machines visible,
while preserving live updates and cleanup through applyRemoteSnapshot and the
existing unsubscribe logic.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/account-directory/src/directory.ts`:
- Around line 405-408: Update the authentication failure handling after
authenticate in the directory request flow to return status 503 when
authentication.reason is "authentication unavailable"; preserve the existing 401
response for all other authentication failures.

In `@apps/ade-cli/src/services/account/accountAuthService.ts`:
- Around line 1488-1490: The refresh path around buildSessionRecord must use
credentialStore.updateSync() as a compare-and-swap, persisting refreshed only
when the stored refresh token still equals refreshRecord.refreshToken. If it
differs, do not overwrite the session; restart token resolution using the latest
stored session, while preserving the existing return behavior for a successful
compare-and-swap.

In `@apps/ade-cli/src/services/credentials/credentialStore.ts`:
- Around line 173-175: Update the credential-change notification flow around the
listener callback to isolate subscriber failures so an exception cannot escape
the setInterval callback or terminate the ADE process. Match the best-effort
observer handling used by notifySignedIn(), while preserving the existing
credential state update and notification behavior.

In `@apps/desktop/src/renderer/components/remoteTargets/RemoteTargetList.tsx`:
- Around line 189-198: Ensure latestConnectionSnapshotUpdatedAtRef stays
synchronized whenever local connect, disconnect, or settings code creates and
applies a newer connection snapshot, not only in the IPC snapshot handler.
Centralize snapshot application if appropriate, or update the ref alongside each
local setConnectionSnapshot call so delayed older IPC snapshots are still
rejected.

---

Outside diff comments:
In `@apps/desktop/src/renderer/components/app/CommandPalette.tsx`:
- Around line 399-418: Reset the previously applied remote connection snapshot
when the command palette is reopened, before fetching the current snapshot in
the useEffect guarded by open. Ensure failed fetches cannot leave stale machines
visible, while preserving live updates and cleanup through applyRemoteSnapshot
and the existing unsubscribe logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9db6769b-5ad3-4ac9-89b5-7f7d0423868d

📥 Commits

Reviewing files that changed from the base of the PR and between 16a2aa5 and 37361af.

⛔ Files ignored due to path filters (3)
  • docs/ARCHITECTURE.md is excluded by !docs/**
  • docs/features/agents/README.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/README.md is excluded by !docs/**
📒 Files selected for processing (43)
  • apps/account-directory/src/directory.ts
  • apps/account-directory/test/directory.test.ts
  • apps/ade-cli/src/cli.test.ts
  • apps/ade-cli/src/cli.ts
  • apps/ade-cli/src/multiProjectRpcServer.test.ts
  • apps/ade-cli/src/services/account/accountAuthService.test.ts
  • apps/ade-cli/src/services/account/accountAuthService.ts
  • apps/ade-cli/src/services/account/accountMachineDirectoryService.test.ts
  • apps/ade-cli/src/services/account/accountMachinePublisherService.test.ts
  • apps/ade-cli/src/services/account/accountMachinePublisherService.ts
  • apps/ade-cli/src/services/credentials/credentialStore.test.ts
  • apps/ade-cli/src/services/credentials/credentialStore.ts
  • apps/ade-cli/src/services/projects/projectRegistry.test.ts
  • apps/ade-cli/src/services/projects/projectRegistry.ts
  • apps/ade-cli/src/tuiClient/__tests__/remoteLauncher.test.ts
  • apps/ade-cli/src/tuiClient/remoteLauncher.ts
  • apps/desktop/src/main/services/account/accountBridge.trust.test.ts
  • apps/desktop/src/main/services/account/accountBridge.ts
  • apps/desktop/src/main/services/localRuntime/localRuntimeConnectionPool.test.ts
  • apps/desktop/src/main/services/localRuntime/localRuntimeConnectionPool.ts
  • apps/desktop/src/renderer/components/account/AccountPage.test.tsx
  • apps/desktop/src/renderer/components/account/AccountPage.tsx
  • apps/desktop/src/renderer/components/app/CommandPalette.tsx
  • apps/desktop/src/renderer/components/app/ConnectionsPanel.test.tsx
  • apps/desktop/src/renderer/components/app/ConnectionsPanel.tsx
  • apps/desktop/src/renderer/components/app/TopBar.tsx
  • apps/desktop/src/renderer/components/remoteTargets/RemoteTargetList.tsx
  • apps/desktop/src/renderer/components/run/RunPage.tsx
  • apps/desktop/src/renderer/components/settings/SyncDevicesSection.test.tsx
  • apps/desktop/src/renderer/components/settings/accountDirectorySummary.test.ts
  • apps/desktop/src/renderer/components/settings/accountDirectorySummary.ts
  • apps/desktop/src/shared/accountDirectory.ts
  • apps/desktop/src/shared/types/sync.ts
  • apps/ios/ADE/Services/SyncService.swift
  • apps/ios/ADE/Views/Account/MobileAccessGateView.swift
  • apps/ios/ADE/Views/Hub/HubComponents.swift
  • apps/ios/ADE/Views/Hub/HubQuickConnect.swift
  • apps/ios/ADE/Views/Settings/ConnectionSettingsView.swift
  • apps/ios/ADE/Views/Settings/SettingsPairingSection.swift
  • apps/ios/ADE/Views/Settings/SettingsPinSheet.swift
  • apps/ios/ADE/Views/Settings/SettingsPushDeliverySection.swift
  • apps/web/src/app/pages/PairPage.tsx
  • apps/web/src/components/editorial/Masthead.tsx
🚧 Files skipped from review as they are similar to previous changes (23)
  • apps/desktop/src/shared/types/sync.ts
  • apps/desktop/src/renderer/components/settings/accountDirectorySummary.ts
  • apps/ade-cli/src/tuiClient/remoteLauncher.ts
  • apps/web/src/app/pages/PairPage.tsx
  • apps/ios/ADE/Views/Settings/SettingsPushDeliverySection.swift
  • apps/ios/ADE/Views/Hub/HubQuickConnect.swift
  • apps/desktop/src/renderer/components/account/AccountPage.test.tsx
  • apps/desktop/src/renderer/components/app/ConnectionsPanel.tsx
  • apps/desktop/src/renderer/components/app/ConnectionsPanel.test.tsx
  • apps/desktop/src/main/services/account/accountBridge.ts
  • apps/web/src/components/editorial/Masthead.tsx
  • apps/desktop/src/renderer/components/account/AccountPage.tsx
  • apps/ade-cli/src/services/account/accountMachineDirectoryService.test.ts
  • apps/desktop/src/renderer/components/settings/SyncDevicesSection.test.tsx
  • apps/ade-cli/src/services/projects/projectRegistry.ts
  • apps/ios/ADE/Views/Account/MobileAccessGateView.swift
  • apps/ios/ADE/Views/Settings/ConnectionSettingsView.swift
  • apps/ios/ADE/Views/Hub/HubComponents.swift
  • apps/ios/ADE/Views/Settings/SettingsPinSheet.swift
  • apps/ade-cli/src/services/account/accountMachinePublisherService.ts
  • apps/ade-cli/src/cli.ts
  • apps/ade-cli/src/services/account/accountMachinePublisherService.test.ts
  • apps/ios/ADE/Services/SyncService.swift

Comment thread apps/account-directory/src/directory.ts
Comment thread apps/ade-cli/src/services/account/accountAuthService.ts Outdated
Comment thread apps/ade-cli/src/services/credentials/credentialStore.ts Outdated
…cher isolation

- Machine-only sync.getStatus returns a complete typed SyncRoleSnapshot
  (localDevice, client, pairing/runtime fields, accountDirectory health).
- Directory Worker returns 503 when Clerk auth is unconfigured; clients map it
  to unavailable, never auth_expired.
- Session persistence compares refreshToken/obtainedAt before writing so a
  concurrent refresh or sign-out wins and resolution restarts from disk.
- Credential change listeners are isolated; one failing subscriber cannot
  break siblings or the watcher.
- Remote-target snapshot ordering ref advances on local connect/disconnect/
  auto-connect updates; stale IPC snapshots rejected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@arul28

arul28 commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: def1a3828d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/ios/ADE/Services/ProductAnalytics.swift
Comment thread apps/ios/ADE/Views/Settings/ConnectionSettingsView.swift Outdated
An offline account-directory row no longer claims a machine identity ahead of
a currently-discovered saved pairing for the same Mac — the reachable record
wins, so Settings can always reconnect to a live paired machine.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@arul28
arul28 merged commit c00c920 into main Jul 16, 2026
33 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