Skip to content

Improve LM Studio installation recovery on unreliable networks - #234

Open
sherief-nv wants to merge 6 commits into
developfrom
fix/lmstudio-install-download-retries
Open

sherief-nv wants to merge 6 commits into
developfrom
fix/lmstudio-install-download-retries

Conversation

@sherief-nv

Copy link
Copy Markdown
Collaborator

Description

LM Studio’s installer can fail after a checksum download times out, exposing an internal _checksum_value: unbound variable error in PAIR.

Retry recognized transient installation download failures up to three times, with two- and four-second delays. Keep installation progress active between attempts and report a clear final error consistently for local and remote installs. Distinguish confirmed timeouts from checksum-download failures without timeout evidence.

Release intent

Changelog title

Improve LM Studio installation recovery on unreliable networks

Changelog body

LM Studio engine installations now automatically retry transient download failures. When retries are exhausted, PAIR displays a clear download error with guidance to check the connection and retry, instead of exposing the installer’s internal checksum-variable error.

Bumps

  • services: patch
  • nvpair-cluster-manager: none
  • nvpair-engine-manager: patch
  • nvpair-errors: none
  • nvpair-job-scheduler: none
  • nvpair-manual-nodes: none
  • nvpair-node-info: none
  • nvpair-node-scanner: none
  • nvpair-node-settings: none
  • nvpair-proxy: none
  • nvpair-tui: none
  • nvpair-ui-broker: none
  • nvpair-workload-manager: none

Scope

  • Add LM Studio installation retries, cancellation-aware backoff, temporary-file cleanup, and readable errors.
  • Cover transient recovery, exhausted retries, permanent failures, cancellation, Windows connection resets, local RPC responses, and remote streaming.
  • Update engine-manager installation and troubleshooting documentation.
  • Other engines retain their existing installation behavior. Vendor-script changes, download resumption, installer process supervision, and public API changes are excluded.

Validation

Environment: Windows x64, Go 1.26.0, Node.js 25.5.0, PowerShell.

From services/nvpair-engine-manager/:

go test -run 'TestLMSInstallFailure_|TestLMStudioInstall_|TestOtherEngineInstall_|TestInstallFailure_' .
go test -run 'TestEngineManager_ReportsLMStudio|TestRemoteInstall_' .

$env:GOMAXPROCS = '2'
go test -json -p 2 -timeout 10m ./...

  • Focused installer and control-path tests passed.
  • Full suite: 740 top-level tests passed, 45 skipped, one failed: TestUninstall_TerminatesRunningInstance.
  • Reproduced that uninstall failure on unchanged origin/develop in a temporary detached worktree:

go test -run '^TestUninstall_TerminatesRunningInstance$' -timeout 120s -v .

From services/tests/:

go test -p 2 -timeout 180s -run '^TestRemoteEngine_ReturnsInstalledEnginesForPeer$' -v .

Passed the existing two-process remote-engine smoke test over local mTLS.

From desktop/:

npm run build:modular-binaries -- --force
npm run service-contracts:check
npm run typecheck
npm run dead-code:check

All passed; all 13 bundled binaries built successfully.

Additional checks:

  • Cross-compiled the engine manager for Linux x64 and macOS arm64 with CGO_ENABLED=0.
  • Ran gofmt on changed Go files.
  • Passed node scripts/spdx-headers.mjs, git diff --check, and git diff origin/develop..HEAD --check.
  • Verified six signed-off commits, each below 350 changed lines, and a clean working tree.
  • Network failures were simulated using local fixtures and fake installer processes; no live LM Studio installation was performed.

Risk

Retries re-run the vendor installer and may repeat downloads, but are limited to three attempts. Cancellation, checksum mismatches, and recognized permanent failures are not retried. Existing verification remains enforced.

Vendor diagnostic matching may require updates if LM Studio changes its installer messages. No public protocol, settings, data-format, or migration changes are introduced.

Checklist

  • I have read the Contributing Guidelines.
  • Every commit is signed off (git commit -s), certifying the Developer Certificate of Origin.
  • New or existing tests cover the change.
  • Relevant documentation is updated.
  • I checked the diff, changed filenames, and commit messages for credentials, private data, internal URLs, internal issue identifiers, and generated artifacts.
  • I recorded the validation commands and results above.
  • I declared version bumps in the release-intent block above. services/versions.json is written by automation — do not edit it by hand.

Signed-off-by: Sherief Farouk <sfarouk@nvidia.com>
Signed-off-by: Sherief Farouk <sfarouk@nvidia.com>
Signed-off-by: Sherief Farouk <sfarouk@nvidia.com>
…l paths

Signed-off-by: Sherief Farouk <sfarouk@nvidia.com>
Signed-off-by: Sherief Farouk <sfarouk@nvidia.com>
Signed-off-by: Sherief Farouk <sfarouk@nvidia.com>

const lmsInstallAttempts = 3

func (e *Executor) installWithRetry(ctx context.Context, engine string, st *engineState) error {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this just checks the context and not e.shuttingDown or e.stopWaiting, which could result in an install continuing while the broker is trying to stop things. I think in the loop you just need to check those 2 before attempts in the backoff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants