Handle bare and prefixed OpenAI model aliases in isCustomModel, fix frontend Prettier issues, and apply ruff formatting required by CI.
Co-authored-by: openhands <openhands@all-hands.dev>
- model-selector.test.tsx: pass verifiedModels and verifiedProviders
to every <ModelSelector /> render call
- settings-form.test.tsx: pass verifiedModels and verifiedProviders
to <SettingsForm /> in test fixture
- Run ruff format on all changed Python files (single→double quotes)
- Fix D202 blank-line-after-docstring in public.py
Co-authored-by: openhands <openhands@all-hands.dev>
Replace the hardcoded OPENHANDS_MODELS list and provider-assignment
tables in llm.py with imports from the openhands-sdk package:
from openhands.sdk.llm.utils.verified_models import (
VERIFIED_MODELS, VERIFIED_OPENHANDS_MODELS,
VERIFIED_OPENAI_MODELS, VERIFIED_ANTHROPIC_MODELS,
VERIFIED_MISTRAL_MODELS,
)
This means:
- OPENHANDS_MODELS is now built dynamically from the SDK's
VERIFIED_OPENHANDS_MODELS
- VERIFIED_PROVIDERS is derived from VERIFIED_MODELS.keys()
- _BARE_OPENAI_MODELS, _BARE_ANTHROPIC_MODELS, _BARE_MISTRAL_MODELS
are sets built from the SDK's per-provider lists
- The SDK is the single source of truth for both V0/V1 conversations
To add or remove a verified model, update the SDK
(openhands-sdk verified_models.py) — no change needed in this repo.
Co-authored-by: openhands <openhands@all-hands.dev>
Move all verified-model knowledge into the backend so the frontend no
longer duplicates it.
Backend (openhands/utils/llm.py):
- Add get_openhands_models() — returns OPENHANDS_MODELS (self-hosted)
or the database list (SaaS) through a single entry point.
- Add _assign_provider() — prefixes bare LiteLLM names (gpt-5.2,
claude-opus-4-6, …) with their canonical provider before sending
to the frontend. Tables moved from the frontend's
verified-models.ts.
- get_supported_llm_models() now returns a ModelsResponse pydantic
model containing: models (flat list, pre-prefixed), verified_models,
verified_providers, default_model.
Frontend:
- verified-models.ts reduced to a single DEFAULT_OPENHANDS_MODEL
constant. All 6 exported arrays are deleted.
- extract-model-and-provider.ts no longer carries hardcoded provider
lookup tables — pure parsing only.
- ModelSelector, SettingsForm, settings-modal now receive
verifiedModels / verifiedProviders as props from the API response.
- useAIConfigOptions unpacks the structured ModelsResponse.
Co-authored-by: openhands <openhands@all-hands.dev>