fix(lmstudio): resolve env-template API keys#80568
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bf224d209
ℹ️ 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".
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. at source level: current main returns arbitrary LM Studio PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. PR egg Where did the egg go?
Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Land the provider-local SecretInput auth fix after redacted real-request proof or an explicit maintainer proof override, while keeping the native endpoint fallback tracked separately and scoping release notes to auth resolution. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main returns arbitrary LM Studio Is this the best way to solve the issue? Yes, mostly: resolving configured LM Studio Label justifications:
Full review comments:
Overall correctness: patch is correct What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4af590a5f88e. |
Thanks, this is addressed in The functional regression is fixed by preserving header-only auth when an optional configured Added regressions for:
PR body now separates reporter repro from after-fix proof. No live LM Studio server verification was run for this branch. |
e304427 to
4f20f34
Compare
|
@hxy91819 Mind taking a look? |
db46044 to
96adad8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96adad8216
ℹ️ 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".
bb9e138 to
4a7246a
Compare
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
Thanks @MonkeyLeeT! |
Summary
apiKeystrings through the standard SecretInput path before falling back to known env-marker handling.${LMSTUDIO_API_KEY}being treated as literal API keys.apiKeyenv template is unset, includingheaders.Authorizationand resolved discovery/profile auth.Refs #80495. This addresses the auth-resolution portion only; native
/api/v1/chatinference fallback remains separate provider/API scope.Reported Repro
${ENV}apiKey templates did not go through the generic SecretInput resolution path unless the env var name was a registered provider marker.After-Fix Proof
pnpm test extensions/lmstudio/src/runtime.test.ts extensions/lmstudio/src/setup.test.ts -- --reporter=verbosepassed: 2 files, 53 tests.${LMSTUDIO_API_KEY}resolves to the configured env value before auth header construction.${LMSTUDIO_API_KEY}still reports a path-specific error when no other auth satisfies the provider.headers.Authorizationcontinues to satisfy auth when${LMSTUDIO_API_KEY}is unset, covering both runtime auth and discovery/setup behavior.discoveryApiKeycontinues to take precedence over a stale unset configuredapiKeytemplate during provider discovery.No live LM Studio server verification was run for this branch.
Verification
pnpm test extensions/lmstudio/src/runtime.test.ts extensions/lmstudio/src/setup.test.ts -- --reporter=verbosepnpm tsgo:extensionspnpm tsgo:test:extensionspnpm format:check -- extensions/lmstudio/src/setup.ts extensions/lmstudio/src/setup.test.ts extensions/lmstudio/src/runtime.ts extensions/lmstudio/src/runtime.test.ts CHANGELOG.mdnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/lmstudio/src/setup.ts extensions/lmstudio/src/setup.test.ts extensions/lmstudio/src/runtime.ts extensions/lmstudio/src/runtime.test.tsgit diff --check