Skip to content

feat(desktop): mlx-node.app — macOS menubar app with a supervised inference sidecar - #103

Merged
Brooooooklyn merged 51 commits into
mainfrom
feat/desktop-app
Jul 30, 2026
Merged

Brooooooklyn merged 51 commits into
mainfrom
feat/desktop-app

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Turns mlx-node into a signed macOS app: a tray icon, an Admin window, and a supervised inference server that Claude Code / Codex connect to over HTTP. No terminal required.

mlx dashboard is retired — its HTTP layer is deleted, not adapted. The dashboard is now the app's Admin window, reached over app:// + a MessagePort. There is no TCP port except the inference server's, which exists for external clients.

Architecture

mlx-node.app
│
├─ MAIN  (ESM entry)                                     must NEVER block
│    Tray ●  status · Start/Stop server · Open Admin · Quit
│    BrowserWindow "Admin"  ←  app://  →  Contents/Resources/www
│    supervisor · broker (hands over a port, then leaves the data path)
│
├─ ADMIN  utilityProcess                         no addon · no Metal
│    @mlx-node/dashboard as a LIBRARY · node:sqlite + drizzle on its own thread
│    ⟵ MessagePort ⟶ renderer
│
└─ INFERENCE  utilityProcess               233 MB native · Metal · bearer auth
     @mlx-node/server createServer() → TCP, for EXTERNAL clients only

Three processes because a blocked main freezes the tray, the menus and all IPC. Measured with an identical 3s synchronous block in each location:

block in ADMIN block on MAIN
main event-loop max lag 3 ms 2960 ms
IPC round-trips completed 29 0

Why Electron

Measured, not assumed. napi-rs v3 ships dyn-symbols, so nm -u shows zero undefined napi_* symbols and no electron-rebuild is needed — NODE_MODULE_VERSION is a V8-ABI check Node-API never reaches.

Electron 43.2.0 · Node 24.18.0 · process.versions.napi = 10
addon dlopen under hardened runtime      PASS
20x 2048³ fp32 matmul   Electron 21.47 TFLOP/s == plain Node 21.47 TFLOP/s
                    DMG        installed
oMLX               786 MB       1.6 GB     bundled CPython + MLX layer
mlx-node.app      ~180 MB       508 MB     utilityProcess reuses Electron's Node

electron#44291 (PartitionAlloc capping posix_memalign at ~2 GB, which broke llama.cpp in LM Studio) does not apply: MLX allocates through MTLDevice::newBuffer → IOKit.

Server changes (all pre-existing gaps a CLI could tolerate and an app cannot)

  • /health was a constant {status:'ok'} stub → real readiness, and the last load error is now retained
  • close() hung for the full remaining generation on an open SSE stream → bounded close + force-close, idempotent
  • Zero auth → bearer / x-api-key at the single choke point
  • Out-of-band model load raced the drain timer and the Metal allocator → holds the drain suspension and the writer lock
  • No mlx serve → added, sharing the sidecar bootstrap with launch-claude

Packaging

@electron/packager with explicit Mach-O signing. The native payload is three files that must be colocated (mlx.metallib loads next to the binary; paged_attn.metallib resolves dladdr-relative), placed verbatim in Contents/Resources/native/ outside asar, because dlopen cannot read an asar archive.

The release gate asserts something codesign does not: every Mach-O has a TeamIdentifier. An unsigned Mach-O under Contents/Resources passes codesign --verify --deep --strict locally and is rejected by the notary hours later.

Bundle went 993 MB → 566 MB by excluding 7 cloud LLM SDKs unreachable without a pi-ai stream(), and the clipboard prebuilts that leak a build path.

What's in this last round (UI)

Three defects that all read as "the app feels janky", each measured against the real Admin window over the Chrome DevTools Protocol rather than inferred:

Skeletons didn't match the boxes they stood in for. h-8 against a 30px line box, h-4 against 20px, 4 skeleton rows against 6 real ones (−168px), and both tables rendered no <thead> while loading and a real one after. Text bars are now h-[1lh] inside the element carrying the font classes — one line box by construction. Verified in the shipped runtime (Chromium 150): 1lh = 20px under text-sm, 30px under text-3xl leading-none.

Every tab switch reloaded an already-loaded page. React Router unmounts the route, so each visit restarted from data === undefined. useJson now serves from an LRU and revalidates behind it.

Metrics could never hit that cache — it put Date.now() in its request path, which is the cache key, inside a memo that re-runs on every mount:

tab        cache   settled
Overview   HIT      20ms
Models     HIT      48ms
Sessions   HIT      27ms
Metrics    MISS    154ms   ← every visit, both laps
Cache      HIT      42ms

Two scrollbars on Metrics. The shell was min-h-screen (document scrolls) with main also overflow-auto — two nested scroll containers. Only Metrics exposed it, because recharts positions a legend absolute, adding 117px to main's scrollHeight without growing its box.

Verification

vp test --run          2869 passed / 21 skipped, 0 failed
yarn typecheck         0        (three projects it was silently skipping now covered)
vp lint --type-aware   0
cargo clippy/fmt       0
packaged .app          gate green: every Mach-O carries a TeamIdentifier

The suite first came back with one failure, packages/agent/__test__/cold-counter-fields.test.ts, which turned out to be a stale local artifact rather than anything on this branch. That test compares the native addon's runtime counter keys against COLD_COUNTER_FIELDS, and the working copy's .node was from Jul 28 — before restoreDeclines / writeErrors existed, though the generated index.d.cts already declared them. Confirmed rather than assumed: after yarn build:native, coldCacheStats() exposes both keys and the whole suite is green. metrics-trace.ts is byte-identical to origin/main and this branch touches neither crates/ nor that constant, so CI — which builds native fresh — never saw it.

Every new guard was checked by reverting the fix it protects. Two initially passed and shouldn't have — one exercised an unmount/remount, which re-runs useState's initializer and so never hit the live-component path the bug lives on; the other rendered a page whose default filter emits no timestamp at all. Both were rewritten until the mutation failed them.

Known gaps — deliberately not fixed here

  • Phase 0 GPU-watchdog A/B was a DID-NOT-REPRODUCE, not a clean bill of health. 240s, neither arm provoked mlx#3267. Untested aggravators: dragging the window mid-decode, an external display, a Mission Control switch. The ChildTransport seam is kept so INFERENCE can move to a fully separate OS process as a config change.
  • Signing is unexercised end-to-end — needs a Developer ID Application cert and 5 repo secrets. dry_run builds and signs without notarizing.
  • Metrics still costs ~170ms to render, now purely recharts mount cost — with the cache hit, React builds all six chart trees in one commit before it can paint anything. Fixing it means deferring chart mount by a frame, which trades a blank window for a two-stage paint.
  • The "Model usage share" legend overflows its card by 149px with 18 models. Recharts sizes a vertical legend absolute, so the card never grows.
  • The local-models table is auto-layout, so its columns still shift slightly on swap; Sessions is table-fixed and does not.
  • E2E smoke steps 3 and 6 (start the server from the tray; block ADMIN 3s) need Accessibility permission for osascript and have not been run.

Out of v1 scope: in-app chat, the mlx agent workspace, the convert/quantize lab.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WPjdT9SZ11PS93qqoxxHvY


Note

High Risk
Changes authentication, non-loopback bind gating, and health disclosure on the inference server—security-sensitive paths—alongside a new signing/notarization release pipeline; risk is partly offset by extensive new tests.

Overview
Centralizes inference hosting in @mlx-node/server/host (discovery, swap, engine env policy, logging, temp-root sweep) so mlx serve, mlx launch claude, and the desktop sidecar share the same createInferenceHost path. Addon-free subpaths host/paths and host/env-policy are exported for callers that must not dlopen the native addon.

Hardens the HTTP server for supervised use: bearer / x-api-key at one choke point (with CORS default flip when auth is on), minimal unauthenticated /health vs full body when authed, real readiness via deriveHealthStatus, bounded idempotent close() that aborts in-flight SSE, and runGuardedModelLoad ordering (drain suspension outside the writer lock). Launch-claude wiring pins launcher policy (MLX_PAGED_PREFILL_CHUNK_SIZE=2048) and fixes child env (drop inherited ANTHROPIC_API_KEY, forward per-launch token).

Docs/CLI: documents mlx serve; retires mlx dashboard in favor of the desktop Control Panel (app:// + MessagePort). CI runs yarn build:ts before early yarn mlx steps. New desktop-release.yml builds fresh on macOS, validates manifest vs tag, packages/signs, pre-notarization bundle verify, notarizes app + DMG, uploads release artifact, optional Homebrew cask bump.

Large new test suites lock auth, health, host lifecycle, logger redaction, and addon-free imports.

Reviewed by Cursor Bugbot for commit f16d21b. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_a0c17ed7-8cda-4bbd-b4bc-f1f14ebcbc5b)

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9387007d-fc62-4453-afc2-3b3c7fb83532

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@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: 10347397eb

ℹ️ 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 packages/server/src/host/index.ts Resolved
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_be4702e9-2563-4d3e-b086-9aa9d8bb07b6)

