Repository navigation
fix(litellm): LiteLLM proxy chat models are hidden from model lists and refused as not chat - #198582
Conversation
LiteLLM lists each model on /v1/models with `mode` ("chat",
"embedding", ...). Discovery now requires a declared chat capability for
ids outside the plugin's static list, and the shared reader does not read
`mode`, so every LiteLLM chat model except claude-opus-4-6 was kept as
non-chat: hidden from `openclaw models list` and the picker, and a
configured or setup-chosen LiteLLM model was refused with "This model
doesn't support chat; pick another model."
The LiteLLM catalog now translates `mode: "chat"` into the chat
capability before shared admission. Other modes and rows without a mode
keep the shared rules.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesTranslate LiteLLM model rows declaring mode "chat" into the shared catalog’s chat capability. Example: A LiteLLM proxy advertises proxy-chat with mode "chat".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace; known regression link). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review This PR repairs a current LiteLLM regression with a focused provider-owned projection and convincing CLI proof; no actionable defects were found. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe LiteLLM plugin supplies proxy model rows to shared catalog normalization, whose capability facts govern model listings and agent admission. flowchart LR
A[LiteLLM model endpoint] --> B[LiteLLM row projection]
B --> C[Shared catalog normalization]
C --> D[Model listings]
C --> E[Agent admission]
E --> F[LiteLLM chat endpoint]
Technical reviewBest possible solution: Merge the existing LiteLLM projection after required exact-head CI passes. Do we have a high-confidence way to reproduce the issue? Current source explains the rejection, and supplied base-versus-head CLI captures through a real LiteLLM proxy reproduce it; no target code was executed during this review. Is this the best way to solve the issue? The patch is the smallest complete repair: translate LiteLLM’s fixed mode field at its existing provider boundary and retain shared classification, routing, and discovery ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against db8cab9d3ea3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +18, Tests -1, Docs +5. Total +22 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource matches. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 13, 2026, 10:35 PM ET / November 14, 2026, 03:35 UTC (Revision 2). |
|
ClawSweeper status: applying reviewed decision. I am applying the reviewed decision for this pull request: fix(litellm): LiteLLM proxy chat models are hidden from model lists and refused as not chat This is item 1/1 in the current shard. Shard 1/1. This transient lease prevents a newer review from overlapping label, comment, or close mutations. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Proof on 684048e (candidate) vs merge base 211bc77 (main). Both builds ran in a secretless node:24.22.1 container, against a real LiteLLM proxy ( The proxy's real Main, two runs (same both times): The proxy got no chat request. Candidate, two runs (same both times): The proxy log shows Controls:
The diff only touches |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 48cdab3. Thanks @masatohoshino. |
…nd refused as not chat (openclaw#198582) fix(litellm): list and run LiteLLM models that declare chat mode Since openclaw#198288 the model list only treats a model as chat when it declares chat support, but LiteLLM declares it as mode "chat", which the shared check did not read. So models list --provider litellm --refresh hid the proxy's chat models and agent --model litellm/<model> refused them with "This model doesn't support chat". LiteLLM model discovery now maps its own mode "chat" into the existing chat flag. Embedding models and models without a mode stay hidden as openclaw#198288 intends, and shared selection and allowlist rules are unchanged. No new text. Evidence: the built CLI in a secretless node:24.22.1 container against a real LiteLLM proxy (official image) with a mode chat model, an embedding model and a model without mode, upstream a local stand-in, main twice and candidate twice. On main the chat model was not listed and the turn failed with "doesn't support chat" with no request reaching the proxy. With this change the chat model is listed and the turn reaches the proxy and returns the fixture reply. The embedding and no-mode models stay hidden on both, and a built-in model the proxy serves is listed on both. Net -1 test lines. Details: openclaw#198582 (comment). Fixes openclaw#198581. Thanks @masatohoshino. Co-authored-by: Ayaan Zaidi <[email protected]>
…hat:false * fix(models): read provider model kinds at one owner; unknown is not chat:false The shared live-listing translator now reads each provider's capability vocabulary: LiteLLM `mode`, DeepInfra `metadata.tags`, Venice/Together/ Vercel/models.dev `type`, oMLX/NVIDIA `model_type`, Hugging Face `pipeline_tag` and the Ollama `capabilities` list. `chat` and `text` kinds are affirmative; a declared non-chat kind beats text output, so embedding and reranking rows that list `text` output are no longer shown. A row with no evidence is unknown and treated as chat instead of being recorded as `inference.chat: false`; as an interim rule, an unknown ID that names a non-text family still gets `chat: false`. Within one listing, rows that carry a kind field holding another value than a chat kind used by other rows are not chat (Together `language`). The LiteLLM `mode` patch from #198582 is removed; the shared translator yields the same rows. Co-authored-by: obviyus <[email protected]> * fix(models): read provider model kinds at one owner; unknown is not chat:false OpenClaw-Publication: b583c461-57f1-4932-a8d9-1ab3794de058 * fix(models): classify explicit non-chat kinds on their own LiteLLM `mode: "completion"` is now a declared non-chat kind, so a proxy listing only completion models no longer admits them as chat; the closed-world pass stays for unfamiliar values in a field the listing uses for chat. The model-catalog pin test cleared no live-row cache, so its audio-only case was served the previous case's bare listing; it now clears the cache, and the bare-row case asserts the new unknown contract. Cite the incident beside the Model Listing rule. Co-authored-by: obviyus <[email protected]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: adde80a3-c327-43b4-86a9-35026a695cf9 * fix(models): ignore saved catalogs written under the unknown-is-false rule A Gateway built before this change saved listed models without capability metadata as `inference.chat: false` in the persisted plugin model catalog. After an upgrade, the startup catalog loaded those rows and the pre-run guard kept refusing session and config pins to them for the whole first run, even after discovery republished them without the veto; they recovered only on the next restart. Saved catalogs now use the `plugin-model-catalog-v2` cache scope, so this build starts from discovery instead of the stale rows. v1 rows stay for older builds after a downgrade, and backups keep sanitizing them. Co-authored-by: obviyus <[email protected]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: 9690d624-6407-4e9e-aa3e-746a0a90a9c5 * revert(models): keep saved catalogs in the v1 cache scope Reverts the plugin-model-catalog-v2 cache scope. Logout credential cleanup searched only the new scope, so retained v1 rows kept plaintext credentials, and every release user would cold-start after upgrading. No release saved the old unknown-is-false value; a main or nightly install that ran #198288 can see an affected pin refused until its first restart after upgrading, which self-heals. Name that accepted edge beside the pre-run fallback. Co-authored-by: obviyus <[email protected]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: 3f0e5160-67d1-4c56-bc7a-5f51e798bcdb --------- Co-authored-by: obviyus <[email protected]>
…hat:false * fix(models): read provider model kinds at one owner; unknown is not chat:false The shared live-listing translator now reads each provider's capability vocabulary: LiteLLM `mode`, DeepInfra `metadata.tags`, Venice/Together/ Vercel/models.dev `type`, oMLX/NVIDIA `model_type`, Hugging Face `pipeline_tag` and the Ollama `capabilities` list. `chat` and `text` kinds are affirmative; a declared non-chat kind beats text output, so embedding and reranking rows that list `text` output are no longer shown. A row with no evidence is unknown and treated as chat instead of being recorded as `inference.chat: false`; as an interim rule, an unknown ID that names a non-text family still gets `chat: false`. Within one listing, rows that carry a kind field holding another value than a chat kind used by other rows are not chat (Together `language`). The LiteLLM `mode` patch from openclaw#198582 is removed; the shared translator yields the same rows. Co-authored-by: obviyus <[email protected]> * fix(models): read provider model kinds at one owner; unknown is not chat:false OpenClaw-Publication: b583c461-57f1-4932-a8d9-1ab3794de058 * fix(models): classify explicit non-chat kinds on their own LiteLLM `mode: "completion"` is now a declared non-chat kind, so a proxy listing only completion models no longer admits them as chat; the closed-world pass stays for unfamiliar values in a field the listing uses for chat. The model-catalog pin test cleared no live-row cache, so its audio-only case was served the previous case's bare listing; it now clears the cache, and the bare-row case asserts the new unknown contract. Cite the incident beside the Model Listing rule. Co-authored-by: obviyus <[email protected]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: adde80a3-c327-43b4-86a9-35026a695cf9 * fix(models): ignore saved catalogs written under the unknown-is-false rule A Gateway built before this change saved listed models without capability metadata as `inference.chat: false` in the persisted plugin model catalog. After an upgrade, the startup catalog loaded those rows and the pre-run guard kept refusing session and config pins to them for the whole first run, even after discovery republished them without the veto; they recovered only on the next restart. Saved catalogs now use the `plugin-model-catalog-v2` cache scope, so this build starts from discovery instead of the stale rows. v1 rows stay for older builds after a downgrade, and backups keep sanitizing them. Co-authored-by: obviyus <[email protected]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: 9690d624-6407-4e9e-aa3e-746a0a90a9c5 * revert(models): keep saved catalogs in the v1 cache scope Reverts the plugin-model-catalog-v2 cache scope. Logout credential cleanup searched only the new scope, so retained v1 rows kept plaintext credentials, and every release user would cold-start after upgrading. No release saved the old unknown-is-false value; a main or nightly install that ran openclaw#198288 can see an affected pin refused until its first restart after upgrading, which self-heals. Name that accepted edge beside the pre-run fallback. Co-authored-by: obviyus <[email protected]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: 3f0e5160-67d1-4c56-bc7a-5f51e798bcdb --------- Co-authored-by: obviyus <[email protected]>
Closes #198581
What Problem This Solves
Fixes: with the LiteLLM provider, the chat models the proxy lists are hidden from model lists, and turns on them are refused.
openclaw models list --provider litellm --refreshlists only the plugin's built-inclaude-opus-4-6, even for a model just set as the default.openclaw agent --model litellm/<model>fails with "This model doesn't support chat; pick another model." and sends nothing to the proxy.It started with #198288 (merge
2110db5a1d1c). With the same proxy, the commit before that merge lists the proxy's chat models and sends the turn.User Impact
User impact: LiteLLM models that the proxy lists with
mode: "chat"are back in model lists and run again. Embedding models and models withoutmodestay out of chat choices.Why This Change Was Made
Since #198288, a discovered row whose id is not a known chat model needs a declared chat capability, or it is kept as not chat. A configured model the proxy lists then inherits that, so it is refused too. LiteLLM declares chat in its own field: each
/v1/modelsrow hasmode: "chat", set from LiteLLM's model map or frommodel_info.modein the proxy config. The shared discovery does not readmode.The LiteLLM plugin now projects its rows before the shared discovery: a row with
mode: "chat"getscapabilities: { chat: true }, and every row then goes through the shared rules unchanged. This is wheredocs/plugins/sdk-provider-plugins/model-catalogs.mdputs provider-specific capability fields, as the Anthropic and Baseten projections do. Readingmodein the shared discovery instead would change admission for every OpenAI-compatible provider whose rows carry amode, and none of the others was checked.The LiteLLM provider docs now say which models are chat choices and that a chat deployment the proxy lists without a mode needs
model_info.mode: chat.Evidence
Tested at this PR's head (base
main211bc77fff45).Setup:
pnpm openclaw ...) on Linux x64. Each run has its ownOPENCLAW_STATE_DIR.gemini-2.5-flash(gemini/gemini-2.5-flash) andclaude-opus-4-6(anthropic/claude-opus-4-6);text-embedding-004(gemini/text-embedding-004);local-qwen, OpenAI-compatible, withmodel_info.mode: chat;local-unlabeled, OpenAI-compatible, without a mode.GET /v1/models, one row per line (the same on both sides):openclaw onboard --non-interactive --accept-risk --skip-health --auth-choice litellm-api-key --litellm-api-key <proxy key> --custom-base-url http://127.0.0.1:<port>/v1;openclaw models set litellm/gemini-2.5-flash;openclaw models list --provider litellm --refresh --json;openclaw agent --local --model litellm/gemini-2.5-flash -m "Say hi".Before (base
main211bc77fff45)....marks omitted lines:After (this PR), with the same omission marks; the request ids are shortened to
...:The proxy log during the After turn, one of its seven requests:
Observed result:
"count": 1, only the built-inclaude-opus-4-6.gemini-2.5-flash, set as the default one step earlier, andlocal-qwenare missing. The turn is refused with "This model doesn't support chat; pick another model." (reason=format), and the proxy logged noPOST /v1/chat/completionsduring the run."count": 3:gemini-2.5-flash(tagsdefaultandconfigured, context window 1048576 from the proxy's row),claude-opus-4-6andlocal-qwen.text-embedding-004(mode: "embedding") andlocal-unlabeled(no mode) are not listed. The turn is sent to the proxy: the proxy logged sevenPOST /v1/chat/completionsanswered 500 for the missing provider key, and OpenClaw ended with "The AI service is having trouble." No completion was sent.3bf446ef4475, the commit before the fix: hide non-chat models from chat selection #198288 merge:"count": 4(gemini-2.5-flash,claude-opus-4-6,local-qwenandlocal-unlabeled), and the turn reaches the proxy and gets its 500s;2110db5a1d1c, the merge:"count": 1and "This model doesn't support chat; pick another model.".Full captures:
Checks:
extensions/litellm/index.test.ts"discovers models from %j at %j" (5 base URL cases): the stubbed/v1/modelsrow now has LiteLLM's shape,{ id: "proxy-model", object: "model", mode: "chat" }, and the test expects the discovered row not to be marked as not chat. All 5 cases fail on base withexpected [ [ 'proxy-model', false ] ] to deeply equal [ [ 'proxy-model', undefined ] ]and pass here. The file's other 8 tests pass on both.index,onboarding,image-generation-provider,image-generation-provider.url) andsrc/agents/agent-command-local.test.ts, the only test outside the plugin that names it.pnpm tsgopasses.pnpm check:changed:scripts/lib/ios-behavior-grade.mts(TELEPORT_PT). All of them are on base.extensions/litellm/index.ts, docs +5 lines, test lines net −1.Test cost,
pnpm test <file> --maxWorkers=1, local:extensions/litellm/index.test.tsLocal review: autoreview (Codex gpt-6.1-sol, high), base
211bc77fff45to head684048e2d1ca, priority P0–P1. Its context was the shared live-row admission (src/plugin-sdk/provider-catalog-live-normalize.internal.ts), its public runtime barrel, the Anthropic projection, the configured-model merge (src/agents/models-config.merge.ts) and the model catalog docs. Result: scoped-clean, no findings.Not covered:
mode(an alias LiteLLM's model map does not know, on a deployment withoutmodel_info.mode) were chat choices before fix: hide non-chat models from chat selection #198288 (local-unlabeledabove). They stay out of chat choices, as since that merge; the docs now say to setmodel_info.mode: chatfor them.mode: "completion"ormode: "responses"are not translated and stay out of chat choices; no such deployment was run.openclaw onboard --auth-choice litellm-api-keyreads the raw/v1/modelsrows, not the projected ones. It is unchanged and was not run.