Skip to content

fix(desktop): report the installed runtime's version and capabilities in the preview - #1483

Merged
jonathan308 merged 3 commits into
codex/desktop-mac-preview-20261012from
fix/desktop-preview-runtime-compat
Oct 15, 2026
Merged

jonathan308 merged 3 commits into
codex/desktop-mac-preview-20261012from
fix/desktop-preview-runtime-compat

Conversation

@jonathan308

@jonathan308 jonathan308 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reported from the installed Darkbloom Preview: the app update doesn't work. The preview's operation log shows each click on Update now ran darkbloom update and succeeded:

darkbloom update ⏎ Current version: 0.9.20 ⏎ Checking for updates... ⏎ Already up to date (v0.9.20).   × 5

The update was fine. The Updates page reported the wrong version. In attach-only mode (the signed local preview), the bundled desktop API runs child operations through the installed, vendor-signed runtime, but the snapshot's version, and machine.version while the provider is stopped, was the API's own ProviderCore.version. The preview bundles an API built from this branch (0.9.17) while the installed runtime is the released 0.9.20. So Updates compared 0.9.17 with the latest 0.9.20, offered Update now, the update found nothing to do, and the offer stayed forever.

The same log showed a second preview-only failure: 27 failed provider-cooling attempts:

cooling failed | Error: Unknown option '--enabled' ⏎ Usage: darkbloom <subcommand> …

The released runtime has no desktop command group (desktop --help prints top-level help and exits 0). So desktop configure-cooling, and Studio's local-only desktop start-local / stop-local / restart-local, can't run until a runtime release includes them. The UI offered them anyway and showed the CLI's usage text.

