Skip to content

feat(desktop): update the app from a desktop-latest feed - #1617

Merged
Gajesh2007 merged 1 commit into
masterfrom
feat/desktop-update-feed
Oct 26, 2026
Merged

Gajesh2007 merged 1 commit into
masterfrom
feat/desktop-update-feed

Conversation

@jonathan308

@jonathan308 jonathan308 commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Desktop releases have no update feed, so an installed app can never find out that a newer version exists. The feed URL is fixed when the app is built. Shipping desktop-v0.1.0 without one would mean everyone on 0.1.0 has to re-download by hand, even after we add a feed later. This should land before the first tag.

The app's update code is already in place: it checks at launch and every 4 hours, downloads in the background and installs on quit. What was missing was a feed address in release builds and somewhere to publish the feed. This adds both:

  • Feed: a fixed prerelease, desktop-latest. Each desktop-vX.Y.Z release replaces its assets. It's never marked Latest, so CLI releases keep that slot.
  • URL baked into every release build: https://github.com/Layr-Labs/d-inference/releases/download/desktop-latest (a generic electron-updater feed). A release build without a feed is refused.
  • Bonus: desktop-latest/Darkbloom-arm64.dmg is always the newest app, so the website can link to one URL that never changes.

No provider/CLI changes, and no new secrets (the existing GITHUB_TOKEN uploads the assets).

Before / After

flowchart LR
  subgraph Before["Before"]
    direction TB
    B1(["tag desktop-v0.1.1"]):::user --> B2["Release desktop-v0.1.1"]:::code
    B3["Installed 0.1.0: no feed baked in"]:::bad --> B4(["Never sees 0.1.1:<br/>users must re-download"]):::bad
  end
  subgraph After["After"]
    direction TB
    A1(["tag desktop-v0.1.1"]):::user --> A2["Release desktop-v0.1.1"]:::code
    A2 --> A3["desktop-latest: zip, blockmap,<br/>Darkbloom-arm64.dmg, then latest-mac.yml"]:::fix
    A4["Installed 0.1.0: checks desktop-latest<br/>at launch and every 4 h"]:::fix --> A3
    A3 --> A5(["Downloads 0.1.1, installs on quit"]):::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, red = defect, green = changed step / fixed outcome.

Changes

  • desktop-app/electron-builder.ts: a release build (DARKBLOOM_DESKTOP_RELEASE=1) now also requires DARKBLOOM_DESKTOP_UPDATE_URL, which must be https.
  • .github/workflows/release-desktop.yml
    • FEED_TAG/FEED_URL env; the build gets DARKBLOOM_DESKTOP_UPDATE_URL=$FEED_URL.
    • The DMG is signed and stapled after electron-builder described it in latest-mac.yml, so its sha512/size are restamped there.
    • Verify:
      • the app's app-update.yml has url: $FEED_URL;
      • latest-mac.yml is for this version and offers the zip;
      • every entry's sha512 and size match the actual file;
      • the zip's blockmap and latest-mac.yml exist.
    • The run artifact also carries the blockmap and latest-mac.yml.
    • Publish the update feed (tags only, after the versioned release):
      • creates the desktop-latest prerelease if it doesn't exist (--latest=false);
      • uploads the zip, the blockmap and Darkbloom-arm64.dmg;
      • uploads latest-mac.yml last, so the feed never offers a zip that isn't there.
    • Release notes say the app updates itself.
  • desktop-app/scripts/update-feed.mjs (+ .d.mts): the restamp and check steps above. Tested in tests/updateFeedFile.test.ts.
  • Docs:
    • docs/operations/desktop-release.md: a new The update feed section, the newest-app URL, a bad-update rollback, and the verify list.
    • docs/developer/desktop-app.md: the feed step and release qualification.
    • changelog.d/desktop-update-feed.md.

