Roo-Code/src/api/providers
Daniel 23a214c519
fix: extract raw error message from OpenRouter metadata (#10039)
OpenRouter wraps upstream provider errors in a generic message but includes
the actual error in metadata.raw. This change:

- Adds OpenRouterErrorResponse interface for proper typing
- Creates handleStreamingError() helper for DRY error handling
- Extracts metadata.raw for actionable error messages in PostHog
- Includes nested error structure so getErrorMessage() can extract raw message

Before: PostHog receives '400 Provider returned error' (generic)
After: PostHog receives 'Model xyz not found' (actionable)

This enables proper error tracking and debugging via PostHog telemetry.
2025-12-12 10:42:36 -08:00
..
__tests__ feat: add gpt-5.2 model to openai-native provider (#10024) 2025-12-11 13:16:31 -07:00
fetchers Revert "fix: merge settings and versionedSettings for Roo provider models" (#10034) 2025-12-11 13:19:37 -08:00
utils fix: return undefined instead of 0 for disabled API timeout (#9960) 2025-12-09 15:32:26 -07:00
anthropic-vertex.ts fix: filter non-Anthropic content blocks before sending to Vertex API (#9618) 2025-11-26 17:47:04 -05:00
anthropic.ts Stop making count_tokens requests (#9884) 2025-12-05 22:53:35 -05:00
base-openai-compatible-provider.ts Add timeout to OpenAI Compatible Provider Client (#9898) 2025-12-08 17:36:53 -08:00
base-provider.ts Add NTC support for Cerebras (#9692) 2025-12-01 14:49:53 -05:00
baseten.ts (feat): Add Baseten Provider (#9461) 2025-11-21 17:49:15 -05:00
bedrock.ts Bedrock native tool calling (#9698) 2025-12-01 15:26:34 -05:00
cerebras.ts Fix/cerebras conservative max tokens (#9804) 2025-12-04 00:43:22 -05:00
chutes.ts feat(chutes): detect native tool support from API supported_features (#9715) 2025-12-01 12:57:26 -05:00
claude-code.ts fix(claude-code): disable native tools and temperature support (#9643) 2025-11-26 23:56:24 -05:00
constants.ts feat: add User-Agent header to API providers (#5492) 2025-07-08 23:19:56 -04:00
deepinfra.ts Add native tool calling for deepinfra (#9691) 2025-11-29 20:05:21 -05:00
deepseek.ts Move provider data into @roo-code/types (#4153) 2025-05-30 14:54:48 -07:00
doubao.ts Support new LLM provider: Doubao (#6345) 2025-07-30 16:54:16 -04:00
fake-ai.ts Add a new @roo-code/types package and use it everywhere (#3912) 2025-05-26 12:06:45 -07:00
featherless.ts feat: add native tools support for OpenAI-compatible providers (#9676) 2025-11-28 11:59:32 -05:00
fireworks.ts Add the fireworks AI provider (#6652) 2025-08-04 19:27:12 -07:00
gemini.ts fix: handle empty Gemini responses and reasoning loops (#10007) 2025-12-11 08:55:47 -08:00
groq.ts Improvements to base openai compatible (#9462) 2025-11-21 16:42:19 -05:00
huggingface.ts fix: add error transform to cryptic openAI SDK errors when API key is invalid (#7586) 2025-09-04 23:12:28 -04:00
human-relay.ts Enable browser-use tool for all image-capable models (#8121) 2025-10-21 22:23:42 -04:00
index.ts Remove Glama provider (#9801) 2025-12-10 14:08:29 -08:00
io-intelligence.ts Get the model id property for a given provider (#8009) 2025-09-17 15:24:27 -07:00
lite-llm.ts feat: add native tool support for LiteLLM provider (#9719) 2025-12-01 16:35:08 -05:00
lm-studio.ts fix: add error transform to cryptic openAI SDK errors when API key is invalid (#7586) 2025-09-04 23:12:28 -04:00
minimax.ts Stop making count_tokens requests (#9884) 2025-12-05 22:53:35 -05:00
mistral.ts feat(mistral): add native tool calling support (#9625) 2025-11-26 17:12:04 -05:00
moonshot.ts fix: Fix the issue of Moonshot's maximum return token count being limited to 1024 (#7673) 2025-09-04 23:19:58 -04:00
native-ollama.ts Support tool calling in native ollama provider (#9696) 2025-12-01 15:28:01 -05:00
openai-native.ts feat: wire MULTIPLE_NATIVE_TOOL_CALLS experiment to OpenAI parallel_tool_calls (#9621) 2025-11-26 17:12:54 -05:00
openai.ts Moonshot native tool call support (#9646) 2025-11-27 00:08:36 -05:00
openrouter.ts fix: extract raw error message from OpenRouter metadata (#10039) 2025-12-12 10:42:36 -08:00
qwen-code.ts Fix build error (#7397) 2025-08-25 12:18:59 -07:00
requesty.ts feat: add native tool support to Requesty provider (#9672) 2025-11-28 10:38:58 -05:00
roo.ts Remove defaultTemperature from Roo provider configuration (#9932) 2025-12-08 18:31:49 -08:00
router-provider.ts feat: adding default headers and testing for litellm fetcher (#5242) 2025-06-30 20:23:11 -04:00
sambanova.ts feat: add SambaNova provider integration (#6188) 2025-07-30 12:47:12 -04:00
unbound.ts Add native tools support to Unbound (#9699) 2025-12-01 14:50:01 -05:00
vercel-ai-gateway.ts Add native tool support for vercel ai gateway (#9697) 2025-12-01 14:52:05 -05:00
vertex.ts Add gemini pro 06 05 (#4386) 2025-06-05 17:49:12 -04:00
vscode-lm.ts feat: enhance token counting by extracting text from messages using VSCode LM API (#6424) 2025-07-30 16:56:01 -04:00
xai.ts fix: add finish_reason processing to xai.ts provider (#9929) 2025-12-08 18:03:40 -08:00
zai.ts Update a couple provider labels (#9711) 2025-12-01 10:44:12 -05:00