Skip to content

Make desktop Models Autopilot-first; polish sign-in, cooling and notifications - #1

Merged
kydo-researcher merged 1 commit into
codex/desktop-live-data-and-shared-clifrom
codex/desktop-autopilot-account-polish
Oct 7, 2026
Merged

kydo-researcher merged 1 commit into
codex/desktop-live-data-and-shared-clifrom
codex/desktop-autopilot-account-polish

Conversation

@kydo-researcher

@kydo-researcher kydo-researcher commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Make the desktop app Autopilot-first, give account sign-in an explicit connection-code dialog and verified email identity, and use one consistent bottom notification across every page. This update is stacked directly on codex/desktop-live-data-and-shared-cli, the contributor branch of Layr-Labs/d-inference#1354.

Merge order: merge this PR into that branch to update Layr-Labs#1354, then review/merge Layr-Labs#1354 into its existing base. The shared Swift darkbloom CLI remains the backend for Electron. This PR contains only the subsequent app improvements; it does not duplicate Layr-Labs#1354's initial usage-accounting and dashboard integration.

What changes for users

Autopilot-first Models and onboarding

  • New installations start with Autopilot setup. Explicitly disabled Autopilot retains manual serving selection; runtimes without the capability retain the manual fallback.
  • Open Your models first, with separate Browse models, Kept in memory, and Not downloaded filters. Personal earnings rank downloaded models; seven-day network inference earnings rank browsing and recommendations.
  • Recommend up to three compatible, positively earning models from settled network payouts. Users can edit that selection before choosing Download & start Autopilot. Recommendations never automatically choose downloads behind the user's back.
  • Complete all explicitly selected downloads before enrolling/starting once. Use one startup model by default, or the chosen pins, instead of loading every recommendation simultaneously.
  • Put Keep in memory directly on downloaded rows, plus Download & keep in memory on catalog rows. Distinguish an observed resident from a pin waiting to load. Enforce the native model-slot limit and memory allowance on both sides.
  • Show only the first three ranked rows, with a full-width Show N more models bar. Search/filter changes restore the compact list without losing ranking.
  • Show actual Autopilot phase, approved inventory and memory residency; keep phase explanations and model descriptions collapsed. Support pause, resume, switch to manual and inventory refresh through the existing CLI.
  • Refresh cached inventory noninteractively through start --autopilot --model <saved startup models>, preserving the local endpoint's port, bind and auth choices. Keep removal blocked for resident, advertised or pinned models.
  • Fix Browse models crashing when catalog memory estimates are null; leave unknown estimates unavailable and retain the download-size fallback for preliminary pin checks.

Account sign-in and identity

  • Replace the sidebar's machine-name card with a bottom-left Sign in / Account control. After sign-in, show the email when supplied and Signed in underneath; long addresses truncate visually but remain accessible in full.
  • Open a simple dialog with the connection code, Copy code, and Continue in browser. Opening the browser is a deliberate click. Show waiting, completion, cancellation and retry states; reopen a pending attempt across pages without issuing duplicate requests.
  • Keep normal CLI login's automatic browser behavior. Desktop login uses the same device-code client with browser auto-open disabled.
  • Prefer the coordinator's scoped desktop grant. Explicitly support existing coordinators that return a standard provider device grant, validate the negotiated token scope, and store the dashboard credential separately from the running provider's credential.
  • Add optional owner email to the existing unwindowed account-earnings response. Swift reads it through the shared cached ledger request, checks coordinator/token identity, persists it with the account credential, and exposes only email/status to Electron. Hydrate existing logins even when local serving is stopped; clear identity on sign-out.
  • Preserve provider linkage and serving activity during dashboard sign-in/sign-out. Test owner isolation, credential replacement, persistence, renderer token isolation and native HTTP email hydration.

Home cooling and clearer status

  • Replace the chip header's live-status label with a clickable fan status. Automatic provider cooling stays blue; with cooling disabled, temperatures above 60°C gradually become warmer/redder toward 90°C. Clicking opens Cooling.
  • Read the helper's enabled policy independently of its current SMC automatic/manual mode, so a helper below its trigger still correctly shows Auto fan on. Unsupported, failed and stale observations remain neutral.
  • Show current readiness and a loaded-model count instead of historical protocol/event text such as “Provider authorization updated.” Respect coordinator verification and offline observations.
  • Use consistent product labels for Mac/model activity, cooling, operations, connection/version status and unavailable history. Keep useful diagnostic failure details accessible without filling the main UI with technical explainers.

