Commit Graph
65 Commits
Author SHA1 Message Date
hkxiaoyao 7daf355e65 fix(pool): keep schedulable keys when stale inactive scores exist
- delete pool member scores when a provider key is deactivated
- fall through to the catalog key scan when the pool score page is empty
- log skipped local candidates with a skip_reason for diagnosis
- add regressions for inactive keys with stale available scores
2026-09-14 20:42:47 +08:00
elky ecc16673eb fix: harden concurrency limits and high-RPM runtime paths
Bound request, stream, queue, and shutdown resource lifetimes. Reduce scheduler and Redis hot-path work and isolate database maintenance. Include regression coverage, load probes, and concurrency audit results.
2026-09-10 08:14:58 +08:00
elky 361952ada9 fix: resolve workspace lint and regression test failures 2026-09-09 11:34:45 +08:00
elky 579f2c7cc1 feat(security): harden gateway boundaries and usage policies
Consolidate subscription usage policy enforcement, privacy-safe persistence, and gateway security hardening into one reviewable change.

Includes bounded HTTP and execution envelopes, header and protocol guards, DNS and relay validation, authentication and secret projection hardening, secure backup/install paths, and regression coverage.
2026-09-04 03:45:52 +08:00
ZheFox 587486ab0c Merge remote-tracking branch 'upstream/main' into codex/fix-antigravity-quota 2026-09-03 13:24:39 +08:00
fawney 2cb4d554aa feat(routing): consolidate scheduling strategy configuration 2026-09-03 11:05:59 +08:00
ZheFox f822df6cce Merge remote-tracking branch 'origin/main' into codex/fix-antigravity-quota 2026-09-03 10:46:49 +08:00
elky 7323d41fbe feat(routing): move sticky-key retries into routing policy with lazy attempts
Replace the provider/endpoint max_retries fields as the source of same-key
retries with a routing policy setting, sticky_key_attempts (default 2). Only
the first-ranked candidate is retried on the same key; every failover
candidate gets a single attempt so failover keeps advancing instead of
retrying each fallback key.

Materialize exactly one attempt per candidate and derive same-key retries in
the attempt loop after a candidate-scoped failure, so the retry budget no
longer inflates up-front materialization and needs no upper bound. The budget
travels in the report context; retries reuse the plan with a fresh candidate
id and incremented retry index. Pool groups only retry their first key within
the retry-index stride.

Expose the setting in the routing profile editor and the set_scheduling rule
action, and drop the max_retries input from the provider form.
2026-09-02 20:48:40 +08:00
elky 415b2da81b feat(routing): make routing profiles the sole scheduler policy source
Bootstrap an enabled system-default routing group from the legacy
scheduler config keys on startup, resolve the default ordering config
from that group before falling back to the legacy keys, and stop merging
keep_priority_on_conversion with the legacy flag when a policy is
resolved. Thread the policy-derived ordering config into candidate
preselection so it no longer reads system config independently.

Add per-API-format key priority overrides so a key serving several
formats keeps independent ordering, matching the legacy
global_priority_by_format semantics. Expose keep_priority_on_conversion
in the routing profile editor and read the effective policy in the
model routing preview, monitoring metrics and provider page badge.
2026-09-02 17:04:04 +08:00
zhefox dbbe7b22ab fix(pool): isolate dynamic model quota buckets and 429 scheduling 2026-09-02 15:23:23 +08:00
elky 4148ab1931 fix(routing): harden routed pool scheduling 2026-07-27 22:06:28 +08:00
MMEXA 20b27a13b2 feat(codex): 按操作语义路由 Responses V2 压缩
(cherry picked from commit 2fc604e047)
2026-07-16 00:34:42 +08:00
MMEXA dfa121dd5b feat(openai): align GPT-5.6 and Codex request contracts 2026-07-11 07:40:12 +08:00
elky 6f00e9fc67 Improve gateway transport and usage runtime 2026-06-25 22:36:27 +08:00
elky d336d1a7fa Improve gateway scheduling and runtime admission 2026-06-24 01:53:45 +08:00
elky f75894acbb perf: reduce gateway db pressure under load 2026-06-22 00:08:48 +08:00
elky 68038c182b Distinguish expired OAuth token status 2026-06-12 19:43:59 +08:00
fawney19 1658925f52 Disable key circuit breaker for pool providers 2026-05-29 15:16:06 +08:00
fawney19 42e723ff7c Clarify API key concurrency skip reasons 2026-05-27 17:00:09 +08:00
fawney19 f76bbaab52 feat: support api key ip restriction rules 2026-05-20 16:11:49 +08:00
RWDai 2a3593d9c5 Update planner auth snapshot fixtures 2026-05-18 20:48:14 +08:00
fawney19 fa73655134 refactor: isolate dispatch scheduling core 2026-05-12 13:15:41 +08:00
AAEE86 67ca47afd4 fix(gateway): 修复正则模型映射未生效到出站请求
修复 key allowed_models 通过 global_model_mappings 正则命中时,
候选选择仍使用 provider model mapping 作为出站模型的问题。

