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
fawney19
d0d71aa51a
fix(gateway): OpenAI 图像 finalize 统一返回 b64_json 并对齐 codex CLI 候选流式上游
...
- finalize 移除 response_format=url 的 data URL 分支,统一输出 b64_json
- image planner decision 依据请求体中的 stream 字段决定 upstream_is_stream
- openai chat sync plan 对 codex+openai:cli 候选强制上游流式
- 扩充 conversion registry 与 standard matrix 的全量 surface 对端测试
2026-04-24 19:01:11 +08:00
AAEE86
4618184516
fix: 修复账号批量操作快捷多选不生效和今日 Token 不准确 ( #328 )
...
* fix(pool): 修复账号批量操作快捷多选不生效
- 解析号池账号列表接口的 quick_selectors 查询参数
- 列表查询复用现有快捷筛选匹配逻辑
- 支持冷却列表与普通列表的快捷筛选后分页
- 更新架构测试中的 pool admin helper 边界断言
* fix(dashboard): 今日 Token 改为按分项汇总口径展示
- /api/dashboard/stats 的 today.tokens 改为 输入+输出+写缓存+读缓存
- “今日 Token”卡片 value 与 subValue 口径保持一致
- 同步更新 dashboard 相关测试断言
2026-04-24 18:36:38 +08:00
fawney19
3cc54deb9c
fix(gateway): SSE 流跳过成功探测与 prefetch,统计聚合 SQL 显式 CAST BIGINT
...
- stream: event-stream 响应跳过 direct finalize prefetch 与成功失败转移探测,避免消费流首帧
- stream_pump: 仅在已知 content-length 时缓冲非 SSE 响应
- maintenance: usage_billing_facts 聚合列显式 CAST 为 BIGINT,避免类型不匹配
2026-04-24 18:14:59 +08:00
fawney19
f695238e8a
feat(billing): 引入 billing v3 settlement snapshot 及 usage_billing_facts 视图
...
- 新增迁移 20260424000000:为 usage_settlement_snapshots 添加 settlement_snapshot、
billing_dimensions、billing_input/output/cache tokens、billing_total_cost_usd 等列,
并创建 usage_billing_facts 视图(从 settlement snapshot 覆盖原始 usage token/cost 字段)
- event_enrichment:构建结构化 settlement_snapshot(含 pricing_snapshot、billing_plan_snapshot、
resolved_dimensions、cost_breakdown 等),写入 request_metadata
- pricing:新增 pricing_source() 方法区分 provider_override / global_default / unpriced
- sql.rs:settlement snapshot 写入新列;用量汇总查询改用 usage_billing_facts 视图
- maintenance/runtime:所有统计查询的 FROM usage 替换为 FROM usage_billing_facts
- admin observability:在 settlement 响应中暴露 settlement_snapshot / billing_dimensions,
并从 metadata 中剥离对应字段
- request_metadata:允许 settlement_snapshot / billing_dimensions 字段传播
- stream execution:在首个数据帧到达时记录 TTFB,补全流式请求的 streaming 事件
2026-04-24 17:52:33 +08:00
Entropy.Xu
fb46fcd80f
feat(rust): 对齐 SMTP 测试与注册邮件 TLS 链路 ( #325 )
...
* feat(rust): 对齐 SMTP 连接测试链路
* fix(rust): 修复注册邮件 TLS provider 初始化
2026-04-24 14:59:00 +08:00
fawney19
e0c928fbe8
feat(auth): /me 接口返回 has_password 字段,前端 Profile 类型同步调整
2026-04-24 14:52:49 +08:00
fawney19
780f09c1a2
feat(billing): 引入 model_id 精确计费查找路径,传播模型 ID 至用量事件与 report context
...
- UsageEventData 新增 model_id / global_model_id 字段,write.rs seed 结构体同步补充
- report_context 新增 model_id / global_model_id / global_model_name,各 payload 构建时从 candidate 传入
- event_enrichment 优先按 model_id 精确查找计费上下文,回退为按名称多轮查找(保留 NoRule 结果降级逻辑)
- BillingReadRepository 新增 find_model_context_by_model_id,memory/sql 分别实现;SQL 查询重构支持按 provider_model_name 和 mappings 匹配并按优先级排序
- pricing.rs 修复:model_tiered_pricing 为空 tiers 时回退到 default_tiered_pricing
- request_metadata 允许字段列表补充 model_id / global_model_id / global_model_name
- admin usage 路由信息输出及脱敏字段列表同步新增三个 model 相关字段
2026-04-24 14:40:28 +08:00
fawney19
f3c9835759
feat(pool): 引入 pro_first 调度预设、Pool 候选持久化跳过与诊断信息优化
...
- 新增 pro_first 调度预设(Pro 优先),更新 plus_first 仅针对 Plus 计划,移除 free_team_first
- Pool 内部候选(pool_key_index 不为空)跳过 DB 持久化(available/skipped/unused 均适用)
- LRU 排序新增 catalog_lru_score 回退:runtime 无记录时使用 last_used_at_unix_secs
- 执行路径 miss 诊断消息细化为中文,按 reason 分类输出可读说明
- build_local_request_candidate_status_record 补充 extra_data 和 created_at_unix_ms 字段
- OpenAI CLI 计划构建流程补充候选评估进度跟踪与 terminal reason 设置
- 前端 PoolSchedulingDialog 增加 pro_first 预设展示,修复 LRU 默认预设检测逻辑
2026-04-24 13:29:05 +08:00
fawney19
f29649e3a8
feat(stream): 在流式执行中引入 StreamingStandardTerminalObserver 用量采集
...
- 在 execute_stream_from_frame_stream 中集成 StreamingStandardTerminalObserver,对流式响应逐行观察并在结束时合并终态摘要
- 新增 observe_stream_usage_bytes / finalize_stream_usage_observer / merge_stream_terminal_summary 辅助函数
- 更新 codex-cli 流式集成测试:补充 response.completed 含完整 usage 字段的 mock 数据,并断言用量写入 usage_repository
2026-04-24 11:34:41 +08:00
fawney19
5d710d9d10
feat(rust): 支持 image 同步转流式 SSE、free_team_first 调度预设及账户错误自动重试
...
- openai:image 同步响应桥接为流式 SSE(image_generation.completed / image_edit.completed 事件)
- image 请求解析与前置校验移除模型白名单,支持任意自定义模型名
- 调度器新增 free_team_first 预设(mode: both / free_only / team_only)
- pool config 解析重构:新增 POOL_ALLOWED_SCHEDULING_PRESETS 白名单,规范化 mode 字段
- 错误分类器新增账户/账单错误模式集,升级为 RetryUpstreamFailure 而非 StopSemanticClientError
- 修复 stream execution 中上游 headers 与输出 headers 混用导致 content-type 判断错误的问题
- codex image 工具始终写入 action 字段(generate/edit),仅 generate 操作填充默认 size/quality
- 前端:pool 节点组只展示实际执行过的候选节点,全部 skipped 时折叠为最后一个节点
- Redis 测试就绪检测从 TCP 连接改为 PING/PONG 协议验证
2026-04-24 10:07:24 +08:00
AAEE86
a9d10163af
fix(oauth): 修复 OAuth 刷新后 Token 有效期不更新问题 ( #324 )
...
- 持久化刷新后的 `expires_at` 到 Provider Key SQL 更新链路
- 手动刷新接口优先返回本次刷新得到的过期时间
- 按当前 Key 字段重建 OAuth 状态快照,避免旧快照覆盖
- 前端刷新后防止旧列表数据回退覆盖新有效期
2026-04-24 09:35:25 +08:00
Entropy.Xu
31e871fe1b
fix(kiro): 修复流响应识别与号池配额刷新 Token 续期问题 ( #322 )
...
* fix(kiro): 兼容 application/json 头下的 eventstream 流响应
- stream_pump: 对带 kiro:generateAssistantResponse envelope 的上游响应按流处理,不再仅依赖 text/event-stream 头判断\n- tests: 补充 application/json 头下仍识别为 Kiro stream 的回归测试
* fix(kiro): 修复号池配额刷新误判封禁
2026-04-24 09:34:34 +08:00
fawney19
5148370253
fix(usage): 修复含失败信号的 pending 请求被误判为活跃的问题
...
- pending/streaming 状态含 status_code >= 400 或 error_message 时视为 failed
- 候选状态派生改为 failed 优先于 stale pending/streaming
- 活跃请求轮询时保留失败信号字段的更新
- 图片流支持 partial_image 事件转发及从 response.completed 读取最终图片
2026-04-24 03:07:11 +08:00