Consistent notifications

  • Mount one OperationFeed for Home, My Macs, Leaderboard and Updates; remove My Macs' top/inline operation display and separate immediate-action error notices.
  • Render OperationToast into document.body, so route containers cannot change the bottom placement.
  • Successes disappear 10 seconds after completion. Snapshot refreshes and page navigation do not restart the countdown, and old completed operations do not reappear after reopening the app.
  • Failures remain until Close. Deduplicate the native operation failure and matching immediate action error, preserving cancellation and expandable diagnostics. Sign-in progress remains in its dedicated code dialog.

Shared backend and interfaces

Concern Change
Public recommendations Extend existing GET /v1/stats with optional model_earnings: rolling 7d, since, as_of, and ranked {id, earnings_micro_usd} rows. Reuse the stats refresh/cache; no new endpoint.
Aggregate correctness Memory/Postgres query settled positive inference payouts in a half-open window. Exclude base rewards, blank models and nonpositive payouts. Preserve micro-dollar integer precision with decimal strings; expose no account/provider identities. Aggregate failure yields null while other stats remain available.
Account identity Extend existing unwindowed GET /v1/provider/account-earnings with optional authenticated-owner email; query parameters cannot select another owner. Reuse the ledger cache instead of a separate identity endpoint.
Native snapshot Add Autopilot configuration/phase, provider status, pin allowance/slot limit, optional account email, cooling enabled/observation time, and operation model/progress. Mirror changes in TypeScript contracts and native projections.
Native actions Validate/map Autopilot enrollment, explicit download lists, pin/unpin, pause/resume/disable and inventory refresh to existing CLI commands. Downloads finish before enrollment; a failed download cannot start serving.
Review runtime Attach-only desktop builds resolve the verified installed CLI for serving actions; they do not install the ad hoc review runtime as the serving provider.

No database migration, coordinator WebSocket protocol change, release-version bump, installer change, new telemetry field or billing mutation is introduced.

Before

flowchart TB
  subgraph UI["Electron: prior desktop PR"]
    M["Models: full catalog and pool controls"] --> P["Manual-first setup; pins harder to find"]
    S["AccountControl: inline sign-in"] --> B["Browser opens immediately"]
    H["HealthBar reads event reason"] --> E["Historical backend text shown as readiness"]
    N["App + Machines operation feeds"] --> T["Bottom on Home; inline on My Macs"]
  end
  subgraph Native["Shared Swift backend"]
    B --> D["DeviceAuth: scoped grant required"]
    D --> F["Older coordinator rejects desktop sign-in"]
    A["DesktopAccountEarningsCache"] --> L["Account ledger: no email field"]
    L --> G["Generic Account label after approval"]
  end
  classDef ui fill:#dbeafe,stroke:#2563eb,color:#172554
  classDef native fill:#dcfce7,stroke:#16a34a,color:#14532d
  classDef issue fill:#fee2e2,stroke:#dc2626,color:#7f1d1d
  class M,S,H,N ui
  class D,A,L native
  class P,B,E,T,F,G issue
Loading

After

flowchart TB
  subgraph UI["Electron: explicit choices and observed status"]
    M["AutopilotModels + RecommendedModels"] --> R["Top three; expandable list; direct memory controls"]
    S["AccountControl + AccountSignInProgress"] --> B["Code; user clicks Continue in browser"]
    H["HealthBar + FanStatus"] --> V["Current readiness; Cooling shortcut"]
    N["App mounts one OperationFeed"] --> T["Portal toast at bottom on every page"]
    T --> O["Success: 10 seconds; failure: until Close"]
  end
  subgraph Native["Same Swift darkbloom CLI"]
    R --> A["DesktopAutopilot: download, verify, start, pin"]
    B --> D["DeviceLoginClient + negotiated grant scope"]
    D --> C["Separate DesktopAccountCredential"]
    C --> I["AccountEarningsCache + AccountIdentity"]
  end
  subgraph API["Existing coordinator reads"]
    W["stats: seven-day model payout aggregate"] --> M
    L["account-earnings: owner email"] --> I
    I --> G["Sidebar email + Signed in"]
  end
  classDef ui fill:#dbeafe,stroke:#2563eb,color:#172554
  classDef native fill:#dcfce7,stroke:#16a34a,color:#14532d
  classDef api fill:#fef3c7,stroke:#d97706,color:#78350f
  classDef outcome fill:#ede9fe,stroke:#7c3aed,color:#4c1d95
  class M,S,H,N ui
  class A,D,C,I native
  class W,L api
  class R,B,V,T,O,G outcome
