Commit Graph

92 Commits

Author SHA1 Message Date
Re-bin
b817463939 chore: simplify Alibaba Coding Plan to apiBase hint, remove dedicated provider 2026-03-06 07:13:04 +00:00
Re-bin
e81b6ceb49 merge origin/main into pr-1563 2026-03-06 07:01:23 +00:00
Re-bin
fb77176cfd feat(custom-provider): keep instance-level session affinity header for cache locality 2026-03-05 14:25:46 +00:00
Re-bin
a3c68ef140 Merge branch 'main' into pr-1428 2026-03-05 14:12:37 +00:00
ouyangwulin
6770a6e7e9 supported aliyun coding plan. 2026-03-05 17:34:36 +08:00
ouyangwulin
cf3e7e3f38 feat: Add Alibaba Cloud Coding Plan API support
Add dashscope_coding_plan provider to registry with OpenAI-compatible
endpoint for BaiLian coding assistance.

- Supports API key detection by 'sk-sp-' prefix pattern
- Adds provider config schema entry for proper loading
- Updates documentation with configuration instructions
- Fixes duplicate MatrixConfig class issue in schema
- Follow existing nanobot provider patterns for consistency
2026-03-05 16:54:15 +08:00
Daniel Emden
ecdf309404 fix(codex): pass reasoning_effort to Codex API
The OpenAI Codex provider accepts reasoning_effort but silently
discards it. Wire it through as {"reasoning": {"effort": ...}} in
the request body so the config option actually takes effect.
2026-03-04 15:31:56 +01:00
David Markey
ecdfaf0a5a feat(custom-provider): add x-session-affinity header for prompt caching 2026-03-02 11:03:12 +00:00
Re-bin
3c79404194 fix(providers): sanitize thinking_blocks by provider and harden content normalization 2026-03-02 06:58:10 +00:00
Jack Lu
3ee061b879 Merge branch 'main' into main 2026-03-01 13:35:24 +08:00
Re-bin
5ca386ebf5 fix: preserve reasoning_content and thinking_blocks in session history 2026-02-28 17:37:12 +00:00
Re-bin
f9d72e2e74 feat: add reasoning_effort config to enable LLM thinking mode 2026-02-28 17:18:05 +00:00
JK_Lu
977ca725f2 style: unify code formatting and import order
- Remove trailing whitespace and normalize blank lines
- Unify string quotes and line breaks for long lines
- Sort imports alphabetically across modules
2026-02-28 20:55:43 +08:00
Nikolas de Hor
cc8864dc1f fix: remove overly broad "codex" keyword from openai_codex provider
The bare keyword "codex" causes false positive matches when any model
name happens to contain "codex" (e.g. "gpt-5.3-codex" on a custom
provider).  This incorrectly routes the request through the OAuth-based
OpenAI Codex provider, producing "OAuth credentials not found" errors
even when a valid custom api_key and api_base are configured.

Keep only the explicit "openai-codex" keyword so that auto-detection
requires the canonical prefix.  Users can still set provider: "custom"
to force the custom endpoint, but auto-detection should not collide.

