237 Commits

Author SHA1 Message Date
CaIon
2c9b22153f feat: enhance Claude request header handling with append functionality 2026-03-09 23:47:51 +08:00
CaIon
8186ed0ea5 fix: update language settings and improve model pricing editor for better clarity and functionality 2026-03-06 21:36:51 +08:00
Seefs
3cb0ca264f fix(relay): skip retries for bad response body errors 2026-03-06 18:22:25 +08:00
CaIon
18aa0de323 fix: add support for gpt-5.4 model in model_ratio.go 2026-03-06 11:43:05 +08:00
CaIon
477e9cf7db feat: add AionUI to chat settings and built-in templates 2026-03-02 21:19:04 +08:00
CaIon
96264d2f8f feat: add cc-switch integration and modal for token management
- Introduced a new CCSwitchModal component for managing CCSwitch configurations.
- Updated the TokensPage to include functionality for opening the CCSwitch modal.
- Enhanced the useTokensData hook to handle CCSwitch URLs and trigger the modal.
- Modified chat settings to include a new "CC Switch" entry.
- Updated sidebar logic to skip certain links based on the new configuration.
2026-03-01 23:23:20 +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
Calcium-Ion
4727fc5d60 Merge pull request #3059 from QuantumNous/feat/veo
feat(gemini): implement video generation configuration
2026-02-28 17:55:24 +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
15855f04e8 feat: add gemini-3-pro-image-preview/gemini-2.5-flash-image/gemini-3.1-flash-image-preview to supported image presets 2026-02-27 00:44:17 +08:00
Seefs
0519446571 feat:add CLI param-override templates with visual editor and apply on first rule match 2026-02-25 15:08:23 +08:00
Seefs
4831bb7b5b feat: guard new 504/524 status remaps with risk confirmation 2026-02-22 20:03:46 +08:00
RedwindA
333caa7f0c fix: adjust default Gemini cache ratios 2026-02-20 12:28:30 +08:00
CaIon
44c5fac5ea refactor(ratio): replace maps with RWMap for improved concurrency handling 2026-02-08 00:48:21 +08:00
Seefs
50ee4361d0 feat: make 5m cache-creation ratio configurable 2026-02-06 19:46:59 +08:00
Calcium-Ion
053699fa98 Merge commit from fork
fix: harden token search with pagination, rate limiting and input validation
2026-02-06 17:54:40 +08:00
CaIon
3e1be18310 fix: harden token search with pagination, rate limiting and input validation
- Add configurable per-user token creation limit (max_user_tokens)
- Sanitize search input patterns to prevent expensive queries
- Add per-user search rate limiting (by user ID)
- Add pagination to search endpoint with strict page size cap
- Skip empty search fields instead of matching nothing
- Hide internal errors from API responses
- Fix Interface2String float64 formatting causing config parse failures
- Add float-string fallback in config system for int/uint fields
2026-02-06 17:52:19 +08:00
Papersnake
c9f5de7048 feat: support adaptive thinking 2026-02-06 11:01:23 +08:00
Papersnake
2504818b5a feat: add claude-opus-4-6 2026-02-06 09:12:45 +08:00
CaIon
1d611d89d2 remove: drop support for claude-2 and claude-1 series models
- Remove claude-instant-1.2, claude-2, claude-2.0, claude-2.1 from model lists
- Remove /v1/complete endpoint support (legacy completion API)
- Remove RequestModeCompletion and related code paths
- Simplify handler functions by removing requestMode parameter
- Update all channel adaptors that referenced claude handlers
2026-02-05 17:20:46 +08:00
CaIon
7a4fc68bcc feat(performance): implement system performance monitoring with configurable thresholds 2026-02-04 21:26:07 +08:00
Seefs
c50eff53d4 feat: default enable channel affinity 2026-02-02 22:21:49 +08:00
Seefs
540cf6c991 fix: channel affinity (#2799)
* fix: channel affinity log styles

* fix: Issue with incorrect data storage when switching key sources

* feat: support not retrying after a single rule configuration fails

* fix: render channel affinity tooltip as multiline content

* feat: channel affinity cache hit

* fix: prevent ChannelAffinityUsageCacheModal infinite loading and hide data before fetch

* chore: format backend with gofmt and frontend with prettier/eslint autofix
2026-02-02 14:37:31 +08:00
RedwindA
e3f96120bc feat(gemini): support cached token billing 2026-02-01 22:50:47 +08:00
Calcium-Ion
1c983a04d3 feat: disk request body cache (#2780)
* feat: 引入通用 HTTP BodyStorage/DiskCache 缓存配置与管理

- 新增 common/body_storage.go 提供 HTTP 请求体存储抽象和文件缓存能力
- 增加 common/disk_cache_config.go 支持全局磁盘缓存配置
- main.go 挂载缓存初始化流程
- 新增和补充 controller/performance.go (及 unix/windows) 用于缓存性能监控接口
- middleware/body_cleanup.go 自动清理缓存文件
- router 挂载相关接口
- 前端 settings 页面新增性能监控设置 PerformanceSetting
- 优化缓存开关状态和模块热插拔能力
- 其他相关文件同步适配缓存扩展

* fix: 修复 BodyStorage 并发安全和错误处理问题

- 修复 diskStorage.Close() 竞态条件,先获取锁再执行 CAS
- 为 memoryStorage 添加互斥锁和 closed 状态检查
- 修复 CreateBodyStorageFromReader 在磁盘存储失败时的回退逻辑
- 添加缓存命中统计调用 (IncrementDiskCacheHits/IncrementMemoryCacheHits)
- 修复 gin.go 中 Seek 错误被忽略的问题
- 在 api-router 添加 BodyStorageCleanup 中间件
- 修复前端 formatBytes 对异常值的处理

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-30 01:00:49 +08:00
Seefs
b1842b908e fix: /v1/responses/compact default billing 2026-01-28 14:22:34 +08:00
Seefs
478f1871d6 feat: grok Usage Guidelines Violation Fee (#2753)
* feat: grok Usage Guidelines Violation Fee ui setting

* feat: grok Usage Guidelines Violation Fee consume log

* fix: grok Usage Guidelines Violation Fee log detail
2026-01-26 20:20:30 +08:00
Seefs
cc1da72d10 feat: openai response /v1/response/compact (#2644)
* feat: openai response /v1/response/compact

* feat: /v1/response/compact bill

* feat: /v1/response/compact

* feat: /v1/responses/compact -> codex channel

* feat: /v1/responses/compact -> codex channel

* feat: /v1/responses/compact -> codex channel

* feat: codex channel default models

* feat: compact model price

* feat: /v1/responses/comapct test
2026-01-26 20:20:16 +08:00
Seefs
d7d3a2f763 feat: channel affinity (#2669)
* feat: channel affinity

* feat: channel affinity -> model setting

* fix: channel affinity

* feat: channel affinity op

* feat: channel_type setting

* feat: clean

* feat: cache supports both memory and Redis.

* feat: Optimise ui/ux

* feat: Optimise ui/ux

* feat: Optimise codex usage ui/ux

* feat: Optimise ui/ux

* feat: Optimise ui/ux

* feat: Optimise ui/ux

* feat: If the affinitized channel fails and a retry succeeds on another channel, update the affinity to the successful channel
2026-01-26 19:57:41 +08:00
Xyfacai
cf745623f8 feat(qwen): support qwen image sync image model config 2026-01-22 17:46:36 +08:00
Seefs
4bffc249d6 feat: customizable automatic retry status codes 2026-01-14 14:34:12 +08:00
Seefs
41da848c56 Merge pull request #2647 from seefs001/feature/status-code-auto-disable
feat: status code auto-disable configuration
2026-01-12 18:47:45 +08:00
Seefs
62b796fa6a feat: /v1/chat/completion -> /v1/response (#2629)
* feat: /v1/chat/completion -> /v1/response
2026-01-11 21:38:07 +08:00
CaIon
8abfbe372f feat(checkin): add check-in functionality with status retrieval and user quota rewards 2026-01-02 23:00:33 +08:00
CaIon
d06915c30d feat(ratio): add functions to check for audio ratios and clean up unused code 2025-12-31 21:29:10 +08:00
CaIon
b1bb64ae11 feat(model): add audio ratios for new TTS models and adjust default values 2025-12-31 21:22:33 +08:00
Calcium-Ion
654bb10b45 Merge pull request #2460 from seefs001/feature/gemini-flash-minial
fix(gemini): handle minimal reasoning effort budget
2025-12-26 13:57:56 +08:00
Seefs
559da6362a fix: revert model ratio 2025-12-25 15:37:54 +08:00
Seefs
5a64ae2a29 fix: 模型设置增加针对Vertex渠道过滤content[].part[].functionResponse.id的选项,默认启用 2025-12-21 17:09:49 +08:00
Seefs
da24a165d0 fix(gemini): handle minimal reasoning effort budget
- Add minimal case to clampThinkingBudgetByEffort to avoid defaulting to full thinking budget
2025-12-18 08:10:46 +08:00
t0ng7u
8e3f9b1faa 🛡️ fix: prevent OOM on large/decompressed requests; skip heavy prompt meta when token count is disabled
Clamp request body size (including post-decompression) to avoid memory exhaustion caused by huge payloads/zip bombs, especially with large-context Claude requests. Add a configurable `MAX_REQUEST_BODY_MB` (default `32`) and document it.

- Enforce max request body size after gzip/br decompression via `http.MaxBytesReader`
- Add a secondary size guard in `common.GetRequestBody` and cache-safe handling
- Return **413 Request Entity Too Large** on oversized bodies in relay entry
- Avoid building large `TokenCountMeta.CombineText` when both token counting and sensitive check are disabled (use lightweight meta for pricing)
- Update READMEs (CN/EN/FR/JA) with `MAX_REQUEST_BODY_MB`
- Fix a handful of vet/formatting issues encountered during the change
- `go test ./...` passes
2025-12-16 17:00:19 +08:00
CaIon
689c43143b feat(model_ratio): add default ratios for gpt-4o-mini-tts 2025-12-13 19:14:27 +08:00
CaIon
e36e2e1b69 feat(audio): enhance audio request handling with token type detection and streaming support 2025-12-13 17:24:23 +08:00
FlowerRealm
c3c119a9b4 feat: add claude-haiku-4-5-20251001 model support
- Add model to Claude ModelList
- Add model ratio (0.5, $1/1M input tokens)
- Add completion ratio support (5x, $5/1M output tokens)
- Add cache read ratio (0.1, $0.10/1M tokens)
- Add cache write ratio (1.25, $1.25/1M tokens)

Model specs:
- Context window: 200K tokens
- Max output: 64K tokens
- Release date: October 1, 2025
2025-12-05 18:54:20 +08:00
Seefs
b6a02d8303 feat: gemini 3 thinking level gemini-3-pro-preview-high 2025-12-01 16:40:46 +08:00
Seefs
3257723a55 Revert "OAI生图接口支持gemini 3 pro image preview" 2025-11-30 18:49:18 +08:00
feitianbubu
bff04514a8 feat: support gemini-3-pro-image-preview via images/generations 2025-11-26 12:03:24 +08:00
Papersnake
79682dc542 feat: add claude-opus-4-5-20251101 2025-11-25 10:53:01 +08:00
Papersnake
5931d333cb feat: add claude-opus-4-5-20251101 ratio 2025-11-25 10:49:34 +08:00
CaIon
c939686509 refactor: Deprecate HARM_CATEGORY_CIVIC_INTEGRITY in safety settings 2025-11-23 23:45:48 +08:00