## Summary
- Add LM Studio, NVIDIA NIM, and separate MiniMax Global and MiniMax CN provider paths across configuration, routing, onboarding, and model discovery.
- Add bundled provider icons and accessible connected or disconnected status indicators to provider lists.
- Add provider homepage metadata to the RPC contract and link provider names in Settings, onboarding, and the model picker.
- Preserve the latest main branch per-model protocol metadata while mapping provider UI rows.
{width=876 height=600}
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
- [ ] `uv run pytest tests/test_provider_catalog.py tests/test_rpc_model.py tests/test_rpc_schema_match.py tests/test_rpc_contract_shapes.py -x` - 534 passed, 4 skipped.
* `npm test` from `ui-web/` - 1,378 passed.
* `npm run type-check`, `npm run gen:check`, and `npm run build` from `ui-web/` - passed.
* `npm run type-check` and `npm run lint:rpc` from `ui-tui/` - passed.
* `.venv/bin/ruff check raven/providers/registry.py raven/rpc/methods/model.py raven/rpc/models.py tests/test_provider_catalog.py tests/test_rpc_model.py` - passed.
* `make check-source-language check-large-files` - passed.
* `git diff --check origin/main...HEAD` - passed.
* Visually verified the assembled Settings and onboarding provider lists; repository rules prohibit committing standalone screenshots.
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
The RPC homepage field is optional, and existing provider configuration remains compatible. Provider routing changes are covered by focused resolution, factory, and RPC tests. Roll back by reverting this feature commit.
## Related Issues
N/A
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
"""Reading git facts from a working directory, fail-soft.
|
|
|
|
Every question here is answered from a subprocess with a short timeout, and
|
|
every failure -- no git on PATH, not a repository, a hung filesystem --
|
|
answers ``None`` rather than raising: the callers report what they know and
|
|
say what they could not read.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import shutil
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
GIT_TIMEOUT_S = 5.0
|
|
|
|
|
|
def run_git(cwd: Path | str, *args: str, timeout: float = GIT_TIMEOUT_S) -> subprocess.CompletedProcess | None:
|
|
"""``git -C cwd args``, or None when git could not run at all."""
|
|
git = shutil.which("git")
|
|
if git is None:
|
|
return None
|
|
try:
|
|
return subprocess.run(
|
|
[git, "-C", str(cwd), *args],
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=timeout,
|
|
check=False,
|
|
)
|
|
except (OSError, subprocess.TimeoutExpired):
|
|
return None
|
|
|
|
|
|
def head_of(cwd: Path | str | None) -> str | None:
|
|
"""The commit HEAD names in ``cwd``, or None outside a repository."""
|
|
if cwd is None:
|
|
return None
|
|
result = run_git(cwd, "rev-parse", "HEAD")
|
|
if result is None or result.returncode != 0:
|
|
return None
|
|
sha = result.stdout.strip()
|
|
return sha or None
|
|
|
|
|
|
__all__ = ["GIT_TIMEOUT_S", "head_of", "run_git"]
|