Skip to content

Fix/lmstudio runtime resolution fork2#17072

Closed
syukouyuu wants to merge 7 commits into
NousResearch:mainfrom
syukouyuu:fix/lmstudio-runtime-resolution-fork2
Closed

Fix/lmstudio runtime resolution fork2#17072
syukouyuu wants to merge 7 commits into
NousResearch:mainfrom
syukouyuu:fix/lmstudio-runtime-resolution-fork2

Conversation

@syukouyuu

@syukouyuu syukouyuu commented Apr 28, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes an issue where LM Studio local endpoints were not consistently resolving through the custom-provider runtime path.

In the failing cases, LM Studio-style local providers could miss the intended custom-provider path and behave like generic custom/OpenRouter fallbacks. This could cause:

  • local endpoint aliases not resolving as expected.
  • LM_STUDIO_* env vars not being honored reliably.
  • local endpoints incorrectly inheriting OpenRouter fallback behavior.

Related Issue

Fixes #12146 #4172

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Normalized lm-studio / lmstudio aliases during runtime provider resolution (hermes_cli/runtime_provider.py).
  • Honored LM_STUDIO_BASE_URL and LM_STUDIO_API_KEY for local LM Studio endpoints.
  • Prevented local custom endpoints from incorrectly falling back to OPENROUTER_API_KEY.
  • Added regression tests covering LM Studio alias resolution and local-endpoint credential selection (tests/hermes_cli/test_runtime_provider_resolution.py).

How to Test

  1. Run the targeted runtime provider resolution test file locally: pytest tests/hermes_cli/test_runtime_provider_resolution.py -q
  2. Verify that runtime resolution tests for lm-studio / lmstudio pass successfully.
  3. Verify that tests for LM_STUDIO_BASE_URL pass and ensure local endpoints do not fall back to OPENROUTER_API_KEY.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Local environment

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

(N/A)

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 28, 2026
syukouyuu and others added 4 commits April 29, 2026 14:40
- Implements Authorization Code + PKCE (S256) flow with localhost callback
- Stores credentials in HERMES_HOME/gemini_oauth.json
- Supports Gemini API token refresh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent runs fall back to openrouter despite model.provider=custom in config.yaml

3 participants