Skip to content

fix: skip managed-proxy model-info lookup when no key is available - #5456

Draft
daviskay75 wants to merge 3 commits into
OpenHands:mainfrom
daviskay75:fix/issue-5454-skip-keyless-model-info
Draft

daviskay75 wants to merge 3 commits into
OpenHands:mainfrom
daviskay75:fix/issue-5454-skip-keyless-model-info

Conversation

@daviskay75

@daviskay75 daviskay75 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

closes #5454

Cause

_get_model_info_from_litellm_proxy built headers = {} and emitted
GET {base_url}/v1/model/info even when no API key was available. Against the
managed proxy (which always requires auth) that is a guaranteed 401, and the
SDK silently fell back to static metadata — while every keyless LLM
construction / profile load / validation re-emitted the doomed request (see
also #4098).

Fix

Skip the request when no key is available (None/empty/blank — none can
authenticate) and the target is the managed OpenHands proxy, recognized via
the existing is_openhands_proxy_base_url helper (both base-URL forms,
normalized). Callers fall through to the static fallbacks. Generic/custom
proxies are deliberately unchanged: an open proxy may legitimately serve model
info without credentials. Keyed requests — including invalid keys, whose real
401 stays visible — are unchanged.

Tests

  • tests/sdk/llm/test_model_info_keyless.py (6 tests): managed None/empty/blank
    and /v1/-suffixed URLs emit nothing and return None; managed keyed request
    still sends Authorization: Bearer … and returns the matched model_info;
    generic keyless lookup still attempts the request with empty headers.

@daviskay75 daviskay75 changed the title fix: skip proxy model-info lookup when no key is available fix: skip managed-proxy model-info lookup when no key is available Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Unauthenticated model-info lookup still emits GET /v1/model/info when key is None

1 participant