@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: c081550a97

ℹ️ 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 packages/desktop/src/main/index.ts Resolved
Brooooooklyn and others added 25 commits July 29, 2026 16:18
ml-explore/mlx#3267 (open, wontfix) reports the macOS Metal GPU watchdog
killing processes because MLX command buffers block WindowServer compositing.
An Electron app composites continuously by construction, so before building on
Electron we had to know whether it makes this materially worse. Nothing ships
MLX as an in-process Node addon in Electron today, and ci.yml:404-407 already
documents this repo tripping the same watchdog under GPU oversubscription.

Adds a minimal harness that runs an identical MLX workload in two hosts and
records how the child dies (a watchdog kill is uncatchable inside the child,
so the exit code observed by the supervising side IS the measurement).

Result, qwen3.5-9B-bf16, 240s per arm, 150s thermal cooldown between:

                    bare node    electron utilityProcess
  survived              yes            yes
  watchdog kills          0              0
  rounds                 19             18      -5.3%
  TTFT             ~2,996 ms      ~3,388 ms     +13%
  main event-loop max lag   -       114 ms

DID-NOT-REPRODUCE, not a clean bill of health: neither arm provoked the bug.
Untested aggravators remain (window drag/resize mid-decode, external display,
Mission Control switch). Keep INFERENCE behind a transport seam so it can move
to a fully separate OS process as a config change.

Two harness bugs found and fixed while building it, both worth remembering:
- The first attempt compared chunked prefill against unchunked, because
  main.mjs defaults MLX_PAGED_PREFILL_CHUNK_SIZE and bare node does not. The
  runner now exports every MLX-relevant var so neither arm inherits a default.
- Counting stream events as tokens is wrong by ~2 orders of magnitude: gemma4
  emits one aggregated chunk per turn, qwen3.5 one event per token. The real
  count is numTokens on the terminal done event.

packages/desktop is private:true and unreachable from root deps, so the
publish job (foreach -Rt --no-private) cannot npm-publish it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
… load

Four pre-existing gaps that block supervising the inference server as a child
process. A CLI user reads a stack trace; an app has to make a decision.

1. Readiness. /health was a constant {status:'ok'} — a supervisor could not
   tell "up, nothing loaded" from "model resident" from "wedged mid-load" from
   "wedged behind a full queue". Every input already existed in-process but was
   unexposed. Adds health.ts with a pure deriveHealthStatus, plus getters on
   ModelWorkCoordinator (writerActive/waitingWriters) and SessionRegistry
   (queueDepthLimit). Last-load outcome was retained NOWHERE (resolveModel
   failures became a 500 and were dropped) and is now recorded where loads are
   already bracketed.

2. close({timeoutMs}). close() was clearInterval + idleSweeper.close() +
   server.close(), with no closeAllConnections anywhere in the package — an
   open SSE stream kept the connection active, so close() hung for the full
   remaining generation, which is client-controlled and unbounded. Now
   memoized (it previously rejected ERR_SERVER_NOT_RUNNING on a second call),
   force-closes after a grace window, and returns {forced, streamsAborted,
   durationMs}. Reuses the abort path that already exists: closeAllConnections
   fires the same res 'close' -> AbortController -> native cancel that a client
   disconnect fires. Default 5000ms, deliberately longer than the ~5s GPU
   watchdog window.

3. Bearer auth at the single choke point in createHandler's closure, after the
   OPTIONS early-return and before routeRequest. Accepts x-api-key first
   (Anthropic clients send it) then Bearer; constant-time compare. authToken
   undefined is byte-identical to previous behaviour, asserted in tests.
   CORS defaults off once a token is set — it was Access-Control-Allow-Origin: *
   on every response, which would let a page that learned the token use it
   cross-origin.

   / and /health are reachable without a token: both are contentless or
   scrubbed liveness probes, and a supervisor must poll before it can be handed
   a token it may itself generate. A WRONG token still 401s on both, so a typo
   surfaces instead of reading as "everything is fine".

4. loadModel(). The bracketing order is load-bearing — getting it wrong races
   the Metal allocator, which is a corruption/abort bug, not a latency bug.
   withSuspendedDrains OUTSIDE (so the armed drain timer is covered during the
   writer-lock wait and hand-off, not just the materialization) and
   withModelLoad INSIDE (readers excluded for exactly as long as weights are
   materializing). Verified by mutation: inverting the nesting fails exactly
   one test, by name.

Not done, deliberately: no ResponseStore.close() (Rust change, documented as a
residual); no change to swap.ts's unrecoverable-load edge, since capturing the
old instance before unregistering would double peak memory, which is precisely
what the unregister-first design avoids — it is a UI-level concern.

Known wart, documented on the type: the coordinator brackets every
resolveModel including the already-resident no-op, so a no-op success can
overwrite an earlier failure record. Contained by the "no resident models" gate.

vp test __test__/server --run: 862 passed / 29 files (was 845).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
Reviewing the two `void`s added to silence no-floating-promises, the obvious
"cleanup" is to replace `void app.whenReady().then(...)` with a top-level
`await app.whenReady()`. That DEADLOCKS.

Electron waits for the ESM main module to finish evaluating before it emits
`ready`. Awaiting `ready` at module scope therefore waits on an event that
cannot fire until the await returns. Verified on Electron 43.2.0 with a
minimal main:

  A: module start, app.isReady() = false
  <hangs forever; "past await" never prints; needs SIGTERM>

So the `void ... .then()` form is deliberate and now carries a comment saying
so, to stop the next reader (or the real src/main/main.ts in Phase 3) from
"fixing" it back into a hang.

The other floating promise was a genuine bug and is fixed properly rather than
voided: `win.loadFile()` now has a .catch that logs. A loadFile rejection is
the classic packaged-app failure — blank window, no error — and under app:// it
is exactly what a missing hashed asset or a broken protocol handler looks like.
Awaiting it would be wrong too: it would block the rest of setup on a render
load for no reason.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
Preparation for the Electron app, which will call the dashboard as a library
over a MessagePort instead of HTTP. api.ts (1375 lines) dispatched into
handlers taking node:http (req, res) and wrote responses via sendJson/sendError,
so none of the logic was reachable without a socket.

