Repository navigation
feat(desktop): update the app from a desktop-latest feed - #1617
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Threat model review — advisoryReviewed head 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 modeldocs/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. 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. |
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.
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.
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.
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.
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>
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.
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.0without 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:
desktop-latest. Eachdesktop-vX.Y.Zrelease replaces its assets. It's never marked Latest, so CLI releases keep that slot.https://github.com/Layr-Labs/d-inference/releases/download/desktop-latest(agenericelectron-updater feed). A release build without a feed is refused.desktop-latest/Darkbloom-arm64.dmgis 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_TOKENuploads 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:#f0fdf4Legend: 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 requiresDARKBLOOM_DESKTOP_UPDATE_URL, which must be https..github/workflows/release-desktop.ymlFEED_TAG/FEED_URLenv; the build getsDARKBLOOM_DESKTOP_UPDATE_URL=$FEED_URL.latest-mac.yml, so itssha512/size are restamped there.app-update.ymlhasurl: $FEED_URL;latest-mac.ymlis for this version and offers the zip;sha512and size match the actual file;latest-mac.ymlexist.latest-mac.yml.desktop-latestprerelease if it doesn't exist (--latest=false);Darkbloom-arm64.dmg;latest-mac.ymllast, so the feed never offers a zip that isn't there.desktop-app/scripts/update-feed.mjs(+.d.mts): therestampandchecksteps above. Tested intests/updateFeedFile.test.ts.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
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.latest-mac.ymland downloaded the 0.1.1 zip by itself, and ShipIt staged it.codesign --verify --deep --strict.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 --noEmitandnpx prettier --check src scripts tests *.ts *.jsonpass.python3 scripts/changelog.py checkandmake docs-impact-check BASE=origin/masterpass.app-update.ymlreadsprovider: generic/url: https://github.com/Layr-Labs/d-inference/releases/download/desktop-latest.latest-mac.ymlis version 0.1.0 and lists the zip first (the top-levelpath) and the DMG.Feed 0.1.0 offers: Darkbloom-0.1.0-arm64.zip, Darkbloom-0.1.0-arm64.dmg).SHA256SUMSOK;spctlaccepts 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.0tag createsdesktop-latest. The first real end-to-end update isdesktop-v0.1.1.Components touched
Protocol / interface changes
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.