1392 Commits

Author SHA1 Message Date
CaIon
4e1b05e987 feat: add conditional setting for HTTP headers in OpenRouter channel type 2026-03-12 19:05:30 +08:00
Seefs
7a0ff73c1b Merge pull request #3221 from RedwindA/chore/updateModelList
chore: update model lists for frequently used channels
2026-03-12 15:13:03 +08:00
CaIon
902725eb66 feat: update header title for OpenRouter channel type 2026-03-12 15:05:58 +08:00
RedwindA
cd1b3771bf chore: update model lists for frequently used channels 2026-03-11 23:39:18 +08:00
Calcium-Ion
122d5c00ef Merge pull request #3182 from seefs001/feature/params-override-beta-header-append
feat:support $keep_only_declared and deduped $append for header override
2026-03-10 02:03:02 +08:00
Calcium-Ion
b0d8b563c3 Merge pull request #3148 from feitianbubu/pr/d8a25d36204224f8a4248b0ab3b03ba703796ea3
fix: kling risk fail return openAIVideo error
2026-03-09 22:19:04 +08:00
Seefs
6ff5a5dc99 feat:support $keep_only_declared and deduped $append for header token overrides 2026-03-09 00:12:53 +08:00
CaIon
782124510a fix: update OpenAI request fields to use json.RawMessage for dynamic data handling 2026-03-06 19:10:42 +08:00
feitianbubu
c3a96bc980 fix: kling risk fail return openAIVideo error 2026-03-06 16:32:52 +08:00
Seefs
be8a623586 fix: ignore top_p 2026-03-06 12:07:36 +08:00
Seefs
a6ede75415 fix: ignore top_p 2026-03-06 12:07:00 +08:00
Seefs
267c99b779 fix: If top_p is not provided, Claude's logic will automatically set it to 1. 2026-03-06 12:03:51 +08:00
Calcium-Ion
44e59e1ced Merge pull request #2769 from feitianbubu/pr/3d0aaa75866f8d958a777a7e7ac8c1e4b5b3e537
feat: kling cost quota support use FinalUnitDeduction as totalToken
2026-03-06 11:46:59 +08:00
Seefs
f0e938a513 Merge pull request #3120 from nekohy/main
feats: repair the thinking of claude to openrouter convert
2026-03-05 18:10:46 +08:00
feitianbubu
1b85b183e6 fix: fetch model add header passthrough rule key check 2026-03-05 17:49:36 +08:00
Seefs
16e4ce52e3 feat: add wildcard path support and improve param override templates/editor 2026-03-05 16:39:34 +08:00
Nekohy
5b264f3a57 feats: repair the thinking of claude to openrouter convert 2026-03-05 06:12:48 +08:00
CaIon
3b65c32573 fix: improve error message for unsupported image generation models 2026-03-04 00:36:03 +08:00
feitianbubu
d12cc3a8da fix: use default model price for radio price model 2026-03-03 11:22:04 +08:00
Calcium-Ion
d36f4205a9 Merge pull request #3081 from BenLampson/main
Return error when model price/ratio unset
2026-03-02 22:01:21 +08:00
Seefs
b1b3def081 Revert "fix: aws text content blocks must be non-empty" 2026-03-02 19:43:00 +08:00
Seefs
9be9943224 Revert "Fix/aws non empty text" 2026-03-02 19:40:53 +08:00
Calcium-Ion
5dcbcd9cad fix: tool responses (#3080) 2026-03-02 19:23:50 +08:00
Seefs
032a3ec7df fix: tool responses 2026-03-02 19:22:37 +08:00
Fat Person
4b439ad3be Return error when model price/ratio unset
#3079
Change ModelPriceHelperPerCall to return (PriceData, error) and stop silently falling back to a default price. If a model price is not configured the helper now returns an error (unless the user has AcceptUnsetRatioModel enabled and a ratio exists). Propagate this error to callers: Midjourney handlers now return a MidjourneyResponse with Code 4 and the error message, and task submission returns a wrapped task error with HTTP 400. Also extract remix video_id in ResolveOriginTask for remix actions. This enforces explicit model price/ratio configuration and surfaces configuration issues to clients.
2026-03-02 19:09:48 +08:00
Seefs
0689600103 Merge pull request #3066 from seefs001/fix/aws-header-override
Fix/aws header override
2026-03-02 18:54:56 +08:00
Seefs
550fbe516d fix: default empty input_json_delta arguments to {} for tool call parsing 2026-03-02 15:51:55 +08:00
Seefs
d826dd2c16 fix: preserve tool_use on malformed tool arguments to keep tool_result pairing valid 2026-03-02 15:41:03 +08:00
Seefs
17d1224141 fix: aws text content blocks must be non-empty 2026-03-02 15:31:37 +08:00
Seefs
0e9198e9b5 fix: preserve explicit zero values in native relay requests 2026-03-01 15:47:03 +08:00
CaIon
21cfc1ca38 feat(gemini): update request structures for Veo predictLongRunning
- Refactored the request URL and body construction methods to align with the Veo predictLongRunning endpoint.
- Introduced new data structures for Veo instances and parameters, replacing the previous Gemini video generation configurations.
- Updated the Vertex adaptor to utilize the new Veo request payload format.
2026-02-28 18:42:54 +08:00
Seefs
99bb41e310 Merge pull request #3009 from seefs001/feature/improve-param-override
feat: improve channel override ui/ux
2026-02-28 18:19:40 +08:00
CaIon
2189fd8f3e feat(gemini): implement video generation configuration and billing estimation
- Added Gemini video generation configuration structures and payloads.
- Introduced functions for parsing and resolving video duration and resolution from metadata.
- Enhanced the Vertex adaptor to support Gemini video generation requests and billing estimation based on duration and resolution.
- Updated model pricing settings for new Gemini video models.
2026-02-28 17:37:08 +08:00
Seefs
3286f3da4d feat: support token-map rewrite for comma-separated headers and add bedrock anthropic-beta preset 2026-02-27 19:47:32 +08:00
Seefs
6c6096f706 refactor(override): simplify header overrides to a lowercase single map 2026-02-25 17:24:18 +08:00
Seefs
305dbce4ad fix: merge runtime and channel header overrides, skip missing source headers 2026-02-25 16:12:34 +08:00
Seefs
bb0c663dbe fix pass_headers 2026-02-25 15:39:49 +08:00
Seefs
db0b452ea2 Merge branch 'upstream-main' into feature/improve-param-override
# Conflicts:
#	relay/channel/api_request_test.go
#	relay/common/override_test.go
#	web/src/components/table/channels/modals/EditChannelModal.jsx
2026-02-25 13:39:54 +08:00
CaIon
4a4cf0a0df fix: improve multipart form data handling by detecting content type. fix #3007 2026-02-25 12:51:46 +08:00
CaIon
4c7e65cb24 feat: add comprehensive tests for StreamScannerHandler functionality
- Introduced a new test file for StreamScannerHandler, covering various scenarios including nil inputs, empty bodies, chunk processing, order preservation, and handler failures.
- Enhanced error handling and data processing logic in StreamScannerHandler to improve robustness and performance.
2026-02-24 17:36:08 +08:00
hekx
98de082804 fix: skip Accept-Encoding during header passthrough (#2214) 2026-02-24 09:58:50 +08:00
CaIon
0835e15091 fix: enhance data trimming and validation in stream scanner 2026-02-23 17:42:22 +08:00
Calcium-Ion
d0b35ed60b Merge pull request #2959 from seefs001/fix/gemini-tool-use-token
fix: unify usage mapping and include toolUsePromptTokenCount
2026-02-22 23:35:09 +08:00
Calcium-Ion
4b058b4a1d Merge pull request #2960 from seefs001/feature/minimax-native-claude
feat: minimax native /v1/messages
2026-02-22 23:32:53 +08:00
Calcium-Ion
77838100a6 feat: add missing OpenAI/Claude/Gemini request fields (#2971)
* feat: add missing OpenAI/Claude/Gemini request fields and responses stream options

* fix: skip field filtering when request passthrough is enabled

* fix: include subscription in personal sidebar module controls

* feat: gate Claude inference_geo passthrough behind channel setting and add field docs
2026-02-22 23:31:18 +08:00
Seefs
a01a77fc6f fix: claude affinity cache counter (#2980)
* fix: claude affinity cache counter

* fix: claude affinity cache counter

* fix: stabilize cache usage stats format and simplify modal rendering
2026-02-22 23:30:02 +08:00
CaIon
3b6af5dca3 refactor: clean up unused code and improve error logging in adaptor and mjp modules 2026-02-22 22:11:05 +08:00
CaIon
ee414e10c9 feat(mjp): update billing log for failed tasks 2026-02-22 20:34:25 +08:00
Seefs
303fff44e7 feat: add pass_headers op, grouped presets (incl. Gemini 4K), and robust JSON fallback 2026-02-22 17:16:57 +08:00
CaIon
ec5c6b28ea feat(task): add model redirection, per-call billing, and multipart retry fix for async tasks
1. Async task model redirection (aligned with sync tasks):
   - Integrate ModelMappedHelper in RelayTaskSubmit after model name
     determination, populating OriginModelName / UpstreamModelName on RelayInfo.
   - All task adaptors now send UpstreamModelName to upstream providers:
     - Gemini & Vertex: BuildRequestURL uses UpstreamModelName.
     - Doubao & Ali: BuildRequestBody conditionally overwrites body.Model.
     - Vidu, Kling, Hailuo, Jimeng: convertToRequestPayload accepts RelayInfo
       and unconditionally uses info.UpstreamModelName.
     - Sora: BuildRequestBody parses JSON and multipart bodies to replace
       the "model" field with UpstreamModelName.
   - Frontend log visibility: LogTaskConsumption and taskBillingOther now
     emit is_model_mapped / upstream_model_name in the "other" JSON field.
   - Billing safety: RecalculateTaskQuotaByTokens reads model name from
     BillingContext.OriginModelName (via taskModelName) instead of
     task.Data["model"], preventing billing leaks from upstream model names.

2. Per-call billing (TaskPricePatches lifecycle):
   - Rename TaskBillingContext.ModelName → OriginModelName; add PerCallBilling
     bool field, populated from TaskPricePatches at submission time.
   - settleTaskBillingOnComplete short-circuits when PerCallBilling is true,
     skipping both adaptor adjustments and token-based recalculation.
   - Remove ModelName from TaskSubmitResult; use relayInfo.OriginModelName
     consistently in controller/relay.go for billing context and logging.

3. Multipart retry boundary mismatch fix:
   - Root cause: after Sora (or OpenAI audio) rebuilds a multipart body with a
     new boundary and overwrites c.Request.Header["Content-Type"], subsequent
     calls to ParseMultipartFormReusable on retry would parse the cached
     original body with the wrong boundary, causing "NextPart: EOF".
   - Fix: ParseMultipartFormReusable now caches the original Content-Type in
     gin context key "_original_multipart_ct" on first call and reuses it for
     all subsequent parses, making multipart parsing retry-safe globally.
   - Sora adaptor reverted to the standard pattern (direct header set/get),
     which is now safe thanks to the root fix.

4. Tests:
   - task_billing_test.go: update makeTask to use OriginModelName; add
     PerCallBilling settlement tests (skip adaptor adjust, skip token recalc);
     add non-per-call adaptor adjustment test with refund verification.
2026-02-22 16:33:00 +08:00