feat: make an ENABLE_LITELLM=false install usable out of the box - #538
dylan-openhands wants to merge 5 commits into
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
be2813c to
e225546
Compare
Mutation review of this PR's testsI hand-wrote targeted mutants against the five test files this PR adds and ran each against a pristine copy of the branch ( Controls (must die) — these prove the suites work
Credit where it's due: the backend suites are genuinely strong. One control that did not die — the component's central claim is unasserted
Fix (one line — give it a key like the sibling tests, so the button would appear if the section rendered): mockUseLlmApiKey.mockReturnValue({
- data: undefined,
+ data: { key: "sk-byor-key" },
error: null,
isLoading: false,
isPaymentRequired: false,
} as never);Verified: with this change the "always render" mutant dies, and the other two component mutants stay dead. Survivors (gaps)
1. The SaaS branch of
|
e225546 to
82b2a3f
Compare
82b2a3f to
cb86ba8
Compare
HUMAN:
Makes an install with LiteLLM off work from the first login: BYOK is forced on, the install-time provider key becomes the default model, the managed-LLM-key section on the API Keys page is hidden, and orgs still on the LiteLLM default are moved to the install default.
AGENT:
Why
With
ENABLE_LITELLM=false, a fresh install had no working LLM path: BYOK could stay off, new orgs defaulted to alitellm_proxy/model on the gateway URL, and on Replicated installs the web client never saw the flag. Top of the stack #519 → #520 → #521 → this PR.Summary
enable_litellmfrom theENABLE_LITELLMenv at request time. Replicated setsOH_WEB_CLIENT_FEATURE_FLAGS_*vars, which build the flags without readingENABLE_LITELLM, so it stayedtrueand Budgets stayed visible.OPENHANDS_LLM_PROVIDER_ROUTE=direct) work without a base URL. With LiteLLM off and no install default, new orgs and users get the SDK default model instead of a gateway model.openhands/deepseek-v4-flashas the verified-models default on every install, andSaasSettingsStore.load()made it every member's active "Default" profile, overriding the install default even on a fresh all-off install.OrgStore._validate_org_version. The install key is stored as the org key, which outranks members' dead LiteLLM keys. BYOK orgs are untouched; a member who saved a managed model in their own settings still has to pick a new one.Issue Number
How to Test
uv run pytest tests/unit/server/test_constants.py tests/unit/app_server/test_default_web_client_config_injector.py tests/unit/test_verified_model/ tests/unit/test_org_store.py tests/unit/test_saas_settings_store.py tests/unit/storage/test_org_app_settings_store.pycd frontend && npm run test -- --run __tests__/components/features/settings/api-keys-manager.test.tsx __tests__/hooks/query/use-llm-api-key.test.tsxanthropic/<first model>preselected with the key filled in, BYOK is available, Budgets and the managed LLM key are hidden, and no LiteLLM pod runs.Video/Screenshots
Type
Notes
_uses_managed_default_llmnow also treatslitellm_proxy/*on an in-cluster (or empty) base URL as managed, so a version bump with LiteLLM on also re-points such orgs at the current default.Enterprise server image for this PR: