hotfix(proxy): dispatch Makora/Together on Anthropic + OpenAI surfaces (fix 502 no-translation-path)#559
Conversation
Makora and Together are registered OpenAI-compat providers and the catalog makes them primary for DeepSeek V4 models, but the proxy's cross-format dispatch switches hardcoded the OpenAI-compat provider list and omitted both. An inbound Anthropic Messages request (Claude Code, /v1/messages) routed to Makora/Together fell through to the default case and returned 502 "provider not configured: <p> (no translation path defined for inbound Anthropic Messages)". Claude Code then no-progress-looped and re-routed to Claude, so Makora/Together never served a Claude Code turn. Add ProviderMakora and ProviderTogether to every hardcoded OpenAI-compat provider set: - ProxyMessages cross-format dispatch switch (the prod bug) - ProxyOpenAIChatCompletion cross-format dispatch switch (same class on the OpenAI inbound surface) - ExtractClientCredentials (Bearer client/BYOK creds for these upstreams) - requestUsesNonDeploymentCreds (client-supplied key => skip summarizer) Extends the existing DispatchesDeepInfraAndBedrock table tests with makora and together cases on both surfaces. Verified the ProxyMessages case reproduces the exact prod error and fails without the switch fix. Left unchanged (not the same semantics): - emit_openai.go applySessionAffinity: Fireworks/DeepInfra-specific x-session-affinity header, a caching optimization, not a dispatch gate. - admin/config.go configProviderOrder: curated dashboard display list (already omits DeepInfra/Bedrock), not the cross-format provider set. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What T-Rex did
Reviews (1): Last reviewed commit: "hotfix(proxy): dispatch Makora/Together ..." | Re-trigger Greptile |
|
T-Rex pricing update — T-Rex was free through June 2026. Effective July 1, 2026, T-Rex adds 2 credits on top of the standard 1-credit review (3 total). T-Rex settings |
| } | ||
| } | ||
| case providers.ProviderOpenAI, providers.ProviderGoogle, providers.ProviderOpenRouter, providers.ProviderFireworks, providers.ProviderDeepInfra, providers.ProviderBedrock: | ||
| case providers.ProviderOpenAI, providers.ProviderGoogle, providers.ProviderOpenRouter, providers.ProviderFireworks, providers.ProviderDeepInfra, providers.ProviderMakora, providers.ProviderTogether, providers.ProviderBedrock: |
There was a problem hiding this comment.
Bearer Key Cross-Provider Forwarding
When an OpenAI-surface request carries a normal Authorization: Bearer sk-* key and routing selects Makora or Together, this shared extraction case now treats that key as credentials for the selected upstream. The openaicompat client then prefers the request credential over the deployment key, so a caller's OpenAI key can be sent to inference.makora.com or api.together.xyz, leaking the credential and causing the upstream auth to fail.
Hotfix — production-burning
Makora and Together were never able to serve a single Claude Code turn.
The bug (confirmed in prod)
The router registers the
makoraandtogetherproviders (keys wired, "provider enabled" at boot) and the catalog makes them primary for DeepSeek V4 models. But the proxy's cross-format dispatch switches hardcode the list of OpenAI-compatible providers and omitmakoraandtogether.So when an inbound Anthropic Messages request (
/v1/messages, i.e. Claude Code) is routed to Makora/Together, theswitch decision.Providerfalls through todefault:and returns:→ HTTP 502. Claude Code retries, gets empty turns, the no-progress detector breaks the turn and re-routes to Claude. Net effect: Makora/Together have never successfully served a Claude Code request.
The fix
Add
providers.ProviderMakoraandproviders.ProviderTogetherto every hardcoded OpenAI-compat provider set so these decisions take the cross-format OpenAI translation path:internal/proxy/service.go—ProxyMessagescross-format dispatch switch (the prod bug)internal/proxy/service.go—ProxyOpenAIChatCompletioncross-format dispatch switch (same bug class on the OpenAI inbound surface)internal/proxy/credentials.go—ExtractClientCredentials(Bearer client/BYOK creds for these OpenAI-compat upstreams)internal/proxy/service.go—requestUsesNonDeploymentCreds(a client-supplied key for these providers must skip the summarizer)Both providers are wired via
openaicompat.NewClientWithModelIDMapincmd/router/main.goand documented as OpenAI-compatible surfaces, so they belong in exactly the same sets asdeepinfra/fireworks.Regression test
Extended the existing
DispatchesDeepInfraAndBedrocktable tests (bothProxyMessagesandProxyOpenAIChatCompletion) withmakoraandtogethercases. Verified theProxyMessagescase reproduces the exact prod error and fails without the switch fix:and passes with it.
Deliberately left unchanged
internal/translate/emit_openai.goapplySessionAffinity— thex-session-affinityheader is a Fireworks/DeepInfra-specific caching optimization, not a dispatch/translation gate; thedefault(no header) is correct for other targets.internal/api/admin/config.goconfigProviderOrder— a curated self-hosted dashboard display list (already omits DeepInfra/Bedrock), not the cross-format provider set.Validation
🤖 Generated with Claude Code