Loading

Blue: Electron components; green: native CLI; amber: existing coordinator APIs; purple: observable outcomes; red: previous friction/failure paths.

Visual verification

Local review app: compact Autopilot browsing and direct memory controls

The screenshot is from the rebuilt local app against the current, older coordinator. Network rankings correctly say unavailable until the coordinator addition is deployed; the generic Account label likewise remains until authenticated email is supplied.

Test plan

  • make desktop-test: 420 tests across 64 files.
  • make desktop-build and npm --prefix desktop-app run lint: production build/typecheck and formatting pass.
  • swift test --filter 'Desktop|DeviceCodeLogin|DeviceAuth': 74 tests across 17 suites; native CLI builds successfully.
  • make desktop-api-test: real isolated native HTTP checks, including account email hydration/persistence, token isolation, sign-out without provider unlinking, exact counters, resource caching, cancellation and executable replacement.
  • make coordinator-test: complete coordinator suite passes, including 1,797 API tests; make coordinator-build passes.
  • go test -race ./api ./store -run 'TestAccountEarningsEmail|TestStatsIncludesPublicSevenDayModelEarnings|TestStatsModelEarningsFailure|TestNetworkModelEarnings' -count=1: focused identity and public aggregate checks pass.
  • make docs-impact-check BASE=review-fork/codex/desktop-live-data-and-shared-cli, make docs-check, and git diff --check: pass.
  • Rebuilt/ad hoc signed the local app and verified the signature. Inspected the working Browse models page and ran a real read-only Mac health check: its popup remains at the bottom across navigation and expires after completion. The signed serving provider remains running.

The PostgreSQL aggregate contract is included alongside the memory-store test, but local database-backed cases skip without a disposable DATABASE_URL. The complete Swift provider suite is not claimed here: the prior PR records missing MiMo fixture requirements in this environment; focused desktop/auth coverage passed.

Published checks: the commit is GitHub-verified and both Mermaid figures and the screenshot were inspected in the GitHub-rendered PR. This contributor fork has no registered Actions workflows, so no hosted CI or automated review results are claimed; the local validation above is complete.

Components touched

  • coordinator (Go)
  • provider-swift (Swift CLI)
  • desktop-app (Electron/React)
  • docs and native HTTP test fixture

Documentation impact

  • Update desktop developer/control reference, API contracts, model reference, CLI reference, storage architecture and changelog.
  • Keep recommendation, consent, credential-isolation, cooling-observation and notification-lifetime semantics aligned with the implementation.

Rollout and limits

  • Coordinator deployment is still required for sidebar email and network recommendations. Browser approval grants access, but the current production account response omits email; signing in again does not supply a missing field. The app retains an honest generic label/availability state on older servers.
  • Scoped desktop credentials need the coordinator/console changes already contained in Integrate live Mac dashboard, exact usage and shared Swift account backend Layr-Labs/d-inference#1354. The compatibility path uses a legacy provider grant in a separate dashboard store; it does not turn that old grant into a server-enforced read-only credential.
  • Autopilot selects from approved cached inventory. Explicit download choices remain the user's responsibility; pins protect from unloading only while Autopilot owns control. Shadow/waiting phases do not claim active model switching.
  • Fan policy and model footprint/memory observations retain native limitations. No fan-policy change was forced during verification.
  • No provider restart/replacement, merge, release publication or production deployment is part of this PR. No app binary, model weights, credential, local configuration or generated build output is committed.

@kydo-researcher
kydo-researcher merged commit f73284b into codex/desktop-live-data-and-shared-cli Oct 7, 2026
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.

2 participants