api.ts is replaced by src/api/{errors,context,dispatch,routes,transcript}.ts +
handlers/*, and src/runtime.ts (createDashboardRuntime) holds the db, downloads,
and the serialized ingest chain. server.ts survives as a thin HTTP adapter —
`mlx dashboard` and the Host/Origin guards are untouched, as is static.ts.

Handlers now return values and throw typed ApiError; status is DERIVED from
code through one table, never stored separately, so the two cannot drift.
transcript.ts is a byte-identical move of ~250 lines that were already pure —
they had no direct coverage before, only incidental coverage through the HTTP
detail route, and now have 30 tests.

Test migration was mechanical by construction: a createTestClient helper
re-points calls so `fetch(`${server.url}/api/x`)` becomes `api.fetch('/api/x')`
and every assertion is preserved verbatim. Audited by script rather than by
eye: 0 test cases removed, 65 -> 74 it(), 236 -> 266 assertions. Every SQL line
and every explanatory comment (dedupKey, traceOnly, traceNetInput, NOT-IN NULL
propagation, abandoned-root traces, the delete verdict matrix) moved
byte-identically — those comments ARE the correctness argument from prior
review rounds.

19 mutations, all killed. Two survived the first pass and were green for the
wrong reason; the TESTS were fixed, not the claims:

- The data-loss guard on rename was untestable as written. It runs before the
  liveness check and BOTH return 409, and the test asserted only the status,
  never the message — so bypassing the data-loss guard fell through to liveness
  and still produced 409. This is pre-existing: the same check order and the
  same assertion exist on the parent branch, so that guard was never actually
  covered. Fixed by aging the fixture's mtime past the liveness window, leaving
  the data-loss guard as the only path to that 409.
- Awaiting an in-flight ingest during close was likewise untestable: ingestSessions
  and ingestTraces are async but have no await in their bodies, so one queued
  rescan completes within the microtasks downloads.shutdown() already costs. The
  test now queues a 40-deep chain.

Also fixes a latent shutdown bug: close() never awaited ingestChain, so an
in-flight runIngest kept running while the db closed underneath it. It was
masked by doIngest's try/catch swallowing "database is not open", and would have
become a hard ordering requirement once the db moves behind a worker.

Three gaps the brief was wrong about, now covered: DELETE /api/models/:name had
ZERO route-level coverage (so the /not found/i sniff choosing 404 vs 400 was
invisible to mutation), no test asserted the 202 on download start, and the 404
at the session-metrics site was missing from the error inventory.

Note E_PAYLOAD_TOO_LARGE (413) is defined but unreachable: "Request body too
large" returns 400 today and preserving behaviour won. Flip it deliberately if
413 was the intent.

vp test packages/dashboard --run: 280 passed (was 234).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
createServer() had exactly one production caller — launch-claude/index.ts — and
~90 of its lines were generic bootstrap tangled with Claude-Code child-spawning
that inverts for a sidecar (Electron supervises us, not the reverse). The
Electron INFERENCE utilityProcess needs that bootstrap without the spawning.

New subpath export @mlx-node/server/host: discover, swap, logger and paths move
across (logger byte-identically); net, env-policy and temp-root are new.
launch-claude shrinks 367 -> 300 lines and keeps its tests unchanged, which is
the regression gate for the extraction.

`mlx serve` is ~30 lines on top and earns its place three ways: it is the
debugging tool for when the sidecar wedges (identical host, in a terminal, with
stdout), it makes the shared module testable end-to-end without Electron, and
it is a real user-facing feature with no entry point until now.

MLX_PAGED_PREFILL_CHUNK_SIZE=2048 becomes an explicit EnginePolicy rather than
an implicit process.env write. The Rust default is 0 (no chunking), so this is
launcher POLICY, not a default — and because these vars are latched via OnceLock
on first use, Electron must pass engineEnvFor(policy) into fork({env}) and never
mutate process.env afterwards.

Three corrections to the brief this was written from, all found by reading the
code rather than working around it:

- Routing host.loadModel through ServerInstance.loadModel would be a BUG. That
  method only registers; it never unregisters, so every /model pick would leave
  the previous model's weights resident and the launcher would OOM after a few
  swaps. The same brackets are used, but they drive the single-resident swap
  controller inside them. Pinned by "swaps rather than accumulating residents".
- Running pagedConfigOverrides.cleanup() on a load failure would break the host:
  cleanup permanently disposes the manager, so a transient failure would make
  every later load fail. The real hazard is narrower — the clone is created
  before the loader runs, so a failed load leaves a root with nothing to show
  for it and close() must still reclaim it.
- The leaked temp roots are not model-sized. createOverride writes one real
  config.json and symlinks the rest, so a leak costs inodes, not gigabytes. The
  startup orphan sweep is still worth having (roots accumulate across every hard
  kill) but the severity framing was wrong.

host/paths is a SECOND subpath on purpose: folding resolveModelsDir into
host/index would make `mlx download model` dlopen the native addon at import
time — the command you run before you have anything to run, and a place where a
Metal-at-dlopen abort has bitten CI before. Verified with a process.dlopen probe.

33 mutations applied and reverted; 31 turn the suite red. The two that stay
green are documented rather than papered over: macOS/APFS readdir already
returns byte-sorted names so no fixture can prove we sort (the assertion is a
real gate on ext4 in CI — comparator semantics are now pinned separately), and
the NON_GENERATIVE filter is currently fully redundant with the no-preset guard.

vp test __test__/server __test__/cli --run: 46 files, 1127 tests, all passing.
`mlx serve --port 0` verified end to end against the real addon.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
…gon mark

The plan said images/logo.png "needs a new master with transparency". That
understated it. The file is a horizontal WORDMARK -- "MLX" plus a green hexagon,
inked across x 98..925 / y 404..629, a 3.7:1 box, RGB colortype 2 with no alpha.
The problem is not the missing alpha channel; it is that there is no app *mark*
at all. Scaled into a square icon the wordmark is illegible by 32px, and a
menubar template image must be pure black shaped only by alpha -- which neither
the gradient X nor the green hexagon can survive.

So the hexagon is promoted to the standalone mark. It is a POINTY-TOP regular
hexagon, not the flat-top one it reads as at a glance: its bounding box in the
wordmark is 128x148, and 128/148 = 0.865, which is sqrt(3)/2 to three places.
make-icons.py reproduces that geometry rather than approximating it, and samples
the fill (99,152,98) from the source rather than eyeballing a green.

  icon.icns              10 images, 16..1024 with @2x, 824/1024 Big Sur grid
  iconTemplate@1x/@2x    black + alpha; verified 0 visible non-black pixels

Both verified: the app icon has a real transparent margin (alpha min 0) and stays
legible at 16px, which is exactly what the wordmark could not do.

PLACEHOLDER, stated plainly: geometry, alpha, colour and sizes are correct so the
signing and notarization pipeline can be exercised end to end, but this is derived
art, not a designed mark. Swapping in a real master means re-running the script;
nothing downstream hard-codes the shape.

icon.iconset/ is gitignored -- it is iconutil input that carries nothing icon.icns
does not. The .icns itself is committed so building never requires Python + PIL.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
…nned

The Admin UI has no TCP port -- that was the point of choosing a custom protocol
over a localhost server. Nothing to firewall, nothing another process can connect
to, no port to collide on.

www.ts is a separate module from protocol.ts for a concrete reason, not tidiness:
`import { net, protocol } from 'electron'` cannot resolve outside an Electron
process, so anything in that file is unreachable from a plain Node test. The two
rules that must be provable therefore live in www.ts, and protocol.ts is reduced
to I/O.

Rule one: a miss under /assets/ must 404, NOT fall through to index.html. With an
index fallback a missing /assets/index-a1b2c3.js returns HTML labelled
text/javascript, and the app dies as a blank window with a syntax error pointing
at `<` -- which is exactly what a stale or mis-copied bundle produces and is
indistinguishable from a dozen unrelated packaging faults. Every other path does
fall back, so BrowserRouter deep links resolve.

Rule two, and the more useful finding: **`..` cannot escape, and NOT because of
the containment check.** Two layers collapse it first --

    new URL('app://h/../outside.txt').pathname   ->  /outside.txt
    normalize('/../outside.txt')                 ->  /outside.txt

so /assets/../../../etc/passwd lands on <root>/etc/passwd: contained, and simply
missing. A test written as `expect(...).toBeNull()` would pass, and would keep
passing with the containment check deleted outright. The tests assert the
CLAMPING instead, and the containment check is documented as defense in depth for
the one input that can still reach it -- a relative path, which is now refused by
an explicit leading-slash contract.

8 mutations applied and reverted; 7 turn the suite red:

    M1 drop the leading-slash contract        RED (2)
    M2 drop the NUL check                     RED (2)
    M3 missing asset falls back to index      RED
    M4 immutable caching always off           RED
    M5 drop trailing sep from containment   GREEN  <- unreachable, see above
    M6 serve a directory as a file            RED (2)
    M7 mime guesses instead of octet-stream   RED
    M8 decode after the containment check     RED

M5 is reported rather than papered over: no fixture can reach that line through a
URL pathname. M8 is the one that proves decode-before-check matters -- it is what
stops %00 truncating /index.html%00.png back onto a real file.

CSP ships as a response header with script-src strict (no unsafe-inline, no
unsafe-eval) and connect-src 'self': the SPA speaks over a MessagePort, never
HTTP, so it has no reason to reach the network. bypassCSP stays false, or the
header would be decorative.

Also lands entitlements.mac.plist -- one entry, allow-jit. Notably absent:
allow-unsigned-executable-memory (Apple: raises attack surface, and buys nothing
on arm64 where W^X is always on), disable-library-validation (we sign our own
.node with our own Team ID), and any Metal entitlement (shader compilation is
out-of-process in Apple's signed MTLCompilerService.xpc).

Not yet added to the root tsconfig references -- that is a solution-wide `tsc -b`
and a concurrent agent is mid-run. Typechecked standalone with --composite false.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
`codesign --verify --deep --strict` PASSES on a bundle containing an unsigned
Mach-O under Contents/Resources, and the notary rejects that same bundle hours
later. Local verification is not a predictor of notarization, so the release path
needs the check codesign does not do: "every Mach-O in here carries OUR Team ID".

Verified against real artifacts rather than assumed:

  mlx-core.darwin-arm64.node
    Identifier=libmlx_core.dylib        a build artifact name, not a bundle id
    Signature=adhoc  TeamIdentifier=not set
    LC_ID_DYLIB -> /Users/<user>/workspace/.../target/.../libmlx_core.dylib

That install name ships a developer's home directory to every user, and it is
invisible in the UI, so step 3 gates on it too.

  stock node_modules/electron/dist/Electron.app -> 15 Mach-O files, ALL adhoc

which is the useful Phase 4 fact: the ENTIRE Electron.app gets re-signed, not
just our addon.

Two things the obvious implementation gets wrong, both found by running it:

- Scanning `find -perm +111` (the approach the plan sketched) walks straight past
  the highest-risk files. A .node is not necessarily executable and a .dylib
  usually is not. Every regular file is sniffed with `file` instead.
- `set -e` + `pipefail` made the script ABORT mid-scan on a file that is not
  signed at all, because `codesign -dv` exits non-zero there. The single case
  this gate exists to catch produced the LEAST output — no FAIL line, no count,
  no later steps — and an operator would have read the abort as an unrelated
  bundle problem. Proven with a `codesign --remove-signature`d binary, which now
  reports properly alongside the adhoc addon and the leaked path.

Scoped to the bundle on purpose: "TeamIdentifier=not set" is damning inside our
app but normal for Apple's platform binaries (/usr/bin/otool reports it too),
since those are signed under Apple's authority rather than a Team ID.

--notarized adds spctl + stapler validate; without a stapled ticket the app needs
network on first launch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
Signing cannot live in ci.yml's `publish` job: that runs on ubuntu-latest, and
codesign / notarytool / stapler are macOS-only. A separate workflow also keeps
the Apple secrets out of reach of anything a PR can trigger.

`dry_run` (default true on manual dispatch) builds, packages and signs but skips
notarization and publishing. It needs only CSC_LINK + CSC_KEY_PASSWORD, so the
pipeline is exercisable before the notarization secrets exist — which matters
because notarization has the slowest feedback loop and the least reproducible
failures of anything here.

Decisions worth recording:

- Builds natively instead of downloading ci.yml's artifacts. A release is rare and
  ~16 min is cheap; artifact reuse is precisely how a stale metallib gets paired
  with a current .node, and that failure mode is garbage inference output with no
  load-time error.
- A dedicated keychain, not the login keychain. `set-key-partition-list` is
  mandatory: without it codesign blocks on a GUI prompt nobody can answer and the
  job hangs to timeout. Deleted under `if: always()`.
- `ditto -c -k --keepParent`, never `zip`, to build the notarization upload. zip
  drops the extended attributes and symlinks that a .framework needs, and a
  dropped symlink invalidates the signature.
- The DMG is signed, notarized and stapled SEPARATELY. Gatekeeper assesses it in
  its own right; skipping this is the classic "the .app is notarized but the
  download is still quarantined" bug.
- verify-bundle.sh runs BEFORE submission as well as after. A notarization round
  trip is the most expensive possible way to find out a Mach-O was missed.

One bug caught by parsing the file rather than eyeballing it: the Homebrew step
was gated on `secrets.HOMEBREW_TAP_TOKEN != ''`. The `secrets` context is NOT
available in a step `if` (only github, needs, strategy, matrix, job, runner, env,
vars, steps, inputs are) — it parses, and then never fires, so the cask would have
silently stopped being bumped. Hoisted to job-level `env` and tested there.

The `package --sign` script it invokes lands separately; everything around it here
is complete.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
node:sqlite and drizzle are synchronous, and several handlers do heavy sync
filesystem work on top. Measured before this change: a trivial RPC issued during
a 1.5 s call waited 1449 ms. In the Electron app that stalls download progress,
delays a "cancel download" click from even being RECEIVED, and false-positives
the per-RPC timeouts the supervisor depends on.

    MAIN (transport)                   WORKER (owns DashboardDb)
      DownloadManager                    SQLite + drizzle + every sync FS walk
      30 s rescan timer ──ingest──▶      serialized ingest chain + boot ingest
      call() ─┬─ main route ──▶ dispatchMain
              └─ worker route ─post──▶ dispatchWorker

Main keeps exactly the 4 download routes, because network I/O and progress events
are the thing that must never stall. Everything else goes to the worker, /health
included -- a supervisor pinging it then learns the db thread is still servicing
messages, which is the more useful signal.

3000 seeded sessions, POST /api/ingest as the heavy call:

    single thread   heavy 296.2 ms | GET /api/downloads 296.1 ms
    worker          heavy 305.6 ms | GET /api/downloads   0.2 ms

The test that pins this asserts SETTLE ORDER (['main','worker']), not timings, so
it cannot flake -- including one call issued before the worker has even booted.

Ownership is data on the route (mainRoute/workerRoute), never a path list in the
runtime, so a new route cannot silently land on the wrong thread. It is partly
type-enforced too: handler contexts were narrowed to ApiPaths / MainApiContext /
WorkerApiContext, so a dash-using handler cannot be declared on a MainRoute at
all. Partly, not wholly -- moving a db-FREE handler like /api/models to main
still compiles clean, which is why the ownership table is also locked by a test.
Verified independently: that mutation produces zero tsc output and 2 red tests.

runtime.context is narrowed to what main genuinely owns rather than given a fake
`dash`. server.ts now goes through runtime.call() because main truly cannot
dispatch a db route any more.

Shutdown ordering is still proven, not merely preserved: downloads.shutdown stays
monkey-patched, and the db half is now a `db-closed` lifecycle event the worker
posts after dash.close(). Order asserted as ['downloads.shutdown','db-closed'].
Verified independently -- swapping close() to `worker.close()` before `drain()`
turns it red.

8 mutations, 7 red. The GREEN one is reported rather than papered over: making
the worker skip its own drain still passes, because ingestSessions/ingestTraces
have fully synchronous bodies (0 awaits in either file, confirmed), so the chain
advances on microtasks and the worker cannot deliver `close` mid-run. The
main-side handshake alone suffices TODAY. M8 -- removing both layers -- does go
red, so the test is not vacuous. drainIngest() is kept and the reason recorded at
its definition: it is what holds the invariant the day an ingest awaits real I/O.

Two brief corrections the agent found by reading the code:

- The TS worker bootstrap could not stay test-only. server.test.ts calls
  startDashboardServer() with no workerUrl, so "tests point at the bootstrap" and
  "server.test.ts survives unmodified" were in conflict. It now lives in
  src/worker/ and defaultWorkerUrl() falls back to it when the built
  dist/worker/db-worker.js is absent -- which scripts run via oxnode need anyway.
  workerUrl remains for the asar path.
- The resolve hook needs `format: 'module-typescript'`. Omitting it works under
  plain node but oxnode rejects it ("Missing field 'format'"); 'module' satisfies
  oxnode but then Node parses the TypeScript as JavaScript.

server.test.ts is untouched by this change and its 74 tests pass unmodified,
which is the regression gate for the whole split. Re-verified here, not taken on
trust: 287 dashboard tests, 48 cli, typecheck clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
…ts state

The sidecar can die four ways and only one of them is honest, so the supervisor
has three states rather than two: running, crashed, and LYING — readiness says ok
while class-(b) errors appear in the trace. The third one exists because a
swallowed C++ exception produces no JS error, no HTTP error, a healthy /health,
and wrong output.

The crux is that `kill()` and a clean voluntary exit are indistinguishable on the
wire: utilityProcess reports code 0 for both. Intent is therefore a per-generation
flag set BEFORE the kill, and assessExit reads it and nothing else for the verdict.
The test does not assert this on a unit in isolation, which would be near
tautological — the fixture installs a SIGTERM handler that exits 0, as a real host
must to run InferenceHost.close(), so under child_process BOTH directions arrive
as (code 0, signal null), reproducing utilityProcess's ambiguity. Both tests also
assert lastExit is {code:0, signal:null} so the suite cannot silently start
relying on a wire difference that production does not have.

    request die code 0   ->  (0, null)  ->  CRASH, "exited 0 without being asked
                                            to", respawns as generation 2
    supervisor.stop()    ->  (0, null)  ->  clean, no respawn

Verified independently here: making the verdict read `exit.code === 0` instead of
intent turns 6 tests red.

The ChildTransport seam is load-bearing today, not speculative generality: it is
what lets the tests drive REAL child processes, and it is the escape hatch if the
GPU watchdog turns out to bite (Phase 0 did not reproduce it, which is not a
clean bill of health). Callbacks are passed at spawn rather than attached to an
emitter afterwards, because `.on('exit')` attached after fork leaves a window
where an instantly-dying child is missed — exactly the case the restart budget
exists for. kill() takes no signal because utilityProcess.kill() takes none;
forceKill() is separate because utilityProcess CANNOT escalate and has to go
around the handle. ChildExit.signal exists but is always null under
utilityProcess, so it is documented as poisoned and assessExit never reads it.

In-flight calls are REJECTED on death, not resolved with a failure envelope. An
envelope needs every caller to check a discriminant, and the caller that forgets
renders a dead sidecar as an empty model list — the same silent wrongness `lying`
exists to catch.

34 mutations applied and reverted. Three deserve naming:

- M18 was a genuine green-for-the-wrong-reason and got FIXED, not excused. The
  UTF-8 boundary test used maxBytesPerScan: 20, which happened to land on a
  character boundary — the line is 48 bytes and the multi-byte char sits at
  34-36, so a 20-byte window never split anything. Changed to 35, which cuts it
  mid-character; now red. Recorded in the test.
- M30 / M30b stay GREEN and are equivalent mutants, not coverage holes: stop()
  clears the restart timer AND the timer's callback re-checks lifecycle, so
  removing either alone changes nothing observable. M30c removes both and is red,
  which proves the behaviour is covered. Both guards kept — the clearTimeout also
  stops a pending timer holding the event loop during app quit.

Two corrections to the brief this was written from, both verified against source:

- mlx_synchronize / mlx_clear_cache do NOT call mlx_trace_native_error. They
  write std::cerr "[MLX] Exception in ..." (mlx_misc_ops.cpp has zero references
  to the tracer). That is good news: class-(b) has TWO channels and the stderr one
  needs no env var, so it survives a fork that lost the trace pair. Both are
  implemented. The stderr detector allowlists only four verified-void shims —
  the rest of the [MLX] stderr family returns a status the Rust caller checks, and
  flagging those would make `lying` cry wolf.
- The supervisor must NOT import @mlx-node/server/host. Its index.ts statically
  imports @mlx-node/lm; measured here at +30.6 MB RSS with
  mlx-core.darwin-arm64.node mapped, in MAIN — the process the three-way split
  exists to keep clean. engineEnvFor(LAUNCHER_ENGINE_POLICY) is passed in instead.

The child reports its own bound URL rather than the supervisor pre-assigning a
port: pickFreePort is racy by its own docstring, and the bound socket is the only
authority. The handshake refuses a non-loopback or non-http URL — otherwise it is
a one-line way to point readiness at something that answers 200 {"status":"ok"}
while the sidecar is dead.

82 tests. Known follow-ups, neither in scope here: the trace file grows unbounded
(~150k lines / tens of MB per 240 s with tracing always on) and nothing rotates
it; and packages/server should export a "./host/env-policy" subpath so engineEnvFor
is importable without dragging in the addon.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
…on-free

`@mlx-node/server/host` statically imports `@mlx-node/lm`, so importing it dlopens
the addon. Measured: **+30.6 MB RSS** with mlx-core.darwin-arm64.node mapped, at
module load.

That is fine for the inference sidecar, which needs the addon anyway. It is wrong
for the two callers that reach for exactly one narrow thing:

  mlx download          resolveModelsDir   the command you run BEFORE you have
                                           anything to run, and a place a
                                           Metal-at-dlopen abort has hit CI before
  Electron MAIN         engineEnvFor       the process the three-process split
                                           exists to keep small and responsive

`host/paths` already existed for the first. This adds `host/env-policy` for the
second, so the supervisor's caller can build the fork environment without dragging
in 30 MB of Metal. env-policy.ts has zero imports, so the leaf is real, not
nominal.

The part worth having: **nothing enforced this split.** It was verified once by
hand and was one stray import away from silently regressing — and the symptom, a
slower start and more memory, is invisible to a suite that only checks behaviour.
So both subpaths are now pinned two ways:

- statically, by walking the real transitive import graph from each entry and
  asserting it reaches no addon package;
- dynamically, by importing the built module in a FRESH process and checking
  `process.report().sharedObjects`. Fresh matters — inside the vitest worker some
  other test has almost certainly loaded the addon already, so an in-process check
  would be green for entirely the wrong reason. A companion test guards the guard
  by confirming the probe does report MAPPED when the addon really is loaded.

4 mutations, all red, including the one that matters most:

    M1  value import of @mlx-node/lm in env-policy      RED
    M2  TYPE-only import in paths.ts                    RED  (deliberately strict)
    M3  TRANSITIVE leak, paths -> __leak -> lm          RED
    M4  subpath export removed from package.json        RED

M2 is stricter than the runtime property on purpose: `import type` is erased and
loads nothing, but it is one character from becoming a value import and these leaf
modules have no legitimate need for those types. Recorded at the call site so it
does not read as a false positive.

The vite alias must stay longest-first — matching is prefix-based and
first-match-wins, so a shorter key would rewrite `.../host/env-policy` into
`.../src/index.ts/host/env-policy`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
… layer

The user retired `mlx dashboard`: the Admin UI now lives inside the Electron app,
served from `app://` and talking to the runtime over a MessagePort. So the HTTP
layer is deleted, not adapted. 466 lines of node:http server, 134 of static file
serving, the CLI command and its tests all go.

New `src/rpc/`: request/response with correlation ids plus push events for
download progress, multiplexed on one port. No Electron and no `node:` imports in
client/port/protocol, so the same client runs in the renderer.

`RpcPort` has exactly three members, and the shape is driven by one measured fact:
**posting to a port whose peer has already closed does not throw.** Verified on
node:worker_threads. A send therefore can never detect a dead peer, which is why
`listen()` also carries `onClose` (the only prompt death signal) and why every
request still needs a deadline (the backstop for a peer that is WEDGED rather than
gone). `listen()` fuses onMessage + onClose + `start()` into one detach because a
half-detached port -- messages off, close still armed -- is a leak shape worth
making unrepresentable.

`call()` returns a failure ENVELOPE and never rejects, giving it a byte-identical
signature to `runtime.call`. Code written against the in-process runtime works
unchanged over a port, and a transport fault arrives as a `code` the UI can branch
on rather than a rejection it can only stringify. The 30 s deadline is a NEW
guarantee, not a preserved one: the HTTP transport had no timeout at all.

The regression gate was migrated BEFORE anything was deleted. server.test.ts 74 ->
api.test.ts 55; all 22 removed tests were genuinely testing node:http and are
named in the diff -- Origin/Host guards (10), static SPA serving (3, now covered
by packages/desktop www.ts), bind + display URL (4), SSE wire framing (3, and a
MessagePort has no backpressure signal so the coalescer has nothing left to test),
plus bracketHost (3, see below). 3 added, and rpc.test.ts (22) + ui-api.test.ts
(8) are new.

18 mutations, all red. Two caveats reported rather than buried:

- M13 (EventTarget binder skips `start()`) is killed ONLY by the fake port. Node's
  MessagePort auto-starts delivery on addEventListener, so every real
  MessageChannel test stays green without it -- but a WEB MessagePort genuinely
  requires it, and that call is the only thing standing between this and a blank
  Admin window. The fake encodes the documented requirement.
- M16/M17 were GREEN on the first pass and were nearly shipped that way. The
  malformed-payload test posted junk on BOTH ports -- but a port delivers to its
  PEER, so both directions of junk went to the wrong side. The mutation was
  "caught" only by an uncaught TypeError bumping the process exit code, with 22/22
  tests passing. Rewritten as two assertion-driven tests: junk claiming an
  in-flight request's id must not settle a real caller, and a malformed request
  must not reach runtime.call.

One brief correction worth recording: "KEEP bracketHost, it is also used for
display URLs and unit-tested" was wrong for the dashboard's copy. It was never
exported from src/index.ts and its only callers were server.ts and the deleted CLI
command. The identical function survives in packages/server/src/host/net.ts with
its own tests, so deleting the dashboard copy and its 3 tests loses no coverage.
That file's docstring still claims the dashboard carries its own copy; now stale.

Left deliberately: `matchStreamRoute` and the `stream?: true` route marker now have
zero callers -- the port bridge lets the events route reach the 503 placeholder
instead of intercepting it (pinned by a new test). Removing them touches three
more files and is a separate change. docs/dashboard.md, docs/cli.md and CLAUDE.md
still document `mlx dashboard`.

dashboard 293 · cli 35 · typecheck clean · ui bundle contains zero node: imports.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
The rest of MAIN. Every real decision lives in an Electron-free module with tests
(tray-view, window-policy, settings, paths) and the Electron files are reduced to
I/O -- the same split as www.ts, for the same reason: `import { app, Tray } from
'electron'` cannot resolve outside an Electron process, so anything in such a file
is unreachable from a plain Node test.

Eight macOS behaviours that are easy to get silently wrong, and what was chosen:

- `window-all-closed` is subscribed with an EMPTY handler. It must exist: with no
  subscriber Electron's default is to quit, which would take the tray and the
  sidecar with it. This is a menubar app; closing the window is not quitting.
- Quit intent is read through an `isQuitting()` FUNCTION, never a captured value.
  A boolean copied at construction time is permanently false, and the user is
  trapped in an app that will not exit.
- Single-instance lock at module scope; the loser quits without wiring anything,
  so a second launch cannot start a rival supervisor fighting over the same port
  and models. `second-instance` surfaces the existing window.
- Menubar-only via `app.dock.hide()`, with a "Show in Dock" toggle, because
  `app.dock.show()` is reversible at runtime and `LSUIElement` alone is not. Two
  consequences handled: an accessory app has no menu bar, so a minimal
  appMenu/editMenu/windowMenu is installed for the Cmd+C / Cmd+Q key equivalents;
  and showing a window does not front an accessory app, so `show()` calls
  `app.focus({steal:true})`.
- The tray icon is a template image, set explicitly with `setTemplateImage(true)`
  rather than relying on the filename suffix. An empty image logs loudly -- an
  invisible menubar item is otherwise completely silent.
- `lying` is visually distinct from `running` on THREE axes: indicator, menubar
  title (⚠) and status line (OUTPUT IS NOT TRUSTWORTHY). Colour is not available
  -- the icon is a mask macOS tints -- so text has to carry it. Collapsing any one
  of the three into `running` turns a test red.
- A corrupt settings file is quarantined to `settings.json.corrupt-<iso>` and
  recovered per key, so one bad value does not cost every setting. An UNREADABLE
  file is left strictly alone: a permissions error is not evidence the contents
  are bad, and quarantining on it would destroy a good config.
- All fs is async, writes are debounced and `unref`'d, and saves are temp+rename.

26 mutations, all red. M10 (write in place instead of temp+rename) was the one
green-for-the-wrong-reason and was FIXED rather than excused: crash atomicity is
unobservable without crashing mid-write, so the test now pins the one externally
visible difference the two implementations have -- the target file is created
0o400, and `rename(2)` succeeds over it (it needs directory permission, not file
permission) while an in-place `writeFile` gets EACCES.

Three corrections found by reading and running, not assuming:

- The preload had to be `index.cts`. The package is `"type":"module"`, so a
  compiled `.ts` is ESM, and a SANDBOXED preload must be CommonJS. The same
  constraint forbids relative imports there, so the two channel names are
  duplicated as literals -- pinned by a test that reads the preload source. Note
  `include` must list `src/**/*.cts` explicitly; `**/*.ts` does not match `.cts`.
- `url.origin` is a trap for `app://`. The scheme is standard only inside
  Chromium; to Node's parser -- MAIN itself, and every test -- it is non-special,
  so `new URL('app://mlx/').origin` is the string 'null', and so is
  `app://mlx.evil/`. An origin check refuses every real navigation AND accepts the
  look-alike. Compares `protocol` + `host` instead.
- Found only by launching it: the first run never wrote the settings file, so
  every launch saw `source === 'missing'` and reopened the Admin window forever.

The broker seam is pull, not push: the renderer announces readiness and MAIN mints
a fresh MessageChannel in response. A transferred port is consumed once, so
posting on `did-finish-load` races the page's listener with no recovery; asking
makes reloads ordinary. `createAdminWindowManager` already owns the ipcMain
listener and validates the sender; wiring the port is one callback.

Verified live: built to dist/, launched against a scratch --user-data-dir. Scheme
+ protocol install, tray, settings load/save, `app://mlx/` loads with no loadURL
rejection, supervisor fork with its crash/backoff path and stderr tail all work,
and SIGTERM exits rc=0 in 92 ms with no orphaned helpers. 137 tests.

Two things this does not fix, both real: `@mlx-node/server` is not declared in
packages/desktop dependencies (it resolves today via the hoisted workspace symlink
and the tsconfig project reference), and packages/desktop is still absent from the
root tsconfig references, so `yarn build:ts` does not emit its dist/.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
…tly once

`yarn workspace @mlx-node/desktop package [--sign]` now produces a launchable
bundle. Run against the real tree, not designed on paper — every decision below
came from a failure it actually hit.

**Pointing @electron/packager at packages/desktop does not work.** `prune: true`
walks the tree with flora-colossus from the app dir, and Yarn hoists workspace
deps to the REPO ROOT, so it dies with `Failed to locate module "@mlx-node/lm"`.
Turning pruning off is worse: `packages/desktop/node_modules` holds only @types
(2.8 MB), so the app would package cleanly and fail on first launch. Copying the
root tree is not an option either — it is 920 MB.

So `stage-app.ts` computes the runtime closure explicitly and copies it: 141
external + 5 workspace packages, deterministic, no network, and exactly the
versions that were tested. (`npm install --omit=dev` into a stage would
re-resolve against the registry and could ship something nobody ran.)

Three things that were wrong until the build said so:

- **optionalDependencies may legitimately be absent.** Treating a missing one as
  fatal failed on `@mariozechner/clipboard-win32-x64-msvc` — a Windows prebuilt
  that cannot exist on macOS. Missing optional now skips (and is COUNTED in the
  output, so "skipped 8" stays distinguishable from a dependency that quietly
  failed to install); a missing hard dependency stays fatal.
- **The native payload was shipping TWICE, and the app was 993 MB.**
  `@mlx-node/core-darwin-arm64` is napi's published prebuilt — the same .node and
  both metallibs already staged at Contents/Resources/native, 239 MB of exact
  duplicate. Nothing even loads it: index.cjs checks
  NAPI_RS_NATIVE_LIBRARY_PATH first, which is the whole reason the payload is
  staged separately. Excluded -> **993 MB -> 755 MB**.
- **packager returns the PLATFORM directory, not the .app.** Treating the return
  value as the bundle puts every later path one level too high, and the first
  symptom is ENOENT on a file that is present.

asar is off deliberately: dlopen cannot read from an asar archive, and both the
addon and the sidecar that loads it would need unpacking anyway. With a 233 MB
payload outside the archive regardless, asar buys nothing and costs a class of
path bug that only reproduces in a packaged build.

install_name_tool runs on the STAGED copy before anything signs it, and it works:

    LC_ID_DYLIB  name @rpath/mlx-core.darwin-arm64.node
    (was /Users/<builder>/.../target/aarch64-apple-darwin/release/deps/libmlx_core.dylib)

verify-bundle.sh got a performance fix that was not optional: it ran `file`
per-file across ~30k files twice and was killed at two minutes. One batched
xargs pass shared by both steps -> **27 s**. It then immediately earned its
keep by catching a leak nobody was looking for -- a THIRD-PARTY prebuilt shipping
its CI build path inside our bundle:

    @mariozechner/clipboard-darwin-arm64/clipboard.darwin-arm64.node
      /Users/runner/work/clipboard/clipboard/target/.../libcrosscopy_clipboard.dylib

Also verified: our icon.icns IS applied (packager renames it to electron.icns; the
"could not find icon with extension .icon" warning only skips the new macOS 26
`.icon` format and is benign), and Resources/native/ holds all three files
colocated, which MLX requires.

Still 755 MB against a 508 MB estimate. The gap is ~238 MB of AI-SDK
transitively pulled in by @mlx-node/dashboard -> @earendil-works/pi-coding-agent
(openai, @mistralai, @google, @aws-sdk, @opentelemetry, protobufjs). Bundling the
entries would collapse it; that is a separate change and belongs after the
ADMIN/INFERENCE entries exist.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
…server

The command and the HTTP server were deleted, but three docs still told people to
run `mlx dashboard --port 8080` and described a Host/Origin guard for a socket
that no longer exists. Documentation that names a removed command is worse than
none: it sends someone to debug an error message instead of reading the change.

- `docs/dashboard.md` — retitled to the Admin window. New sections for where it
  actually runs (ADMIN utilityProcess, db + sync FS on a worker thread, MessagePort
  to the renderer) and for using it as a library. The Pages / Data sources /
  persistPagedCache / env-var content was still accurate and is untouched.
- The Security model section was inverted rather than edited. The HTTP threat
  surface is gone — no socket to bind, nothing to firewall, no host/origin guard to
  get wrong — so it now documents what actually remains: the sandboxed renderer,
  the strict CSP served on `app://` (script-src 'self', connect-src 'self', and
  bypassCSP false or the header would be decorative), the /assets 404 rule, and the
  fact that mutations are still reachable by whatever holds the port.
- "HTTP API" is now "API": same route table, same addressing, over a port.
  Documents that `call()` never rejects for an API failure and returns an envelope.
  The downloads events row was corrected — a MessagePort has no backpressure signal,
  the bridge does not intercept that route, and it answers 503; `runtime.subscribe`
  is the real mechanism.
- `docs/cli.md` loses the command section, and `CLAUDE.md`'s index line no longer
  advertises a local web UI.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
The app packaged and launched before this; it could not WORK. Both child entries
were missing, and the handshake had two independent breaks that were silent on
every side.

**The port never reached the SPA.** The preload posted `{type:'mlx:admin-port'}`
while `ui/src/main.tsx` compares `event.data !== DASHBOARD_PORT_MESSAGE` — a bare
string, `'mlx:dashboard-port'`. An object never equals a string, no error is
raised at either end, and the only symptom is a permanent "Connecting to the mlx
runtime…". Fixed in the preload and pinned by importing the constant from the
dashboard source, so a rename now fails to compile rather than failing silently.

**Nothing ever sent the handshake.** "Pull, not push" had no puller: the SPA never
asks. The preload now asks at DOMContentLoaded — deferred module scripts run
before it, so the page's listener is provably installed first. MAIN still answers
rather than pushes, because a transferred port is consumed once and pushing on
did-finish-load races the listener with no recovery.

INFERENCE is the only thing in the app that loads the addon. It announces the port
it is ACTUALLY listening on: `createInferenceHost({port: 0})` →
`server.address().port`. Passing 0 is load-bearing — an OMITTED port makes the host
call `pickFreePort()`, which is racy by its own docstring. The proof is by
connection rather than string match: the fake host serves a per-test UUID on
/health and the test fetches the announced URL and compares the nonce. Verified
independently here — announcing port+1 turns a test red.

A worker thread inside a utilityProcess was RUN, not reasoned about: a real
`createDashboardRuntime()` answered `/api/metrics/overview` — a worker-thread route
— round-tripping MAIN → port → ADMIN → worker → SQLite → back, and `dispose()`
logged `db-closed`, proving `runtime.close()` ran before exit.

**One of my stated reasons for keeping ADMIN as a process was wrong, and the agent
was right to check.** I said head-of-line blocking was gone after 46524cfd. Only
the DATABASE moved. `DownloadManager` still runs on the runtime's own thread and is
full of synchronous FS — `listStagedFiles` does a `statSync` PER FILE over a
recursive staging listing, plus realpathSync/lstatSync bracketing every publish
(download.ts:180,707,878). On a multi-GB checkpoint in MAIN that is precisely the
2960 ms freeze the three-process split exists to prevent. So both reasons stand,
and crash isolation is real only because the broker handles the death: restart
budget, backoff, give-up, and automatic re-broker to the still-open window —
verified by SIGKILLing the live child, after which MAIN survived, respawned,
re-brokered, and RPC resumed.

**A directory in NAPI_RS_NATIVE_LIBRARY_PATH does not fail loudly.** Measured: the
.node file gives 56 functions; `packages/core/` LOADS with 67 keys and 0 functions
and no throw, because `require(dir)` resolves back to the index.cjs currently being
evaluated — a circular self-require. Any other directory throws. That silent middle
case is now the documented reason for the file-not-directory rule and is covered by
a real-process test.

22 mutations, all red, no green rows. Two near-misses the agent caught in itself
and reported rather than buried: a test named "never throws out of attach" that
asserted `.toThrow()` — the name lied, and `attach` really could throw out of the
ipcMain handler and kill MAIN (code fixed, not just the test); and a mutation
runner whose revert used an empty-string replace, which INSERTS at position 0 and
silently corrupted two files, making one mutation red for the wrong reason. The
whole table was re-run with byte-exact backup/restore.

500 tests across desktop + dashboard, typecheck clean.

Flagged, out of scope here: `pickFreePort`'s docstring in packages/server is
inverted relative to what createInferenceHost does; and with an empty models dir
INFERENCE exits 78 and the supervisor crash-loops to `failed` — honest and visible,
but a first-run user with no models gets a red tray, which is a product decision.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
ADMIN imports it; it resolved only via Yarn root hoisting and an explicit copy in
scripts/stage-app.ts. Working by accident is not the same as declared.

Verified end to end on the PACKAGED bundle afterwards: the .app launches, stays
up, writes settings.json, and creates ~/.mlx-node/dashboard.db — which means ADMIN
forked and its worker thread opened SQLite from inside the bundle. No errors.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
… in the gate

Signing now works end to end: 20 Mach-O files + 6 bundles, every one carrying
Team ID QDJ93ZUQ9B. Three real failures got it there, none of which was visible
without running it against a real bundle.

**@electron/osx-sign cannot be used with `asar: false`.** It decides what to sign
by SNIFFING FILE CONTENT (isBinaryFile), and with the archive off every asset is a
loose file — so it tried to codesign `doom-overlay/doom/build/doom.wasm`, then
`assets/clankolas.png`, and died on each. Replaced with explicit signing driven by
`file`'s actual Mach-O header, which is the same detection the release gate uses,
so what gets signed and what gets checked cannot drift apart. Inside-out ordering
comes from sorting by path depth: signing a bundle seals whatever its nested code
looks like at that moment, so anything signed afterwards breaks the outer seal.

**Non-runtime directories now get pruned, and that is required, not cosmetic.**
`@earendil-works/pi-coding-agent` ships a DOOM build under examples/. Pruning
examples/example/__tests__/.github/docs from staged packages is what stops the
signer walking into it. Deliberately conservative — `src/` is NOT pruned, since
plenty of packages resolve entry points into it.

**A greedy-regex bug that was ALSO in verify-bundle.sh, i.e. in the gate itself.**
Two obvious ways to parse `file` output for names are both wrong:

    sed 's/^\(.*\): .*Mach-O.*/\1/p'     `.*` is greedy, and file prints
                                          path: Mach-O universal binary with 2
                                          architectures: [x86_64:...] [arm64:...]
                                          so the capture runs PAST the second colon
    awk -F': '                            a universal binary emits one line PER
                                          ARCHITECTURE, and those use a different
                                          separator entirely:
                                          path (for architecture x86_64):<TAB>Mach-O …

