Commit Graph
261 Commits
Author SHA1 Message Date
Xubin Ren c02f013b17 fix(providers): harden OAuth model discovery 2026-08-29 21:22:20 +08:00
Xubin Ren 1c6483147e refactor(providers): localize OAuth model discovery 2026-08-29 21:22:20 +08:00
Xubin Ren 7941450a5d fix(providers): recover incomplete Grok searches 2026-08-29 21:22:20 +08:00
Xubin Ren 97fb9aaf72 fix(providers): complete OAuth model discovery 2026-08-29 21:22:20 +08:00
Xubin Ren bc4de246a4 feat(providers): discover OAuth model catalogs online 2026-08-29 21:22:20 +08:00
Xubin Ren 2389ab1f5a feat(providers): add Grok 4.6 subscription model 2026-08-29 21:22:20 +08:00
chengyongru 55f85b3c1f refactor(agent): remove duplicate progress streaming path 2026-08-27 10:56:07 +08:00
chengyongru 42f37dc4c0 fix(provider): stabilize Codex prompt cache routing (#5540) 2026-08-26 01:36:00 +08:00
chengyongru 2e7ebeb1ca fix(usage): record provider stream timing 2026-08-25 10:39:14 +08:00
chengyongru 2ac802b2d5 feat(usage): add unified provider usage backend 2026-08-25 01:22:25 +08:00
chengyongru 8bb3828487 fix(tui): preserve usage telemetry fields 2026-08-25 01:04:25 +08:00
chengyongru 9895c23cb5 refactor(providers): define typed usage contract 2026-08-25 01:04:25 +08:00
chengyongru b1cadf53c5 fix(codex): reuse TLS contexts across requests 2026-08-24 11:25:02 +08:00
Xubin Ren 48eea29313 feat(webui): unify turn observability 2026-08-22 20:51:24 +08:00
chengyongru 9ae3ae17da feat(providers): support DeepSeek V4 vision 2026-08-21 23:18:09 +08:00
chengyongru 9a6dc371b3 refactor: pass retry exhaustion callbacks explicitly 2026-08-21 16:46:38 +08:00
chengyongru f93d4c3ae4 fix(providers): retry before falling back 2026-08-21 16:46:38 +08:00
chengyongru 5b44ebdfd7 fix(providers): report Responses cached tokens 2026-08-21 14:01:00 +08:00
akinolur c7710238a8 fix(provider): retry Codex server_error
Mid-stream response.failed events from OpenAI carry
'server_error' (underscore), but the transient-error marker
list only had 'server error' (space). is_transient_response
missed it, so the retry loop gave up on the first attempt
instead of using its normal 1s/2s/4s backoff.
2026-08-21 10:52:34 +08:00
Xubin Ren 8dc08853e4 fix(providers): preserve legacy OrcaRouter custom configs 2026-08-16 00:26:51 +08:00
XiaoHuo888 fd2d419956 feat(providers): add OrcaRouter as a named gateway provider
Registers OrcaRouter (https://www.orcarouter.ai) as a built-in OpenAI-compatible gateway provider mirroring the OpenRouter wiring: registry spec (sk-orca- key prefix, default base URL), ProvidersConfig field, WebUI icon/brand + deferred model list, docs, and tests.
2026-08-16 00:26:51 +08:00
shen0122 4de728a555 fix(anthropic): treat stream idle timeout as inactivity only, not total time 2026-08-14 23:18:13 +08:00
chengyongru edec29e997 feat(providers): support DeepSeek V4 Pro Responses 2026-08-13 01:02:41 +08:00
LHMQ878 f5cf4dcd2c fix(providers): stop writing API keys into process os.environ
OpenAICompatProvider already passes api_key into AsyncOpenAI. Mutating
shared os.environ leaked credentials across providers (gateway overwrite
and setdefault first-writer-wins).

Fixes #4784
2026-08-12 02:35:40 +09:00
chengyongru 57d81bc1cd fix(providers): preserve nanobot tools with OpenRouter server tools (#5335)
* fix(providers): preserve functions with extra body tools

* docs(providers): clarify extra body tool merging
2026-08-11 18:23:27 +08:00
chengyongru ff6deda178 fix: modernize dependency recovery guidance (#5282) 2026-08-07 13:58:13 +08:00
chengyongru 67805f5db8 feat: add provider-native request switches (#5254) 2026-08-05 18:26:39 +08:00
chengyongru 4e8702a47b fix(anthropic): support Opus 5 effort controls (#5236) 2026-08-04 13:38:54 +08:00
chengyongru 44b7e1bf41 fix(providers): keep serde errors explicit 2026-08-03 18:06:45 +08:00
arcdrake22 6eda67b50c fix(providers): keep reasoning items wire-valid for DeepSeek Responses
convert_messages() emitted reasoning items with ``content`` as a plain
string whenever preserve_reasoning was enabled (the DeepSeek spec).
DeepSeek's Responses gateway rejects that shape with a serde error
("input: invalid type: string ..., expected a sequence"), which surfaced
only after token consolidation cleared provider_state and forced the
full-history conversion path; replayed server items already carry list
content, which is why normal multi-turn requests never failed. Serialize
reasoning content as a list of output_text parts, matching the OpenAI
Responses schema and DeepSeek's accepted wire shape (verified live against
api.deepseek.com/responses).

The serde fallback classifier introduced in the previous commit remains as
a last-resort safeguard for any remaining wire incompatibility.

Tests: extend test_preserves_deepseek_reasoning_content to the array shape;
add a full-history regression with the observed failing item, a
replay/consolidation regression covering both replayed and converted
reasoning items, and provider-level request fixtures for both paths.
Full suite: 5773 passed, 22 skipped (only the known local-only
channels/sms packaging failure remains).
2026-08-03 18:06:45 +08:00
arcdrake22 fb2688fd37 fix(providers): fall back to chat completions on serde body rejections
DeepSeek's new Responses endpoint (deepseek-v4-flash) intermittently rejects valid request bodies with serde deserialization errors such as 'input: invalid type: string ..., expected a sequence'. These were not classified as compatibility errors, so affected conversations died instead of falling back to Chat Completions.

The wire format is correct (input serializes as a list), so this is a server-side Responses compatibility issue; Chat Completions is strictly more permissive, making fallback safe. Extend the fallback classifier to recognize serde body-parsing markers. Repeated failures still trip the existing circuit breaker.
2026-08-03 18:06:45 +08:00
Xubin Ren e7ec981f79 test(providers): verify Eden AI gateway contract 2026-08-03 16:40:13 +08:00
arcdrake22 08fe9f7b3a fix(image): send Gemini Flash hints via generationConfig.imageConfig
The live v1beta API rejects the legacy responseFormat.image block
(enum-based aspectRatio/imageSize fields) for gemini-3.1-flash-lite-image
with INVALID_ARGUMENT, even for documented plain-string values. Gemini
Flash image models accept plain-string hints under
generationConfig.imageConfig instead (e.g. aspectRatio 16:9, imageSize
1K), which the API accepts. Switch the flash path to imageConfig and
update the provider tests accordingly. Other providers (aihubmix,
ollama, imagen) are untouched.
2026-08-03 11:22:09 +08:00
chengyongru cdb75f8e7d feat(providers): support DeepSeek Responses API (#5197) 2026-08-01 11:53:51 +08:00
chengyongru 6a1a45d07a feat: preserve Responses reasoning state and compact context (#5172) 2026-07-30 22:39:43 +08:00
chengyongru 606ac56e8f feat(webui): support remote Codex OAuth login (#5174) 2026-07-30 15:06:34 +08:00
chengyongru 757ad9c764 refactor: enforce BasedPyright strict type checking (#5158) 2026-07-29 21:37:11 +08:00
chengyongru ef9e687f19 refactor(core): remove redundant runtime scaffolding (#5127) 2026-07-28 11:07:58 +08:00
chengyongru b3d3a3e6c3 fix(image): delegate DNS to explicit proxy 2026-07-27 10:06:19 +08:00
chengyongru d73794bc68 fix(image): honor provider proxy for URL downloads 2026-07-27 10:06:19 +08:00
Xubin Ren cc3dbbe804 fix(security): block IPv6 unspecified SSRF targets 2026-07-27 10:06:19 +08:00
Xubin Ren 4408cde019 fix(security): harden generated image downloads 2026-07-27 10:06:19 +08:00
Xubin Ren cf1e801a29 fix(image): align Gemini hints with model capabilities 2026-07-27 03:07:41 +08:00
Xubin Ren a8604a3172 fix(image): scope Gemini image sizes by model 2026-07-27 03:07:41 +08:00
stupidloudandClaude Opus 4.8 ef445cc246 fix(image): narrow Gemini Flash aspect-ratio and image-size scoping
Address review feedback that the capability checks were broader than the
documented per-model matrix:

- Drop the extreme aspect ratios (1:4, 4:1, 1:8, 8:1) from the Flash
  allow-list. They are only documented for 3.1 Flash / Flash Lite, so the
  global set could send an unsupported ratio to 2.5 Flash Image or 3.1 Pro
  Image. Keep the ratios common to every Flash image model.
- Identify imageSize support positively via "gemini-3" instead of excluding
  "2.5". The old predicate also matched gemini-2.0-flash-preview-image-
  generation, which (with the default 1K size) altered that model's request
  shape even though only Gemini 3+ image models accept a configurable size.

Add tests for the gemini-2.0 image-size drop and the extreme-ratio drop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 03:07:41 +08:00
stupidloudandClaude Opus 4.8 4986590bd7 fix(image): pass aspect ratio and size to Gemini Flash image models
The Gemini Flash image path (`generateContent`) dropped both `aspect_ratio`
and `image_size`: `generate()` never forwarded them and
`_generate_gemini_flash` did not accept them, so every request fell back to
1:1 / input-matched output. The Imagen path was unaffected.

Forward the hints and emit them under
`generationConfig.responseFormat.image` per the current Gemini API. Aspect
ratio is validated against the accepted set; `imageSize` is validated against
{512,1K,2K,4K} and only sent to Gemini 3+ image models, since
`gemini-2.5-flash-image` supports only `aspectRatio`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 03:07:41 +08:00
Xubin Ren 8e4fe9cfaf fix(providers): preserve non-multimodal tool lists 2026-07-24 18:58:32 +08:00
Xubin Ren 07a81d70be fix(providers): preserve multimodal tool outputs 2026-07-24 18:58:32 +08:00
chengyongru aae259c790 feat(webui): simplify model preset settings (#5061) 2026-07-24 00:55:06 +08:00
Arthur K. 3647875aba fix: add one second to retry after delays 2026-07-23 14:10:27 +08:00