Repository navigation
Add OpenClaw local models and unified model selection - #232
Merged
Merged
Conversation
Integrate the official llama.cpp provider with explicit Qwen 4B/9B preparation, scoped model selection, stable provider pickers, and revision-checked hot default switching. Preserve cloud configuration and sandbox boundaries, with pinned Windows runtime compatibility fixes and regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Distinguish completed replies from writes that may still be running. Add explicit, generation-bound recovery that verifies managed Gateway shutdown when necessary, reads saved state without retry or rollback, and restores chat/settings controls. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add experimental local-model support using OpenClaw's official llama.cpp provider, with explicit Qwen3.5 4B/9B downloads and a unified cloud/local model-selection experience. Keep provider configuration, global defaults, and per-conversation overrides separate. Model selection does not send an inference or tool-use test, and switching an existing cloud default no longer unconditionally restarts the Gateway.
This includes the complete integration and the follow-up Windows preparation, selection feedback, popover stability, and safe session-selection recovery fixes exercised in the desktop.
Related Issue
N/A — user-requested feature and UX iteration.
Changes
config.patchplus applied-revision confirmation for cloud default changes instead of a cold Gateway restart. Read prepared Copilot catalogue metadata rather than triggering full discovery.Type of Change
Testing
cd desktop && npm run test)cd desktop/renderer && npm run test)cd desktop && npm run build)Commands below use PowerShell path syntax. The complete build includes
npm run buildin the desktop package. Full Node suites and the full build were rerun for recovery follow-up commita2622ef.Set-Location .\desktop; npm run teststartup-order.test.ts. The unchanged test searches forstartGateway().catch; base commit6f080a0already usesstartApplicationServices().catch. The same string check fails against the base source.Set-Location .\desktop\renderer; npm run test.\.venv\Scripts\python.exe -m unittest discover -s tests -vSet-Location .\desktop; npm test -- src\session-model-service.test.ts src\session-model-ipc.test.ts src\session-model-preload.test.ts src\gateway-lifecycle.test.ts src\default-model-selection.test.ts src\local-model-service.test.tsSet-Location .\desktop; npm test -- src\session-model-gateway.integration.test.tsMICROCLAW_TEST_OPENCLAW_ENTRYset: single-Agent and explicit multi-Agent session/default switching, safe legacy-ownership rejection, and real managed-Gateway replacement after simulated loss before delivery and after commit. No replay, rollback, configuration change or inference during recovery.Set-Location .\desktop; npm test -- src\local-model-preparation.integration.test.tspowershell -NoProfile -ExecutionPolicy Bypass -File .\build.ps1MicroClawSetup.exe231.9 MiB;MicroClawInstaller.zip234.9 MiB;microclaw-portable.zip213.3 MiB;MicroClawInstaller.exe5.0 MiB.npm run lint --prefix desktop\renderernpm run lintchat-attachments.tscontrol-character regex and unusedreadJsonObjectinopenclaw-upgrade-recovery.ts. These offending constructs are unchanged.npm run format:checkpython -m ruff check .test_rednote_publisher_skill.pyand vendored Windows Node scripts.python -m ruff format --check .git diff --cached --checkInstalled Windows desktop and isolated Electron/Gateway checks:
CPU inference can still be slow, especially for long Agent/tool contexts and the 9B preset. The compatibility adapters intentionally fail closed if the pinned upstream source changes.
Checklist
Unchecked validation items are explained above; unrelated baseline cleanup is intentionally excluded.