Correct: cut at the FIRST colon, strip a trailing " (for architecture …)", dedupe.
Thin binaries parsed fine under both broken versions, which is exactly why this
survived the first pass — the bundle had no universal binary until
@mariozechner/clipboard-darwin-universal turned up.

The gate now passes steps 1 and 2 on a signed bundle and fails only step 3, on a
genuine defect that is not ours: two third-party clipboard prebuilts bake
`/Users/runner/work/clipboard/...` into their load commands. Ours is clean —
`install_name_tool` rewrote it to `@rpath/mlx-core.darwin-arm64.node`.

Signed here with an Apple Development certificate to exercise the path. That
certificate CANNOT be notarized or distributed; a Developer ID Application
certificate does not exist in this keychain yet.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
Both claims reproduced deterministically before anything was changed.

**A late readiness probe could cancel a stop.** `markReady()` calls
`clearGenTimers()`, and `genTimers` is the SAME set holding `killWithEscalation`'s
SIGTERM→SIGKILL timer and `stop()`'s completion cap. A probe already in flight when
`stop()` runs would disarm both, restore `running`, and resolve `start()` — so a
child that ignores SIGTERM was never SIGKILLed and `stop()` never settled. The
instrumented failure shows `state: 'running'` AFTER stop was issued, which is the
smoking gun.