正则命中后将 allowed model 写入 selected_provider_model_name,
确保最终 execution runtime 请求体中的 model 使用映射后的模型。

补充三层回归测试:
- scheduler-core 正则映射解析
- gateway candidate/data 候选选择输出
- gateway ai_execute 出站请求 model 捕获
2026-05-11 15:58:13 +08:00
fawney19 247ea9d1bd Restrict scheduler affinity to cache affinity mode 2026-05-11 14:06:49 +08:00
fawney19 cc4512fbbb Refine load balance candidate ranking 2026-05-11 02:32:11 +08:00
fawney19 e3574e1918 Track scheduler affinity epochs and key sorting 2026-05-11 01:45:49 +08:00
fawney19 7b81c77424 Fix regex model mapping direction 2026-05-11 01:43:14 +08:00
fawney19 fd44906bb7 fix provider pool quota status handling 2026-05-07 11:28:44 +08:00
fawney19 10e679bb2f Add provider key cycle stats reset handling 2026-05-07 03:23:20 +08:00
fawney19 012f8bcdf7 feat: scope model mappings by endpoint 2026-05-07 00:48:15 +08:00
RWDai 657f9f0be1 fix: carry session affinity through Gemini files 2026-05-05 12:25:07 +08:00
RWDai 9ef7952da5 fix: keep scheduler affinity out of runtime checks 2026-05-05 11:23:54 +08:00
RWDai eb8878695a feat: thread session affinity through scheduler selection 2026-05-05 11:23:54 +08:00
RWDai c596d82dec feat: pass session scope into scheduler cache 2026-05-05 11:23:54 +08:00
fawney19 6f00cabe96 Lazy load requested model candidates 2026-05-03 20:56:31 +08:00
fawney19 a24e4a793d Refactor pool candidate scheduling 2026-05-03 20:14:29 +08:00
fawney19 c4ea042eb4 feat: add model directive management 2026-05-03 14:48:25 +08:00
Kayphoonandfawney19 fe27fb17fb feat: add provider-key concurrent limit (#352)
* feat: add provider-key concurrent limit

* Fix provider key concurrent limit checks

---------

Co-authored-by: fawney19 <[email protected]>
2026-05-03 01:55:23 +08:00
fawney19 c130d0e2c9 refactor ai serving modules and crates 2026-05-02 13:23:54 +08:00
fawney19 07a319259b Normalize canonical API formats 2026-04-29 10:20:41 +08:00
AAEE86 712b484bc8 fix(scheduler): 恢复正则模型映射作为上游模型 (#355)
保留 provider_model_mappings 的优先级选择逻辑,但恢复
GlobalModel model_mappings 正则命中后的行为:使用命中的
allowed_model 作为实际上游 mapped_model。

修复了 #354 请求绕过基于正则表达式的模型映射的问题
2026-04-28 10:36:50 +08:00
Kayphoon 5311eb0da1 Fix provider model mapping selection (#354) 2026-04-28 09:23:39 +08:00
fawney19 032dcf40e7 fix: filter candidate rows to resolved global model name only 2026-04-28 01:12:27 +08:00
fawney19 218e73e324 Use core affinity helpers directly 2026-04-27 17:24:32 +08:00
fawney19 9da47ceb22 Remove duplicate capability candidate sorting 2026-04-27 17:24:32 +08:00
fawney19 e9f03d8d29 Remove ranked minimal selection compatibility helper 2026-04-27 17:24:32 +08:00
fawney19 e5e09b49f4 Remove ranked candidate data read wrappers 2026-04-27 17:24:32 +08:00
fawney19 dda6f34a07 Rename ranked minimal candidate reads 2026-04-27 17:24:32 +08:00
fawney19 2101a4ecc7 Drop legacy candidate ordering helpers 2026-04-27 17:24:31 +08:00
fawney19 3b542434a2 Unify candidate ranking pipeline 2026-04-27 17:24:31 +08:00