Repository navigation
fix(platform): make an LLM gateway work as a custom provider - #5064
Merged
Merged
Conversation
… list A custom provider whose base URL is not the API root (a gateway's dashboard address without /v1, say) got a web page back from /models, and the credential row read "Unexpected token '<', "<!doctype "... is not valid JSON". The listing was also retried twice with back-off, although the server answers the same way every time. A listing that answers with something other than JSON, or with 404, now fails at once with a code (PROVIDER_CATALOG_NOT_JSON / PROVIDER_CATALOG_NOT_FOUND). The credential row, Check models and Refresh catalogs turn the code into a sentence that names the fix, in English, German and French; the MCP refresh refusal gives the same hint. The message no longer quotes the page. Check models answers 502, so its code is now read off the transport error; before, its localized sentence was never reached.
A gateway such as Bifrost lists the vendor models it routes with a window and a price, and nothing about what they take. Such a row read as a chat model with no tools, no image input and no reasoning control, so Auto passed over Claude and GPT behind the gateway, images reached them as text, and no effort could be picked. In a custom provider's listing, a row that states no type, modalities or parameters now reads like a bare row or an allowlist entry: it takes tools and, unknown, sees no images. Where Tale's shipped catalogs know the model (matched across id spellings, a vendor's own catalog before an aggregator's defaults), their facts replace that: image input, tools, and an effort knob. A vendor's reasoning-off value and tools rule stay behind, since a gateway translates the wire its own way. A model the catalogs know is not a chat model, such as an embedding model, is no longer offered as one. Auto also skips a model that charges nothing for what it writes: an embedding model or a text compressor read as chat would otherwise win its price fallback.
The model menu derives a name from the model id. A vendor that spells a
version with dashes, as Anthropic does (`claude-sonnet-5-5`), read as
"Claude Sonnet 5 5", and a search for "sonnet 5.5" found nothing. A
number of one or two digits now takes the one-digit numbers after it
("Claude Sonnet 5.5", "Claude 3.5 Haiku"), while a date stamp or a longer
number stays apart.
The menu's search also matches the model's id, so `gpt-5.6` finds
"GPT 5.6 Luna" whatever the name reads.
The title call gave the model 48 tokens and the first message as the
user's turn. Claude behind a gateway thinks by default, and the gateway's
listing does not say so, so it spent all 48 tokens thinking and the chat
kept its fallback title. Given room, it answered the message instead of
naming it ("None", "I'm Claude, made by Anthropic, …"): that gateway's
Claude carries a coding assistant's system prompt.
The first message now reaches the namer as data between <message> tags,
with the instruction not to answer it; it cannot close the tags early.
Tried live with Claude Sonnet 5.5, GPT 5.6 Luna and Gemini 2.5 Pro
behind the gateway, a question, a request and an "ignore the above"
message were all named, Claude without thinking at all.
A model that spends the title's budget thinking is asked once more with
room for it (2048 tokens), and a model known to think gets that room at
once. A call that gives room to think also gets 30 seconds instead of
10, counted from the same start: Gemini 2.5 Pro thinks 8–12 s over a
title. Each call is held and booked at its own size; an empty answer
that left its budget unspent is not asked again.
The custom provider steps say that a gateway's API root usually ends in /v1, and that its dashboard address is a web page, not the API. A new paragraph says what Tale assumes about a model a gateway lists without describing it, and where the facts come from when Tale knows the model. The recovery list names the sentence a wrong base URL now shows and its fix. Chat basics mention that the model list can be searched by a model's id. English, German and French.
Anthropic's current Sonnet was missing from the shipped catalog, so a direct Anthropic key could not pick it, and a gateway that routes it (listed by Bifrost as anthropic/claude-sonnet-5-5) found nothing in Tale's catalogs to say that it sees images or takes an effort setting. The entry carries the vendor's facts, read from platform.claude.com on 2026-10-28: a 1M window, 128K output, $2 / $10 per million tokens, cache hits at 0.05x ($0.10) and 5-minute writes at $2.50, image input, tools, and the effort parameter. Thinking cannot be turned off, so it declares no off value, like Opus 5.5 and Fable 5.1. The effort guard's list follows the vendor's page (Sonnet 5.5 and Haiku 5.5 added). Claude Haiku 5.5 is not added: its price changes above 100K prompt tokens, which one catalog price cannot express. Auto's curated list still names Sonnet 5.
yannickmonney
enabled auto-merge
October 28, 2026 10:50
yannickmonney
added this pull request to the merge queue
Oct 28, 2026
yannickmonney
added a commit
that referenced
this pull request
Oct 28, 2026
The authored notes for v0.5.94: everything since v0.5.93 (1ea59ab), which is #5062 and #5064. Highlights: a custom provider in front of an LLM gateway (the base URL sentence, the facts of the gateway's models, chat titles, labels and search), Claude Sonnet 5.5 on the Anthropic provider, and image models without tools leaving the chat model lists. Upgrade notes: no migration, the API contract unchanged at 3.49.0, what changes for an organization with such a gateway, Auto skipping zero-output-price models, the title's larger budget for a model that thinks, and the pins #5062 refuses.
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A custom provider pointed at an LLM gateway (found with a client's Bifrost gateway) did not work well: the wrong base URL failed with a cryptic message, the gateway's models read as unable to take tools, see images or set reasoning effort, Claude never got a chat title, and the model menu named Claude Sonnet 5.5 "Claude Sonnet 5 5". This fixes all four:
PROVIDER_CATALOG_NOT_JSON/PROVIDER_CATALOG_NOT_FOUND); the credential row, Check models and Refresh catalogs show a sentence naming the fix ("…Check that it is the API root; for most gateways it ends in /v1."), EN/DE/FR. Check models answers 502, so its code is now read off the transport error — its localized sentence was never reached before. The MCP refresh refusal gets the same hint./v1/modelsrow) reads as taking tools, like a bare or allowlist entry, and — unknown — as not seeing images. Where Tale's shipped catalogs know the model (matched across id spellings, a vendor's catalog before an aggregator's defaults), image input, tools and an effort knob come from there; a vendor's reasoning-off value, tools rule and Responses-only tool API do not (a gateway translates the wire its own way — Bifrost ignoresreasoning_effort: nonefor Claude). A model the catalogs know is not a chat model (embedding, speech, image) is no longer offered as one. Auto also skips a model that charges nothing for output, so an undescribed embedding model cannot win its price fallback.<message>tags with the instruction not to answer it (the gateway's Claude, carrying a coding assistant's system prompt, answered "None" / "I'm Claude…" instead of naming). A model that spends the 48-token budget thinking is asked once more with 2048 tokens; a model known to think gets that room at once, with a 30 s deadline instead of 10 s.claude-sonnet-5-5→ "Claude Sonnet 5.5"; date stamps stay apart), and the model menu's search also matches the id (gpt-5.6).Docs (EN/DE/FR): the custom-provider steps, what Tale assumes about undescribed models, the recovery sentence, and searching the model list by id.
Checklist
bun run checkpasses — the parts it runs, locally: oxfmt on every changed file, type-aware oxlint on every changed file, platformtsc --noEmit, platform server+pii unit suites, the affected UI suites, docs tests,lint:manual,lint:links,knip.bun run lint:sastpasses — Opengrep on the 13 changed source files, 0 findings.services/platform/messages/{en,de,fr}/settings.yml(node-CHoverride exists for these keys).docs/{en,de,fr}/(platform/admin/providers.md,platform/chat/basics.md).README.md/README.de.md/README.fr.md— N/A, nothing they describe changed.Test plan
Live, on an isolated local stack against that Bifrost gateway (a virtual key, base URL with and without
/v1):/v1→ 4 models; composer data: Claude Sonnet 5.5 / GPT 5.6 Luna / Sol / Gemini 2.5 Pro all tools + vision + effort (Claude's facts from the new catalog entry; before: GPT and Claude tools/vision/effort all false).gpt-5.6finds both GPT 5.6 models,sonnet 5.5finds Claude.Locally, beyond the fast tier: platform UI suite (778 files / 8,380 tests), chat browser tests (7 / 32), and a filtered
backend:integrationrun of the lanes this touches (checkIdentityDomains,checkProjects,checkFiles,checkKnowledge,checkChat,checkMcp,checkRestProjectAgents): 137 / 148, all 7 lanes run. The 11 failures are all incheckKnowledge("the organization's embedding model has no usable provider credential") — the OpenAI credential it needs is planted by an earlier lane outside the filter. The catalog, project-agent, custom-provider, picker and title checks pass ("thread-title model call is booked", one 48-token call). The full run is the queue's.The mock model gateway (E2E, docs screenshots) now reads the message inside the title call's
<message>tags, so mock titles stay the message's own words; its contract test sends the framed shape.Manual boxes:
SET-B40(base URL that is not the API root),SET-F90(a gateway's models carry what Tale knows); automation register rows for labels/search and titles.