Guarded on `intent`, not `lifecycle`: `spawn()` resets `intent = 'run'`, so a new
generation re-arms readiness while the dying one stays abandoned, and it covers
`abort()` too — which arms the identical escalation timer and had the identical
hole. Verified independently here: removing the guards turns 2 tests red with
`expected 'hung' to be 'settled'`.

Two tests, because there are two windows. The reviewer's claim is the
probe-in-flight case, which needed a fixture that PARKS `/health` and releases it
from its own SIGTERM handler — so the probe is provably in flight when stop runs
and provably serving after. The other window (stop between `mlx:ready` and the
first probe) is synchronous and was missed by the first attempt.

Re-readiness is not broken, which was the real risk in this fix: the existing
restart tests still pass — a requested restart still reaches `running` at
generation 2, and an unrequested exit 0 still walks restarting → starting →
running.

**A wedged db worker leaked every pending call.** Worker DEATH was already handled
and tested; a worker that stays alive and never answers was not. Ordinary
call/ingest had no deadline, so the renderer gave up at 30 s while the host promise
and its `pending` entry lived forever, holding a `worker.ref()`.

The deadline goes INSIDE `send`, not as a `Promise.race` around it — racing settles
the caller but leaves the entry and the ref, and the leak IS the bug. It
deliberately does NOT call `goDown`: `down` is a latch, and latching it on one slow
query would permanently fail every db route for a worker that was merely busy,
which is strictly worse. The 60 s default is long on purpose — a boot ingest over a
large sessions tree legitimately holds the worker for tens of seconds; the point is
boundedness, not latency.

