Commit Graph

214 Commits

Author SHA1 Message Date
fawney19
ed17147281 fix: align provider oauth refresh redirects 2026-04-27 22:08:02 +08:00
fawney19
a7a3c9f023 Fix OAuth import proxy handling 2026-04-27 20:05:43 +08:00
fawney19
4c16b11cb4 Align runtime miss tests with skipped candidates 2026-04-27 18:09:56 +08:00
fawney19
17f09fc8c1 Expose ranking metadata in request trace 2026-04-27 17:24:32 +08:00
fawney19
3e0293ac28 Rename local candidate resolution entrypoints 2026-04-27 17:24:32 +08:00
fawney19
07fba70a90 Guard pool scheduler ranking boundary 2026-04-27 17:24:32 +08:00
fawney19
da0e968975 Update transport ranking architecture guard 2026-04-27 17:24:32 +08:00
fawney19
98e4e91a98 Rename transport ordering facts 2026-04-27 17:24:32 +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
f10f5f071d Clarify ranked minimal candidate selection 2026-04-27 17:24:32 +08:00
fawney19
517e84e5ae Move local ranking test helper into tests 2026-04-27 17:24:31 +08:00
fawney19
2101a4ecc7 Drop legacy candidate ordering helpers 2026-04-27 17:24:31 +08:00
fawney19
8d2cbf32df Remove legacy tunnel-only candidate ordering 2026-04-27 17:24:31 +08:00
fawney19
a23758808d Isolate core candidate selection helpers 2026-04-27 17:24:31 +08:00
fawney19
91db4eefd0 Persist ranking metadata through request traces 2026-04-27 17:24:31 +08:00
fawney19
f52220a8ec Clean up planner candidate modules 2026-04-27 17:24:31 +08:00
fawney19
1d23bf4ecb Isolate standalone key wallet handling 2026-04-27 17:24:31 +08:00
fawney19
3b542434a2 Unify candidate ranking pipeline 2026-04-27 17:24:31 +08:00
Entropy.Xu
d8f66b14a8 Handle Codex image stream rate limits (#346) 2026-04-27 12:23:48 +08:00
Entropy.Xu
6e1eaf8aec fix(kiro): 修复 Kiro WebSearch MCP 调用 (#344)
* fix(kiro): 接入 Kiro MCP web_search 工具调用

* fix(kiro): 对齐 Kiro IDE MCP 鉴权与 profileArn 头部

* fix(responses): 保留 Responses 嵌套与自定义工具参数

* test(ci): 通过 Rust Action 三项检查
2026-04-27 12:20:26 +08:00
fawney19
488bd08f04 Stabilize Kiro Claude CLI sync tests 2026-04-27 00:45:48 +08:00
fawney19
3991d47166 Fix format checks and local error messages 2026-04-27 00:27:03 +08:00
fawney19
989b27426b refactor formats adapters and matrix ownership 2026-04-26 23:59:53 +08:00
fawney19
0ec4b4c8a4 guard legacy openai alias compatibility 2026-04-26 23:59:53 +08:00
fawney19
4ec591fbf2 centralize openai responses alias handling 2026-04-26 23:59:53 +08:00
fawney19
ea3dc3257e clean up legacy openai cli adapter names 2026-04-26 23:59:53 +08:00
fawney19
5b914aa78c migrate ai format conversion to responses adapters 2026-04-26 23:59:53 +08:00
Entropy.Xu
e36fb8c07a Honor global format conversion override (#341)
Apply the global enable_format_conversion setting when building provider transport snapshots so enabled global conversion overrides provider-level settings at runtime.

Keep the cached provider snapshot unchanged so disabling the global switch restores each provider's original conversion configuration.
2026-04-26 23:54:52 +08:00
Kayphoon
1af9d00abd fix(gateway): 修复仅配置 provider retry 时 429 不重试 (#338)
- attempt.rs: 从 failover_rules/endpoint/provider 三级读取 max_retries 生成 attempt slots,支持配置 provider retry 后 429 自动重试,限制最大 99 并兼容 legacy 默认值 2
2026-04-26 23:50:14 +08:00
Entropy.Xu
e8763b3bbd fix(kiro): 放行可刷新 OAuth 调度候选 (#340) 2026-04-26 23:49:55 +08:00
AAEE86
f3a9fd4c82 feat(gateway): 补齐号池主动探测后台任务 (#342)
- 解析 pool_advanced 主动探测开关与间隔配置
- 对齐 Python 版本的探测间隔默认值和范围限制
- 新增号池配额主动探测 worker
- 支持 codex、kiro、antigravity provider
- 使用 Redis 时间戳和 provider 级锁避免重复探测
- 接入 gateway 后台任务并补充测试
2026-04-26 23:48:31 +08:00
fawney19
baa0ddd787 Improve runtime miss usage diagnostics 2026-04-26 01:44:54 +08:00
fawney19
1d3ea3232d Add unified candidate failure diagnostics 2026-04-26 01:38:37 +08:00
Entropy.Xu
d784c540b6 fix(kiro): 隐藏 OAuth 刷新重试流程 (#339) 2026-04-25 21:29:45 +08:00
fawney19
429fdb47e6 fix(usage): 简化本地执行错误提示 2026-04-25 20:46:22 +08:00
fawney19
912a92cd1a refactor(rules): 规则引擎容错优化,无效规则条目跳过而非中止整个规则集
- header/body rules 的 _are_locally_supported 简化为仅检查是否为数组
- apply 逻辑中遇到格式错误/不支持的规则条目改为 continue 跳过,而非 return false
- 允许非字符串 header value,自动序列化为 JSON 字符串
- 宽松处理无效 regex flag,不再拒绝整条规则

fix(gateway): Claude CLI 路由仅检查 bearer 头,不排斥同时携带 x-api-key 的请求

feat(observability): 监控链路候选展示解密 auth_config 的账号标签和 OAuth 计划类型
2026-04-25 19:46:52 +08:00
fawney19
00744c0ce5 feat(observability): 引入错误链路 error_flow 元数据并区分上游/客户端错误
- 网关在本地 failover 时构建 error_flow 元数据(分类/决策/传播策略),写入 report_context
- scheduler-core 解析并透传 error_flow 至候选 extra_data
- admin usage 详情拆分 request/upstream/client/failure_summary 错误域,敏感上游错误标记为 suppressed
- 前端 RequestDetailDrawer 拆出"返回客户端"与"上游响应"双错误卡片
- HorizontalRequestTimeline 节点详情展示真实请求错误及 error_flow 标签
2026-04-25 17:01:07 +08:00
Entropy.Xu
bc97e383d3 fix(gateway): 对齐号池调度预设行为 (#332)
- 保持 sticky session 优先于分配模式排序,并支持 sticky_session_ttl_seconds=0 禁用粘滞绑定
- 移除旧版 free_team_first 预设入口,统一使用 free_first / team_first 新模式
- 对齐 plus_first 对 Plus/Pro 账号的优先级处理
- 调整负载均衡排序种子,避免同一分钟内固定命中同一 Key
- multi-score 预设下记录延迟样本,并补充号池调度/配置/运行时测试
- 收敛 request candidate extra_data 构造入参,修复 clippy too_many_arguments
2026-04-25 16:41:51 +08:00
fawney19
61e12e2c17 feat(scheduler): candidate report 携带 header_rules 与 body_rules
各 planner 在构造 report context 时附带端点的 header/body 改写规则,scheduler 解析后写入 candidate extra_data,便于追踪请求实际应用的透传规则
2026-04-25 11:43:53 +08:00
fawney19
65e915fd1d refactor(api-keys): 网关 API Key 改为 32 位字母数字随机串
由 UUID 拼接(48 位 hex)改为 base62 字母数字,缩短长度并提升可读性
2026-04-25 10:04:04 +08:00
fawney19
e5bbc797e0 chore(gateway): 调小 Postgres 连接池默认值
- max_connections 100 → 20
- idle_timeout 60s → 30s
- .env.example 补充连接池相关变量注释
2026-04-25 09:53:21 +08:00
fawney19
f30b1f3f6b fix(usage): 流式终端 usage 以更完整值为准,Codex CLI 显式选择 response 解析器
- 新增 StandardizedUsage::signal_score/is_more_complete_than/choose_more_complete,流式合并与终端落库均按信号完整度择优
- OpenAI Chat/CLI 解析器支持仅 usage 的终结 chunk 与 response.completed usage
- Codex provider 注入 provider_stream_event_api_format=openai:cli,解析器选择改由 report_context 显式决定
- usage_mapper 扩展嵌套 response/message/item 兼容 Claude message_start/message_delta 及 Gemini stream chunks
- usage SQL upsert 在终态(completed/failed/cancelled)时按 GREATEST 写入 token/费用镜像列
2026-04-25 00:57:01 +08:00
fawney19
5b3593038d fix(usage): OpenAI 缺失 input_tokens 时从 total 回推
- 同步与流式两条路径均在 input_tokens 为 0 且 total > output 时用 total - output 兜底
- 补充对应单元测试
2026-04-24 22:08:23 +08:00
Entropy.Xu
67b092253d fix(gateway): 兼容 OpenAI 图像 multipart boundary 大小写 (#331) 2026-04-24 21:41:20 +08:00
fawney19
db1059e73b fix(usage): 修复 Gemini total 重复累加 cache_read 并补充测试
- write.rs: Gemini usage 提取 total 时不再叠加 cachedContentTokenCount
- 补充 Claude 大 cache_read 场景下 input_tokens 不被扣减的测试
- 补充前端 getEffectiveInputTokens 对 Claude 格式不减 cache_read 的测试
2026-04-24 21:20:45 +08:00
Entropy.Xu
343345529d fix(kiro): 修复 Claude CLI 跨格式 Responses 流式转换 (#329) 2026-04-24 20:23:02 +08:00