Skip to content

mesh: download fresh binary on every start, kill mesh when goose exits#8228

Merged
michaelneale merged 4 commits into
mainfrom
micn/mesh-lifecycle-fix
Apr 2, 2026
Merged

mesh: download fresh binary on every start, kill mesh when goose exits#8228
michaelneale merged 4 commits into
mainfrom
micn/mesh-lifecycle-fix

Conversation

@michaelneale
Copy link
Copy Markdown
Collaborator

Summary

Two critical changes to mesh-llm lifecycle management:

1. Always download the latest binary before starting

start-mesh now fetches the latest mesh-llm release from GitHub on every start (macOS Apple Silicon only). If the download fails, it falls back to whatever binary is already installed. This ensures users always run the latest mesh-llm version.

The separate download-mesh IPC handler has been removed since start-mesh subsumes it entirely.

2. Mesh process dies with Goose

Previously, mesh-llm was spawned with detached: true and child.unref(), meaning it outlived the Goose process. Now:

  • Spawned as a regular child process of Electron (no detach, no unref)
  • OS sends SIGHUP when Electron exits
  • Explicit SIGTERM in will-quit handler as belt-and-suspenders
  • If mesh is already running on port 9337, start-mesh skips both download and spawn

UI simplifications

  • On macOS, not-installed is treated as stopped since start handles the download — no separate download button needed
  • On non-macOS, not-installed shows install guide only (download/start is macOS-only)
  • Start button shows "Downloading latest mesh-llm" status first on macOS, then "Starting"
  • Removed dead code: downloadMesh function, download-mesh preload bridge, Download icon import

Files changed

  • ui/desktop/src/main.ts — mesh lifecycle handlers
  • ui/desktop/src/preload.ts — removed download-mesh bridge
  • ui/desktop/src/components/settings/mesh/MeshSettings.tsx — simplified UI flow

Two critical changes to mesh-llm lifecycle:

1. Always download the latest mesh-llm binary before starting. The
   start-mesh handler now fetches from GitHub releases on every start
   (macOS only), falling back to the existing binary if download fails.
   The separate download-mesh IPC handler is removed since start-mesh
   subsumes it.

2. Mesh process is now tied to Goose's lifetime. Removed detached spawn
   and child.unref() so the mesh child is a regular child process of
   Electron. Added explicit SIGTERM cleanup in will-quit as belt and
   suspenders. If mesh is already running on the port, start-mesh skips
   both download and spawn.

UI simplifications:
- On macOS, not-installed state is treated as stopped since start
  handles the download automatically. Start button shows downloading
  status first, then starting.
- On non-macOS, not-installed shows install guide only.
- Removed dead downloadMesh function and Download icon import.

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: Michael Neale <michael.neale@gmail.com>
@michaelneale michaelneale marked this pull request as ready for review April 1, 2026 00:07
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: 08ead33cb0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/desktop/src/main.ts Outdated
…goose-running notes

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Comment thread ui/desktop/src/mesh.ts Dismissed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: d65b4c6f3e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/desktop/src/mesh.ts
…d of execSync

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Copy link
Copy Markdown
Collaborator

@alexhancock alexhancock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

Big picture does this only work from the desktop app right now?

@michaelneale
Copy link
Copy Markdown
Collaborator Author

@alexhancock yes - by design, as needs to be persistent, daemon like (youy can run it other ways too natively).

@michaelneale michaelneale added this pull request to the merge queue Apr 1, 2026
Merged via the queue into main with commit 5b3b331 Apr 2, 2026
28 of 29 checks passed
@michaelneale michaelneale deleted the micn/mesh-lifecycle-fix branch April 2, 2026 00:02
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.

3 participants