Validation

  • Update on a real Mac, end to end.
    • Built two copies, 0.1.0 and 0.1.1, through this repo's electron-builder config, signed with a Developer ID. They used a separate app ID, name and data folder, so they couldn't affect the installed app.
    • The 0.1.1 feed was served from 127.0.0.1. The app only enables checks for https feeds, so that one line was relaxed in the test builds only and reverted; the https rule has its own unit tests.
    • 0.1.0 launched, fetched latest-mac.yml and downloaded the 0.1.1 zip by itself, and ShipIt staged it.
    • On quit, ShipIt replaced the app in place ("Installation completed successfully"). The bundle on disk became 0.1.1, still signed and passing codesign --verify --deep --strict.
    • Relaunched, it fetched only latest-mac.yml, with no second download.
  • npx vitest run: 101 files, 669 tests passed (new: release refuses no feed / non-https feed; feed restamp and check).
  • npx tsc --noEmit and npx prettier --check src scripts tests *.ts *.json pass.
  • The workflow YAML parses. python3 scripts/changelog.py check and make docs-impact-check BASE=origin/master pass.
  • Dry run of this branch, run 40407808345: passed. Re-checked the artifact locally:
    • The app's app-update.yml reads provider: generic / url: https://github.com/Layr-Labs/d-inference/releases/download/desktop-latest.
    • latest-mac.yml is version 0.1.0 and lists the zip first (the top-level path) and the DMG.
    • The DMG entry was restamped after signing, and both entries match the files (Feed 0.1.0 offers: Darkbloom-0.1.0-arm64.zip, Darkbloom-0.1.0-arm64.dmg).
    • SHA256SUMS OK; spctl accepts the app and the DMG.

Not exercisable before merge: the Publish the update feed step only runs on a tag. The first desktop-v0.1.0 tag creates desktop-latest. The first real end-to-end update is desktop-v0.1.1.

Components touched

  • CI / provider release (desktop release workflow)
  • docs

Protocol / interface changes

  • No protocol/interface changes

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Release builds had no update feed, so an installed app could never learn
about a newer version, and a feed added later would not reach installs
that predate it (the feed URL is fixed at build time).

- Release builds embed the generic feed
  https://github.com/Layr-Labs/d-inference/releases/download/desktop-latest
  and electron-builder refuses a release build without a feed.
- On a desktop-v* tag, after the versioned release, the workflow creates
  the desktop-latest prerelease if needed and uploads the zip, blockmap,
  a version-less Darkbloom-arm64.dmg, and latest-mac.yml last.
- The DMG is signed and stapled after the build described it, so
  scripts/update-feed.mjs restamps its sha512 and size in latest-mac.yml;
  the verify step checks the embedded feed URL and that every feed entry
  matches its file.
- Docs: the update feed and its rollback in the release runbook; the
  developer guide's feed step and release qualification.

The app's update code was already in place (check at launch and every
4 hours, download in the background, install on quit).

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

vercel Bot commented Oct 26, 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 26, 2026 9:57pm UTC
d-inference-console-ui-dev Ready Ready Preview Oct 26, 2026 9:57pm UTC
d-inference-landing Ready Ready Preview Oct 26, 2026 9:57pm UTC
darkbloom-status Ready Ready Preview Oct 26, 2026 9:57pm UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 26, 2026 9:57pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head 63b1fef78616 against base ad7dd816e14d.

Reviewers: anthropic/claude-sonnet-5.5: first pass completed; anthropic/claude-opus-5.5: selected depth completed (1 batches); openai/gpt-6.1-sol: selected depth completed (2 batches)

LOW: New GUI auto-update channel on every provider Mac is not in the threat model

docs/operations/desktop-release.md:72 · A-011, T-013, TB-003

The PR documents that each desktop release now auto-updates every installed app from a mutable GitHub release, `desktop-latest`, whose assets are replaced on each tag (head lines 72-88, 9-10). The GUI installs, repairs and drives the provider CLI. The canonical model covers signed provider artifacts (T-013, T-034, A-011, A-017) and the operator boundary (TB-003). It does not describe this channel. Authenticity rests on Squirrel.Mac checking the Developer ID designated requirement (line 84). The `latest-mac.yml` sha512 values come from the same mutable release, so they give integrity only, not authenticity. A compromised releaser, repository token or workflow could therefore push any app signed by team SLDQ2GJ6TL to the whole fleet without user action. That app is installed on quit. Rollback relies on a higher version, because the updater never downgrades (lines 103-106). The release workflow and updater code are not supplied, so the feed checks and pinned designated requirement are unverified. Fix: add a trust boundary and threat for the desktop update feed. It should state that signature verification is the sole authenticity control, cover protection of `desktop-latest` and workflow permissions, and restate the no-downgrade and rollback limits. Also confirm the updater pins the team and bundle-ID requirement.

Raised by: anthropic/claude-opus-5.5

Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging.

Scan completed; human review required.
Cross-file reviewer requests further review; independent human review required; Final reviewer requests further review; independent human review required

Coverage: 34/34 source units; cross-file integration complete. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned.

Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens.

Saved findings and earlier report · Historical findings are not confirmed resolved.

Bedrock: 8 request(s), 206771 uncached + 0 cache-read + 75522 cache-write input / 8287 output tokens; 0 request(s) with unknown usage. OpenRouter backup used 0 time(s). Dollar amounts above cover OpenRouter only; AWS billing is reconciled separately.
Workload allowance: 9 native request(s), including one shared response repair; 500 emergency ceiling. Selected depth and integration rounds are admitted as their scope becomes known.

@Gajesh2007
Gajesh2007 merged commit 0af5e1c into master Oct 26, 2026
27 checks passed
jonathan308 added a commit that referenced this pull request Oct 27, 2026
Brings in #1615, #1618 (provider 0.10.3 hotfix), #1617, #1619 and #1620
(reversible add-on hold).

Conflicts and resolutions:
- docs/provider/cli-reference.md: only the "Last updated" stamp
  conflicted (2026-10-26 here, 2026-10-27 on master). Kept the one
  2026-10-27 stamp; both texts are kept (this branch's served-count lines
  and master's `darkbloom addon` section merged cleanly).

No semantic interplay with #1620: the served counts and the add-on hold's
"Not serving: held by add-on" status line are independent.
jonathan308 added a commit that referenced this pull request Oct 27, 2026
Brings in #1615, #1618 (provider 0.10.3 hotfix), #1617, #1619 and #1620
(reversible add-on hold).

Conflicts and resolutions:
- docs/provider/cli-reference.md: only the "Last updated" stamp
  conflicted (2026-10-26 here, 2026-10-27 on master). Kept the one
  2026-10-27 stamp; both texts are kept.
- docs/reference/protocol-messages.md: only the "Last updated" stamp
  conflicted. Kept the one 2026-10-27 stamp; this branch's no-session
  drain text and master's busy_reason/busy_since_ms/busy_addon fields
  merged cleanly.

provider-swift/Sources/ProviderCore/ProviderLoop+Lifecycle.swift merged
cleanly: #1620 changes beginServingDrain and the lifecycle monitor, this
branch only the end of performLifecycleDrain (coordinatorSettled).

Interplay with #1620, reviewed: an add-on hold keeps its registered
connection, so the stop path still waits for the coordinator's drain
acknowledgement while held; only a stop without a registered session
skips it. A planned reconnect under a hold goes through the bounded
handshake, and its fresh register still carries the busy fields.
jonathan308 added a commit that referenced this pull request Oct 27, 2026
Brings in #1615, #1618 (provider 0.10.3 hotfix), #1617, #1619 and #1620
(reversible add-on hold).

Conflicts and resolutions:
- provider-swift/Sources/ProviderCore/Service/DaemonState+Coding.swift:
  both sides appended a daemon-state key to the same CodingKeys line
  (`coordinatorConnection` here, `addonHold` from #1620). Kept both as
  `case autopilotState, coordinatorConnection, addonHold`, matching the
  struct's field order and the encode order. The decode/encode bodies
  merged cleanly; both keys stay optional (decodeIfPresent and
  encodeIfPresent), so files from older daemons still decode and older
  readers ignore the new keys.
- docs/provider/cli-reference.md: only the "Last updated" stamp
  conflicted (2026-10-26 here, 2026-10-27 on master). Kept the one
  2026-10-27 stamp; both texts are kept (this branch's Traffic line and
  master's `darkbloom addon` section).

DaemonStateFile.swift and ProviderLoop+Trust.swift merged cleanly: the
DaemonState initializer takes coordinatorConnection before appAttest and
addonHold last, and writeDaemonState passes both in that order.
jonathan308 added a commit that referenced this pull request Oct 27, 2026
Brings in #1615, #1618 (provider 0.10.3 hotfix), #1617, #1619 and #1620
(reversible add-on hold).

Conflicts and resolutions:
- docs/architecture/model-autopilot.md: only the "Last updated" stamp
  conflicted (2026-10-26 here, 2026-10-27 on master). Kept the one
  2026-10-27 stamp; both texts are kept (this branch's selected-model
  recovery sections and master's `addon_hold` busy reason).
- docs/provider/cli-reference.md: only the "Last updated" stamp
  conflicted. Kept the one 2026-10-27 stamp; both texts are kept.

Code merged cleanly, including ProviderLoop+AutopilotBusy.swift (the
recovery attempt counts as `preload`; #1620 adds `addon_hold`),
DaemonState+Coding.swift (selectedModelRecovery and addonHold keys) and
ProviderLoop+ModelLoading.swift (an unload makes waiting recoveries due;
an add-on hold's unload keeps the persisted serving set).

Interplay with #1620, reviewed: a recovery check pauses while the hold
owns admission (servingDrain.refusing), and the hold's unload pass waits
for a running attempt (modelSwitchMutationsSettled). The hold did not
cancel an attempt already loading; the next commit fixes that.
davidtai added a commit that referenced this pull request Oct 27, 2026
The merge adds #1615, #1617, #1618 (provider 0.10.3 hotfix), #1619 and
#1620 (reversible add-on hold) to this branch.

Conflicts and resolutions:
- docs/provider/cli-reference.md: only the "Last updated" stamp had a
  conflict (2026-10-26 on this branch, 2026-10-27 on master). The merge
  keeps one stamp, 2026-10-27. It keeps the two texts: the reconnect
  rows of this branch in the runtime constants, and the `darkbloom addon`
  section and the add-on runtime row of master.
- docs/reference/protocol-messages.md: only the "Last updated" stamp had
  a conflict. The merge keeps one stamp, 2026-10-27. Git put the
  "Add-on hold busy fields" section of master and the "Close codes and
  the reconnect wait" section of this branch one after the other, after
  "Provider lifecycle drain". The file has each section one time.

Git merged all code without a conflict. Only CoordinatorClientState.swift
changed on the two sides. Master adds the ProviderState.busy property.
This branch adds the CoordinatorSessionRecorder class. These changes are
in different types. The new code of master does not call the symbols
that this branch changes: ExponentialBackoff.nextDelay(), the private
functions in CoordinatorClient+Connection.swift and
MockCoordinator.dropActiveWebSocket. The gitlinks are those of master:
libs/mlx 31f550af, libs/mlx-swift 4926d3d9, libs/mlx-swift-lm aee6ebb6.
Against master, the branch has the same changes as before, except the
two stamps.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Oct 27, 2026
Brings in #1615, #1617, #1618 (provider 0.10.3 hotfix), #1619, #1620 and
#1623 (add-on hold), #1621 (Qwen JSON response formats without default
thinking) and #1622 (Qwen JSON response_format answers under the JSON
grammar).

Conflicts and resolutions:
- docs/architecture/inference.md: only the "Last updated" stamp
  conflicted (2026-10-26 here, 2026-10-27 on master). Kept the one
  2026-10-27 stamp; both texts are kept (this branch's forced-admission
  table and whitespace rule, and master's constrained Qwen JSON answer
  sections, merged cleanly).

Interplay with #1621 and #1622 (same Qwen 3.5/3.6 families):
- QwenJSONAnswerPolicy installs the JSON grammar only for requests with
  no tools and no tool_choice, so a forced request keeps this branch's
  prompt-forced, withheld and post-validated path with no token
  constraint, also when it carries a JSON response_format.
- templateAdditionalContext turns thinking off for forced legacy Qwen
  before #1621's JSON default is consulted; both give
  enable_thinking=false, and caller controls stay overridden on the
  forced path as before.
- NativeToolStreamRouter drops framing whitespace only when a tool call
  is required. A constrained JSON answer is never forced, so its bytes,
  including whitespace, stream unchanged.
@Gajesh2007 Gajesh2007 mentioned this pull request Oct 27, 2026
7 of 9 tasks

This branch was successfully deployed

5 active deployments
Preview – d-inference-console-ui-dev — 63b1fef7 Deployed Oct 26, 2026 by vercel[bot]
Preview – d-inference — 63b1fef7 Deployed Oct 26, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 63b1fef7 Deployed Oct 26, 2026 by vercel[bot]
Preview – d-inference-landing — 63b1fef7 Deployed Oct 26, 2026 by vercel[bot]
Preview – darkbloom-status — 63b1fef7 Deployed Oct 26, 2026 by vercel[bot]
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