7 mutations, 5 red. Both GREEN rows reported rather than buried:

- A3 (entry guard alone) is redundant by construction — without it a probe is
  issued and the continuation discards it, so nothing observable changes beyond one
  wasted request to a child already being killed. Kept for symmetry with every
  other condition in that function, which is checked on both sides of the await.
- B4 (settle the caller but leave the pending entry and ref) is the real gap: the
  caller-visible contract is guarded, but the non-leak is not observable through
  the public surface. Closing it would need a test-only inspection API on
  production code, judged worse than the gap. Anyone deleting those two lines
  reintroduces exactly this bug with every test green — hence this paragraph.

desktop 235/235 · dashboard 294/294 · tsc clean · lint clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
The sidecar bound 127.0.0.1 with no token and wildcard CORS, and the
Claude Code launcher passed a hard-coded constant, so any local process
(including any web page, via CORS `*`) could drive inference.

- sidecar mints a 32-byte per-process token; the URL alone is no longer
  a capability
- `/health` stays unauthenticated on purpose: the supervisor must be
  able to tell "not ready" from "unauthorized", or it crash-loops a
  healthy sidecar
- CORS is no longer wildcard once a token is set
- `mlx serve --host 0.0.0.0` requires an explicit token

Measured against Claude Code 2.1.220: `ANTHROPIC_AUTH_TOKEN` alone sends
`authorization: Bearer`; adding `ANTHROPIC_API_KEY` sends BOTH that and
`x-api-key`. The gate reads `x-api-key` first, so the child env drops
`ANTHROPIC_API_KEY`.

Also fixes a pre-existing leak found on the way: the host logger wrote
`req.headers` verbatim, so `--verbose` put the user's real `sk-ant-…`
key in `requests.ndjson` in plaintext.

Verified by re-applying four mutations independently — /health made
authenticated (3 RED), choke point removed (22 RED), any token accepted
(23 RED), headers logged verbatim (1 RED). Gates: 1081 tests, typecheck
clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
Three contracts the workflow assumed and nothing enforced:

1. `out/mlx-node.app` does not exist. @electron/packager returns the
   PLATFORM directory (`out/mlx-node-darwin-arm64/`) with the bundle
   inside it, so four hand-written workflow paths were one level too
   high. `package.ts` now writes `out/package-result.json` and the
   workflow reads the path from it.

2. The desktop version never moves. `tools bump` filters
   `manifest.private !== true` and @mlx-node/desktop is private, so a
   tagged release would ship a bundle, DMG and cask all stamped 0.0.8 —
   consistently stale, which is why it looks correct. Tag now wins for
   what gets stamped; a stale manifest is a hard failure whose remedy
   names the private-workspace cause.

3. `LSMinimumSystemVersion` was packager's 12.0 template default while
   CI builds the addon at MACOSX_DEPLOYMENT_TARGET=26.0. LaunchServices
   reads the plist, so the app OPENS on macOS 12 and only then fails to
   dlopen the addon — the supervisor sees a dead sidecar and restarts it
   forever with nothing naming the cause. Now set from the measured max
   `minos` across the binaries, and verify-bundle.sh recomputes it over
   EVERY Mach-O so the two derivations stay independent.