Closes #1311
2026-02-28 01:01:20 -03:00
Re-bin
1fe94898f6 fix: generate short alphanumeric tool_call_id for Mistral compatibility 2026-02-27 16:13:26 +00:00
haosenwang1018
8de2f8d588 fix: preserve reasoning_content in message sanitization for thinking models
_sanitize_messages strips all non-standard keys from messages, including
reasoning_content. Thinking-enabled models like Moonshot Kimi k2.5
require reasoning_content to be present in assistant tool call messages
when thinking mode is on, causing a BadRequestError (#1014).

Add reasoning_content to _ALLOWED_MSG_KEYS so it passes through
sanitization when present.

Fixes #1014
2026-02-24 04:21:55 +08:00
Re-bin
b653183bb0 refactor(providers): move empty content sanitization to base class 2026-02-22 18:26:42 +00:00
Re-bin
2f7835a301 Merge remote-tracking branch 'origin/main' into pr-949 2026-02-22 18:21:47 +00:00
andienguyen-ecoligo
de63c31d43 fix(providers): normalize empty reasoning_content to None at provider level
PR #947 fixed the consumer side (context.py) but the root cause is at
the provider level — getattr returns "" (empty string) instead of None
when reasoning_content is empty. This causes DeepSeek API to reject the
request with "Missing reasoning_content field" error.

`"" or None` evaluates to None, preventing empty strings from
propagating downstream.

Fixes #946
2026-02-21 12:30:57 -05:00
init-new-world
deae84482d fix: change VolcEngine litellm prefix from openai to volcengine 2026-02-22 00:42:41 +08:00
muskliu
83ccdf6186 fix(provider): filter empty text content blocks causing API 400
When MCP tools return empty content, messages may contain empty-string
text blocks. OpenAI-compatible providers reject these with HTTP 400.

Changes:
- Add _prevent_empty_text_blocks() to filter empty text items from
  content lists and handle empty string content
- For assistant messages with tool_calls, set content to None (valid)
- For other messages, replace with '(empty)' placeholder
- Only copy message dict when modification is needed (zero-copy path
  for normal messages)

Co-Authored-By: nanobot <noreply@anthropic.com>
2026-02-22 00:20:00 +08:00
Re-bin
cc04bc4dd1 fix: check gateway's supports_prompt_caching instead of always returning False 2026-02-20 15:14:45 +00:00
tercerapersona
b286457c85 add Openrouter prompt caching via cache_control 2026-02-20 11:34:50 -03:00
Re-bin
5cc019bf1a style: trim verbose comments in _sanitize_messages 2026-02-20 11:27:21 +00:00
Re-bin
0c2fea6d33 Merge branch 'main' into pr-795 2026-02-20 11:25:51 +00:00
Re-bin
82a318759f Merge branch 'main' into pr-812 2026-02-20 08:42:31 +00:00
Re-bin
9ffae47c13 refactor(litellm): remove redundant comments in cache_control methods 2026-02-20 08:21:02 +00:00
Re-bin
afa0513243 Merge branch 'main' into pr-854 2026-02-20 08:17:32 +00:00
Re-bin
73fdd0dd45 fix: complete ensure_ascii=False and UTF-8 encoding migration 2026-02-20 07:59:32 +00:00
Re-bin
37252a4226 fix: complete loguru native formatting migration across all files 2026-02-20 07:55:34 +00:00
Nikolas de Hor
53b83a38e2 fix: use loguru native formatting to prevent KeyError on messages containing curly braces
Closes #857
2026-02-19 17:19:36 -03:00
Re-bin
b11f0ce6a9 fix: prefer explicit provider prefix over keyword match to fix Codex routing 2026-02-19 17:39:44 +00:00
tercerapersona
3b4763b3f9 feat: add Anthropic prompt caching via cache_control
Inject cache_control: {"type": "ephemeral"} on the system message and
last tool definition for providers that support prompt caching. Adds
supports_prompt_caching flag to ProviderSpec (enabled for Anthropic only)
and skips caching when routing through a gateway.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 11:05:22 -03:00
PiEgg
9789307dd6 Fix Codex provider routing for GitHub Copilot models 2026-02-19 13:30:02 +08:00
Your Name
1663517998 feat: Add VolcEngine LLM provider support
- Add VolcEngine ProviderSpec entry in registry.py
- Add volcengine to ProvidersConfig class in schema.py
- Update model providers table in README.md
- Add description about VolcEngine coding plan endpoint
2026-02-19 03:02:16 +08:00
Ivan
e44f14379a fix: sanitize messages and ensure 'content' for strict LLM providers
- Strip non-standard keys like 'reasoning_content' before sending to LLM
- Always include 'content' key in assistant messages (required by StepFun)
- Add _sanitize_messages to LiteLLMProvider to prevent 400 BadRequest errors
2026-02-18 11:57:58 +03:00
Re-bin
80a5a8c983 feat: add siliconflow provider support 2026-02-18 03:52:53 +00:00
ras_bot
e5e5f02e73 merge: upstream/main into feat/add-siliconflow-provider, resolve schema conflict
- Keep siliconflow in ProvidersConfig
- Keep openai_codex and github_copilot from upstream/main

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 10:50:15 +08:00
Re-bin
e2a0d63909 feat: add custom provider with direct openai-compatible support 2026-02-18 02:39:15 +00:00
Darye
5033ac1759 Added Github Copilot Provider 2026-02-16 15:02:12 +01:00
Re-bin
1ce586e9f5 fix: resolve Codex provider bugs and simplify implementation 2026-02-16 11:43:36 +00:00
Re-bin
9e5f7348fe Merge branch 'main' into pr-151 2026-02-16 09:19:40 +00:00
Re-bin
49fec3684a fix: use json_repair for robust LLM response parsing 2026-02-15 08:11:33 +00:00
Zhiwei Li
66cd21e6ec feat: add SiliconFlow provider support
Add SiliconFlow (硅基流动) as an OpenAI-compatible gateway provider.
SiliconFlow hosts multiple models (Qwen, DeepSeek, etc.) via an
OpenAI-compatible API at https://api.siliconflow.cn/v1.

Changes:
- Add ProviderSpec for siliconflow in providers/registry.py
- Add siliconflow field to ProvidersConfig in config/schema.py

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 20:27:10 +11:00
The Mavik
10e9e0cdc9 fix(providers): clamp max_tokens to >= 1 before calling LiteLLM (#523) 2026-02-13 17:08:10 -05:00
Re-bin
b76cf05c3a feat: add custom provider and non-destructive onboard 2026-02-13 16:05:00 +00:00
qiupinhua
1ae47058d9 fix: refactor code structure for improved readability and maintainability 2026-02-13 18:51:30 +08:00
Re-bin
39dd7feb28 resolve conflicts with main and adapt MiniMax 2026-02-10 16:27:10 +00:00
Re-bin
fba5345d20 fix: pass api_key directly to litellm for more robust auth 2026-02-10 02:09:31 +00:00
pinhua33
51f97efcb8 refactor: simplify Codex URL handling by removing unnecessary function 2026-02-09 16:04:04 +08:00