feat: LM Studio Integration#53248
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26149a30b5
ℹ️ 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".
Greptile SummaryThis PR integrates LM Studio as a first-class provider in OpenClaw, covering onboarding, runtime model discovery, and embedding generation. The implementation is well-structured and thorough, following established patterns from the Ollama and Mistral integrations already in the codebase. Key changes:
Minor observations noted inline:
Confidence Score: 5/5
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70050f6f6f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f9ceea5d0
ℹ️ 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".
|
😀##太好了! 但今天我更新了OpenClaw 2026.3.23 (ccfeecb)版本,我发现了一个BUG。这个BUG具体就是OpenClaw 拿不到LM Studio的上下文使用情况,具体表现是当我输入 其中 然后我又在tui里试了一下 其中 因为我是一个小白用户,不知道该如何解决这个问题,也不知道怎么提交我发现的问题,我通过搜索引擎找到了这个地方,把我所知道的东西讲出来,希望有人能看到。 |
|
@SeananTQ thank you for flagging this, it will be fixed once this PR is merged! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1e0cf903a
ℹ️ 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".
b1e0cf9 to
71c7640
Compare
9f99133 to
fb42863
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb42863623
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb42863623
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb42863623
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c973a698c
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99da19495f
ℹ️ 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".
99da194 to
d1951ee
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48bc6245f3
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d63251970
ℹ️ 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".
|
Thanks for the PR. I did a clean-worktree review and local validation against a real LM Studio install. This is not merge-ready yet. Blockers:
Please update the PR so that:
Once those are addressed, I can re-review. |
Fix token count
Update generated
Trim code
cda2c06 to
7ed05cd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ed05cd3e9
ℹ️ 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".
| } | ||
| if (isNonSecretApiKeyMarker(resolvedApiKey) && resolvedApiKey !== CUSTOM_LOCAL_AUTH_MARKER) { | ||
| return await resolveConfiguredApiKeyOrThrow(); | ||
| } | ||
| return resolvedApiKey; |
There was a problem hiding this comment.
Suppress profile API key when Authorization header is set
resolveLmstudioRuntimeApiKey returns any resolved profile/env key even when an Authorization header is configured, because the header-only check is only used in the fallback path. In header-auth LM Studio/proxy setups with a stale lmstudio:default profile key, this causes downstream request assembly to replace the configured header with Bearer <stale-key> (for example via resolveLmstudioRequestContext in dynamic model discovery), leading to avoidable 401s and failed model resolution.
Useful? React with 👍 / 👎.
| const parsed = new URL(resolved); | ||
| const pathname = normalizeUrlPath(parsed.pathname); | ||
| parsed.pathname = pathname.length > 0 ? pathname : "/"; | ||
| parsed.search = ""; | ||
| parsed.hash = ""; |
There was a problem hiding this comment.
Require http(s) when normalizing LM Studio base URLs
This path accepts any URL protocol and returns it as normalized base URL, but inputs like localhost:1234 are parsed by URL as a custom scheme (localhost:), not an HTTP host. Because setup validation only checks non-empty input, users can enter common host:port values without http://, which then normalize to non-fetchable endpoints and cause discovery/setup failures even when LM Studio is running.
Useful? React with 👍 / 👎.
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
NoYes- storeslmstudio:defaultAPI-key auth profile / resolvesLM_API_TOKEN(placeholder allowed for local no-auth setups), while real auth is enforced by the external LM Studio server.Yes- uses LM Studio's API,/api/v1/loadand/api/v1/modelson the base URL the user has configuredNoNoYes, explain risk + mitigation:Requests are made to users LM Studio instance (
localhostin most cases) and the API token is used for the said instance only.Repro + Verification
Environment
Steps
openclaw onboardopenclaw config set agents.defaults.memorySearch.provider lmstudioExpected
LM_API_TOKENin the auth profileActual
Evidence
Attach at least one:
Tests were added in
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
Risks and Mitigations
None