Adds the untagged-path test: with a tag, a junk manifest version is
caught by the four-way compare; with no tag the manifest BECOMES the
expected value and every check compares it against itself, so the
manifest's own semver assertion is the only thing between a typo and a
signed bundle. Nothing covered it — removing that line was green.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
…ld path

`verify-bundle.sh` step [3/5] failed the bundle outright:
@mariozechner/clipboard-darwin-{arm64,universal} bake upstream's CI home
(/Users/runner/work/clipboard/...) into their load commands. The leak is
in the published tarball, so the only lever on this side is not to carry
it — and the gate refuses a bundle that ships a build path, which means
this blocked notarization.

Safe to drop, and it needs all three reasons together:
  1. pi-coding-agent declares it under optionalDependencies
  2. clipboard-native.js requires it inside try {} catch {} → null
  3. nothing here references it; we import pi-coding-agent for session
     parsing only

It also shipped twice for one architecture: -darwin-arm64 alongside
-darwin-universal, whose x86_64 slices this app can never execute.

`runtimeClosure` had no test at all. Added one, including a
guard-the-guard: if pi-coding-agent ever drops the dependency, the
exclusion tests would start passing for an unrelated reason and the rule
could be deleted unnoticed.

Verified on the real bundle: gate [3/5] now clean, 745 MB, and the
exclusion rule mutated away → 2 RED.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
The Admin window is `titleBarStyle: 'hiddenInset'`, so macOS paints the
close/minimise/zoom buttons over the content at the top-left — exactly
where the sidebar puts its mark. Seen on the packaged app: the buttons
sat on top of the logo.

Reserves a strip above the brand header. It doubles as the drag handle,
which hiddenInset otherwise leaves the window without: with no title bar
to grab, the window could only be moved by its edges. The strip is empty
rather than wrapping the header because children of a drag region stop
receiving clicks unless they opt back out with `no-drag`.

No platform branch needed — `-webkit-app-region` is ignored in a plain
browser, so `vp dev` is unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s
Contents/Resources/app was 217 MB, of which 114 MB was Mistral, OpenAI,
Google, Anthropic, AWS/Smithy, protobufjs and friends — cloud provider
SDKs inside an app whose entire purpose is running models locally. They
arrive transitively through @earendil-works/pi-ai.

    app  217M -> 51M        total  726M -> 566M
    staged packages 138 -> 57

Unreachable, established rather than assumed. Every SDK sits behind a
`*.lazy.js` shim that `pi-ai/dist/api/lazy.js` loads only inside
`stream()`/`streamSimple()`, which nothing here calls. Searched every
`import(` in pi-ai, pi-agent-core, pi-coding-agent and pi-tui: the four
non-relative hits resolve to node: builtins or siblings, and
bedrock-converse-stream hides its specifier in a variable so no bundler
could follow it either. Then measured it — importing the whole dashboard
entry loads 2330 modules across 38 packages, zero files from any
excluded package.

The rule names only pi-ai's 7 provider deps; the other 74 packages leave
because the walk can no longer reach them, so anything legitimately
needed comes back on its own.

Bundling the entries was the alternative and was rejected: the DB worker
resolves bare specifiers through node_modules, pi's extension loader and
photon use createRequire, and index.cjs requires
NAPI_RS_NATIVE_LIBRARY_PATH — so node_modules has to ship regardless and
a bundle would only add.

Found while doing it: the exclusion decided by NAME but the copy ran by
DIRECTORY, so @earendil-works/pi-ai/node_modules/@smithy/* shipped
anyway. 232 KB today, but nesting is a resolution outcome — one version
bump could put the whole 114 MB back with nothing in the diff to explain
it. pruneExcludedNested closes that.

Verified on the packaged app: MAIN alive, INFERENCE sidecar listening
with /health 200 and /v1/models 401, ADMIN forked with the DB worker
holding the real dashboard.db, and ingest/sessions/session-detail driven
through the pruned tree. Gate [3/5] clean. 7 mutations RED.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RLE5PxuxX2yCnr8ou2819s

@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: 08acfa2337

ℹ️ 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 packages/dashboard/src/rpc/client.ts Resolved
Comment thread packages/dashboard/src/worker/client.ts Resolved
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_f8cdba5a-4646-47ca-a268-9d2f79d04893)

@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: ed9e90da11

ℹ️ 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 packages/server/src/host/index.ts Resolved
Comment thread packages/server/src/server.ts Resolved
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_ebe2cf26-4c0f-4a6e-9f87-ecaff6f66a50)

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_63a2e63b-4fc9-4f38-98d0-c581cb1c5abb)

@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: b3c0ed516e

ℹ️ 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 packages/server/src/host/index.ts Resolved
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_bac8d107-150e-402e-a275-cf7e98fd6162)

@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: 10e4e0cd9e

ℹ️ 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".

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_78acba44-bbf6-4ee7-8706-871d5cd56ff0)

@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: b4b521d524

ℹ️ 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 packages/server/src/host/net.ts Resolved
Comment thread packages/desktop/src/main/tray-view.ts Resolved
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5badfa71-d8ac-4a79-b934-5576e7989896)

@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: 02633eb0c1

ℹ️ 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".

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_13451565-eab1-494c-9d5d-b068e9609d3e)

@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: a9fff5c325

ℹ️ 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".

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_3898fc04-d452-4fd6-98ec-04bb9b36577a)

Copy link
Copy Markdown
Contributor Author

Final handoff status for f16d21bfd7424b11c081ef8986dab33cf39dd40e:

  • Synced with current origin/main (5e67047ccd167d9cf6f77972f7b87a6db10673a2); branch is 0 commits behind and GitHub reports MERGEABLE / CLEAN.
  • Addressed the full review set, including bracketed IPv6 binding, separate Claude/Codex connect commands, child callback/stream generation fencing, coordinated CONTROL PANEL shutdown budgets, and dashboard reconnect state/cache fencing.
  • All 28 inline review threads are replied to and resolved.
  • Local validation: TypeScript build passed; lint passed with the same 8 pre-existing warnings; 169 test files passed, 9 skipped; 2,939 tests passed, 21 skipped.
  • CI run https://github.com/mlx-node/mlx-node/actions/runs/30537699210 is green: Build, Rust Lint, yarn build:ts && yarn test, cargo test, and Publish all passed (conditional e2e skipped as expected).

The worktree is clean and matches the pushed PR head.

@Brooooooklyn
Brooooooklyn merged commit 400b12b into main Jul 30, 2026
7 checks passed
@Brooooooklyn
Brooooooklyn deleted the feat/desktop-app branch July 30, 2026 12:25
robert-johansson added a commit to robert-johansson/mlx-node that referenced this pull request Jul 30, 2026
… app, mlx-node#105 Gemma4 Unsloth tensor-class recipes

Merge-forward of mirror/upstream (400b12b) into our patched main.
Upstream delta since mlx-node#102:
  400b12b feat(desktop): mlx-node.app menubar app + supervised inference sidecar (mlx-node#103)
  5e67047 feat: add Gemma4 Unsloth tensor-class recipes (mlx-node#105)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

# Conflicts:
#	packages/server/package.json
#	packages/server/src/server.ts
#	vite.config.ts
robert-johansson added a commit to robert-johansson/mlx-node that referenced this pull request Jul 30, 2026
…oad, mlx-node#106 Gemma4 tools/images/restart-cache

Merge-forward of mirror/upstream (91f232b) into our patched main.
Upstream delta since mlx-node#103:
  91f232b feat(cli): revision-aware mlx download model (mlx-node#104)
  e6598c6 fix(agent): recover Gemma 4 tools, images, and restart cache (mlx-node#106)

Conflict resolutions:
- packages/agent (3 TS files): kept our genmlx-provider extension + our
  genmlx-only test, added upstream's mlx-local-image-input extension (order:
  mlx-provider, genmlx-provider, mlx-local-image-input, ...); took upstream's
  richer gemma4 FamilyTraits (reasoning + thinkingLevelMap).
- crates/mlx-core auto-merged textually but broke the build: mlx-node#106 migrated the
  VLM image hash u64 -> engine::ImageCacheDigest, while our fork-only
  vlm_prepare_vision_continuation kept &[u64]. Migrated its signature to
  &[engine::ImageCacheDigest] (pure pass-through to vlm_prepare_vision_features;
  sole caller qwen3_5_moe already passes the digest type). Rebuild clean.
- nested mlx-sys/mlx gitlink kept ours (b55ff6e6).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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