Base: codex/desktop-mac-preview-20261012 (unmerged desktop stack: #1354 plus the signed preview packaging commits). Release builds, where no runtime is attached and the API is the installed CLI, keep their own version and commands. The diff contains only this fix. The Desktop / frontend check on this base also needs #1455.

Before / After

flowchart LR
  subgraph Before["Before (preview)"]
    direction TB
    B1(["Updates page"]):::user --> B2["snapshot.version = API's own 0.9.17"]:::bad
    B2 --> B3(["“Update now” → darkbloom update:<br/>already 0.9.20 → offer stays"]):::bad
    B4(["Enable provider cooling"]):::user --> B5["installed CLI: desktop configure-cooling"]:::code
    B5 --> B6(["Unknown option '--enabled' + usage text"]):::bad
  end
  subgraph After["After (preview)"]
    direction TB
    A1(["Updates page"]):::user --> A2["runtimeProfile(): installed --version<br/>(re-read when the file is replaced)"]:::fix
    A2 --> A3(["0.9.20 · You're up to date"]):::good
    A4(["Cooling page"]):::user --> A5["desktop --help lacks configure-cooling →<br/>control_available false · action refused"]:::fix
    A5 --> A6(["“macOS manages cooling” · clear message"]):::good
  end
  classDef user fill:#1f2937,stroke:#93c5fd,color:#f9fafb
  classDef code fill:#312e81,stroke:#a5b4fc,color:#eef2ff
  classDef bad fill:#7f1d1d,stroke:#fca5a5,color:#fef2f2
  classDef fix fill:#065f46,stroke:#6ee7b7,color:#ecfdf5
  classDef good fill:#14532d,stroke:#86efac,color:#f0fdf4
Loading

Legend: blue = user action, indigo = unchanged code path, red = defect, green = changed code / fixed outcome.

Changes

  • Desktop/DesktopRuntimeProfile.swift (new):
    • DesktopRuntimeProfile holds the child-operation runtime's version and its desktop subcommands.
    • It's read with --version and desktop --help, and only trusts the latter when the usage line names desktop.
    • The result is cached per executable stamp, so an update or repair that replaces the file triggers a fresh read.
    • Release builds (executable == nil) use this build's own version and commands. The command names come from ArgumentParser's derived _commandName.
    • requireRuntimeSupport() refuses an action whose desktop subcommand is missing, saying Darkbloom 0.9.20 doesn't support this yet….
  • DesktopSnapshot.swift: version comes from the profile, and so does machine.version unless a fresh daemon state file reports one. A file left behind by an older provider process that has exited is ignored here, like every other daemon field. On the test Mac a leftover 0.9.12 file showed through.
  • DesktopBackend.swift: actions pass requireRuntimeSupport before a worker starts.
  • DesktopCooling.swift: control_available also requires configure-cooling. The profile lookup happens inside the single shared read, so concurrent readers still share one fan status child.
  • Tests/DarkbloomCLITests/DesktopRuntimeProfileTests.swift (new), with a fake older runtime (0.9.20, no desktop group):
    • version parsing, and desktop command parsing that ignores top-level help
    • this build's own commands (this caught an empty-name bug before it shipped, which would have blocked cooling in release builds)
    • the older runtime's version, its missing commands refused with a message, and its existing commands unaffected
    • cooling control reported unavailable
    • a replaced executable re-read
  • DesktopCoolingCacheTests: the fake CLI counts only fan runs, since profile probes are separate invocations.
  • scripts/test-desktop-api.py: starts with a stale daemon state file (an exited 0.0.1 provider) and checks the stopped machine reports the runtime's version. This check fails without the fix.
  • docs/developer/desktop-app.md, CHANGELOG.md.

Validation

cd provider-swift
swift test --filter "DesktopRuntimeProfileTests|DesktopCoolingCacheTests|DesktopActionArgumentsTests|DesktopExecutableWatchTests|DesktopControlTests"   # 27 tests passed
cd ..
swift build --package-path provider-swift --product darkbloom
python3 scripts/test-desktop-api.py provider-swift/.build/debug/darkbloom   # all checks passed
make docs-impact-check BASE=origin/codex/desktop-mac-preview-20261012

I also rebuilt the signed preview with this change and checked it against the installed 0.9.20 runtime; results are in the comment below.

Limitations

  • Provider cooling and Studio's local-only serving stay unavailable in the preview until a runtime release includes the desktop commands. That needs this desktop stack's Swift changes to ship.
  • The Cooling page's unavailable state uses its existing does not report supported fan controls wording rather than naming the older runtime.

🤖 Generated with Claude Code

… in the preview

In attach-only mode (the signed local preview) the bundled desktop API
runs child operations through the installed, vendor-signed runtime, but
the snapshot reported the API's own ProviderCore.version. With a 0.9.17
bundled API and an installed 0.9.20 runtime, Updates offered 0.9.20;
Update now ran `darkbloom update`, which answered "Already up to date
(v0.9.20)", and the offer stayed forever.

The released runtime also has no `desktop` command group, so provider
cooling (`desktop configure-cooling`) and Studio's local-only serving
(`desktop start-local` and friends) failed with "Unknown option
'--enabled'" and the runtime's usage text; one user session logged 27
failed cooling attempts.

Read the runtime's --version and `desktop --help` once per executable
stamp (an update replaces the file and triggers a fresh read). Report
that version in the snapshot, reject actions needing a missing desktop
subcommand with an explanation, and report cooling control unavailable.
Release builds (no attached executable) keep their own version and
commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
d-inference Ready Ready Preview Oct 14, 2026 8:04pm UTC
d-inference-console-ui-dev Ready Ready Preview Oct 14, 2026 8:04pm UTC
d-inference-landing Ready Ready Preview Oct 14, 2026 8:04pm UTC
darkbloom-status Ready Ready Preview Oct 14, 2026 8:04pm UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 14, 2026 8:04pm UTC

Request Review

The machine's version came from the daemon state file even when that file
was left behind by an older provider process that has since exited. Use it
only while the file is fresh, like every other daemon field in the snapshot,
and otherwise report the runtime's version. The desktop API harness now
starts with such a stale file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonathan308

Copy link
Copy Markdown
Collaborator Author

Checked against the installed runtime. I built a signed preview (Developer ID, not notarized) from the desktop branch plus the audit fixes and this PR (181ff7b1), installed it on a Mac whose installed runtime is the released 0.9.20, and read the running app's desktop API (read-only):

state.version 0.9.20 | state stopped          (before: 0.9.17, the bundled API's own version)
cooling supported True | control_available False   (before: true → "Unknown option '--enabled'")

The same read showed machine.version was 0.9.12, from a daemon state file a long-exited 0.9.12 provider left behind. The Updates page didn't use it because the provider was stopped, but it was stale data, so 2a37f90 ignores a non-fresh state file's version. The desktop API harness covers this, and its check fails without the fix.

Read installed-runtime versions from stdout while retaining ordinary command diagnostics. Reject incomplete or oversized probe output and cover warning, replacement and cancellation cases.

Independent behavior-preserving review completed. Parent verification passed 15 focused Foundation-only harness tests using the actual worker/profile sources and Swift syntax checks. Full provider-package integration remains a CI check; no live provider or GPU workload was run.

This branch was successfully deployed

5 active deployments
Preview – d-inference — a69bd855 Deployed Oct 14, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — a69bd855 Deployed Oct 14, 2026 by vercel[bot]
Preview – d-inference-landing — a69bd855 Deployed Oct 14, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — a69bd855 Deployed Oct 14, 2026 by vercel[bot]
Preview – darkbloom-status — a69bd855 Deployed Oct 14, 2026 by vercel[bot]
benchmarks — a69bd855 Deployed Oct 14, 2026 by jonathan308 via E2E Benchmarks #2650
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