Commit Graph

1277 Commits

Author SHA1 Message Date
RWDai
cf7d129595 fix(proxy-nodes): allow management tokens with json null allowed_ips (#317)
* fix(proxy-nodes): allow management tokens with json null allowed_ips

* style(proxy-nodes): format regression test
2026-04-20 21:50:48 +08:00
fawney19
226a6e58d5 refactor(gateway): 重构格式转换候选资格检查并优化测试基础设施
- 将 format_conversion_disabled 的过滤提前到候选遴选阶段,替代原来的 skip_reason 标记机制
- 为测试添加 execution_runtime_sync_override 直接注入支持,避免启动额外 HTTP 服务器
- 将 submit_terminal_event 改为 async record_terminal_event 确保失败用量事件可靠入库
- 新增 test_support 模块封装可重试的 loopback 端口绑定逻辑
- 前端:poolTrace 将 skipped 从隐藏状态移除,新增 buildPoolParticipatedCandidates 统一新旧链路逻辑,并将 skipped 状态色改为 foreground
2026-04-20 16:59:18 +08:00
fawney19
87afe4898e fix(frontend): 为配额自动刷新加入 5 分钟冷却并优化 OAuth org 徽章显示
- 新增 quotaAutoRefreshCooldown 工具,按 provider 维度限制后台自动刷新频率,手动触发(刷新 token、变更 key)通过 ignoreCooldown 绕过
- OAuth org 徽章去除 org- 前缀后再缩略,避免 org:org-xx 的重复前缀,并缩小字号高度以适配紧凑布局
2026-04-20 15:56:59 +08:00
fawney19
d100c934c0 fix(frontend): 优化 OAuth 身份徽章优先级并避免 Kiro 订阅标签重复
- getOAuthOrgBadge 优先展示 organization id, 其次回落到 account_id 或 account_user_id, 不再使用 account_name 作为徽章文案
- Kiro provider 的订阅标签仅在与 OAuth plan 标签不一致时显示, 避免重复徽章
- 补充 getOAuthOrgBadge 的单元测试覆盖组织优先与回落场景
v0.7.0-rc12
2026-04-20 15:00:17 +08:00
fawney19
ffe5d16094 fix(oauth): 兼容 Kiro device token 的 snake_case 字段并保留 error 响应体
- device poll 同时接受 accessToken/access_token、refreshToken/refresh_token、expiresIn/expires_in
- post_kiro_device_oidc_json 在解析失败响应时保留完整 JSON 并附加 _error 标记, 避免丢失 authorization_pending 等详细信息
- 补充 authorization_pending 时 device session 保持 pending 状态的测试
2026-04-20 15:00:02 +08:00
Dalamud
078347b722 fix(aether-crypto): fix provider key decryption for legacy Python Fernet secrets (#316) 2026-04-20 14:31:54 +08:00
fawney19
9b48a008dc fix(frontend): 合并 OAuth 状态展示并移除 Codex 积分信息
- providerKeyStatus: 合并 snapshot 与 legacy OAuth 状态,按严重程度取优并补全失效原因
- ProviderDetailDrawer: 移除 Codex 积分摘要与相关字段显示
2026-04-20 14:27:48 +08:00
AAEE86
b2ff7d2c28 fix(wallet): 删除与过期删除 API Key 时同步禁用关联钱包 (#315)
- 在 delete_user_api_key 和 delete_standalone_api_key 事务中,先将关联 wallets.status 更新为 disabled
- 在过期 Key 自动清理流程中,删除前同步禁用对应钱包
- 保留 wallet 与交易流水,避免出现 orphaned 且 active 的钱包状态
2026-04-20 14:03:17 +08:00
fawney19
13bf222b8d refactor(oauth): 抽出 Kiro 刷新逻辑为共享模块并在 device-poll 复用
- 将 batch/kiro_import 中的 Kiro refresh/IDC helpers 抽到 dispatch/kiro.rs 共享
- device-poll 新增 IDC refresh 复核、JWT 缺失时通过 usage 接口回填 email、代理节点写入 key.proxy
- 补充对应集成测试覆盖 refresh 复核与 email 回填路径
2026-04-20 01:06:51 +08:00
fawney19
c2b7b6c231 refactor(proxy-nodes): 移除节点列表的 rollout 升级标签展示 2026-04-20 00:31:30 +08:00
fawney19
c1b9d94c84 feat(adaptive): 完善自适应 RPM 学习并将 Pool 调度状态与健康分解耦
- orchestration 新增 AdaptiveSuccess 效果,在成功回报路径上根据利用率窗口扩张 learned_rpm_limit
- 429 路径改用 429_observation/adjustment 记录以及基于历史的置信度评估,新增 last_rpm_peak 边界字段
- Pool 调度状态不再因 health_score 低或熔断而降级/拦截,前端同步移除相关按钮与文案兜底
- 新增前端 poolTrace 工具(附测试)承接原 HorizontalRequestTimeline 内的候选合并逻辑
2026-04-20 00:27:48 +08:00
fawney19
1f74e660de feat(transport): 暴露同格式 provider 的细分失败原因并在时间线展示
- claude_code/kiro/vertex policy 新增 transport_unsupported_reason_with_network 变体,返回具体失败码
- planner candidate_metadata 在 request_pair 写入同格式 provider 的细分 transport 原因
- 前端请求时间线优先展示 transport_diagnostics 的细分原因而非通用 transport_unsupported
v0.7.0-rc11
2026-04-19 21:45:57 +08:00
fawney19
77aac74590 feat(oauth): 完善账号异常识别并在调度/展示层拦截失效 OAuth 密钥
- 新增 aether-admin provider status 模块,统一解析账号状态(禁用/工作区停用等)
- 调度器 runtime 增加 oauth_invalid 判定,跳过刷新失败或已撤销的 OAuth 密钥(REQUEST_FAILED 保留可选)
- gateway state 在 local oauth 刷新返回 4xx 时持久化失败原因并同步状态快照
- admin pool 列表/详情回填 account 状态与 scheduling 阻塞原因(account_blocked)
- 共享 catalog 的 status_snapshot payload 附加 account 字段
2026-04-19 20:50:31 +08:00
fawney19
d719a1329c fix(usage): cache-affinity 间隔查询将 interval_minutes 强制转为 DOUBLE PRECISION 2026-04-19 16:32:29 +08:00
fawney19
c302dfe42d fix(usage): 完善 cache-affinity 时间线的用户名回退与模型空值兜底
- 当 auth 用户查询失败时回退到历史 username,避免时间线丢失用户信息
- SQL 投影对 usage.model 使用 COALESCE 兜底空值
- IntervalTimelineCard 在刷新间隔为 0 时跳过定时刷新
- Usage 页面关闭时间线卡片的自动轮询
2026-04-19 16:07:01 +08:00
fawney19
41b51f10a9 perf: 并行化 admin 聚合路由并完善前端缓存预取
- gateway: usage detail / provider summary / pool overview / users list 改为 tokio join 并行拉取依赖数据
- usage: interval timeline 支持自动刷新并按查询区间动态展示,取消服务端 120 分钟过滤并在 ScatterChart 统一封顶
- frontend: 新增管理端导航预取工具及 SidebarNav/MainLayout 触发,admin 读接口统一走 cachedRequest 的短期缓存
- dashboard: request detail 支持短 TTL 缓存并在 UsageRecordsTable mousedown 时预取
- data: migrate 测试在 wait_for_postgres 失败时清理子进程,避免遗留
2026-04-19 15:17:25 +08:00
fawney19
97cd877ce5 style(proxy-nodes): 统一缩进并移除未使用的 confirmWarning 引用 2026-04-19 13:46:21 +08:00
fawney19
7007d7a556 refactor(proxy-nodes): 简化批量升级为直接写入 upgrade_to 目标
- 后端移除分波 rollout/探测逻辑,改为一次性给所有合格 tunnel 节点写入升级目标,并自动取消活动中的 rollout
- 前端移除 rollout 进度、阶段筛选、重试/跳过/冲突清理等相关 UI 和交互
- 同步更新批量升级接口类型与测试用例
2026-04-19 13:38:59 +08:00
fawney19
e6fd95453d test(proxy-nodes): 将离线隧道用例的连通性探测指向 Cloudflare 以避免环境抖动 v0.7.0-rc10 2026-04-19 04:03:37 +08:00
fawney19
0329b7b784 feat(usage): 在 CanonicalUsage 中追加缓存 token 字段并在标准化流程透传
- 扩展 CanonicalUsage 支持 cache_creation/cache_read 及 5m/1h 明细
- OpenAI/Claude/Gemini 解析器提取缓存 token 并计入 total
- usage_mapper 补齐 Claude 缓存字段映射
- 新增 gateway pricing 集成测试覆盖三家同步/流式缓存计费
2026-04-19 03:55:55 +08:00
fawney19
2f487fda66 fix(usage): 修复缓存创建 token 展示并在总量中计入缓存组件
- gateway/admin 用量载荷在 cache_creation_input_tokens 为 0 时回填 ephemeral_5m/1h 合计
- 标准化用量写入时将 cache_creation/cache_read token 计入 total_tokens
- 前端列表与轮询同步新增分类字段,修复缓存 token 列显示
2026-04-19 02:46:28 +08:00
fawney19
e82c9c5104 fix(usage): 容错缺列投影以支持旧版和部分升级场景
map_usage_row 中对 http_audit/routing/settlement 等新增投影列改用
row_try_get_optional,将 ColumnNotFound 视同 NULL,避免仅选取核心字段
的读取路径在列缺失时整行失败。同时补充 UPSERT 和 LIST 前缀的占位列
断言。
proxy-v0.3.2
2026-04-19 01:48:16 +08:00
github-actions[bot]
c31261789c chore(proxy): update download links for proxy-v0.3.2 2026-04-18 17:30:37 +00:00
AAEE86
6666992d01 feat(admin): 将用户管理的用量统计改为全量累计口径 (#314)
- 新增按用户 ID 批量汇总 usage 的后端查询
- 在 /api/admin/users 中返回 request_count 和 total_tokens
- 移除用户管理页面额外的 usage 聚合请求
- 为管理端用户列表补充累计统计回归测试
2026-04-19 01:26:22 +08:00
fawney19
ab54881eb0 ci: 固定 macOS runner 版本并确保 Rust target 安装 2026-04-19 01:21:21 +08:00
fawney19
f8545c5141 chore: bump aether-proxy version to 0.3.2 2026-04-19 01:04:55 +08:00
AAEE86
bafb63a665 持久化 provider key 使用统计并移除 usage 汇总覆盖 (#313)
* 持久化 provider key 使用统计并移除 usage 汇总覆盖

- 在 usage upsert 时按请求前后差值同步 provider_api_keys 统计
- 增加基于保留 usage 记录的 provider key 统计重建能力
- 号池管理列表直接读取 provider_api_keys 统计字段

* fix: harden provider key usage stats sync

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-19 01:02:09 +08:00
RWDai
425227509a Fix/provider query cli model tests (#312)
* fix(admin): support openai cli provider-query model tests

* fix(admin): support claude and gemini cli provider-query model tests

* fix(admin): preserve provider-query prompts on cli fallback

* test(usage): relax async status wait for local usage checks

* fix(gateway): align provider-query CLI auth and headers

* fix(gateway): resolve provider-query clippy lint

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-18 23:05:39 +08:00
fawney19
f2a3836877 Improve tunnel proxy diagnostics and request body spooling 2026-04-18 21:13:37 +08:00
fawney19
3363592751 Refactor usage body capture and stream terminal reporting 2026-04-18 17:48:21 +08:00
fawney19
569242d72f refactor gateway orchestration and failover effects 2026-04-18 11:35:11 +08:00
fawney19
3321bb3ccc Implement independent provider pool scheduling runtime 2026-04-17 23:05:49 +08:00
RWDai
dd4641d618 Fix/provider query non kiro tests (#311)
* fix(admin): enable local provider-query tests for non-kiro providers

* test(admin): cover non-kiro provider-query model execution

* fix(admin): preserve provider-query test errors and failover retries

* fix(admin): handle provider-query test alias and HTTP retry edges

* fix(admin): extend provider-query failover coverage and fallback behavior

* fix(admin): prefer supported endpoints for provider-query tests

* fix(admin): prefer provider-query endpoints with compatible keys

* fix(admin): fall back to compatible provider-query endpoints

* fix(admin): align provider-query local tests with transport policy

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
v0.7.0-rc9
2026-04-17 19:45:20 +08:00
fawney19
0ce61bc91c fix(gateway): align provider restrictions with provider catalog 2026-04-17 18:59:13 +08:00
fawney19
cb647d95f9 Hide format_conversion_disabled skips when exact-format candidate shares the same key
Also switch failover test to surface an auth failure instead of a 502 upstream error.
2026-04-17 18:24:36 +08:00
fawney19
7eae1f90f6 Unify quota snapshots and oauth refresh handling 2026-04-17 18:22:41 +08:00
RWDai
b8702ae124 Fix/api key concurrency runtime miss (#309)
* test(cli): 覆盖 API key 并发等待与超时路径

* feat(scheduler): API key 并发饱和时等待可用槽位

* fix(proxy): 区分 API key 并发受限与真正的 runtime miss

* fix(outcome): runtime miss 仅归因真实执行候选

* feat(api-keys): 统一 concurrent_limit 默认值与校验辅助

* feat(admin): 独立 Key 接口支持 concurrent_limit

* feat(admin): 用户 API Key 路由支持 concurrent_limit

* feat(public): 自助 API Key 路由支持 concurrent_limit

* feat(import): 导入与存储层持久化 concurrent_limit

* feat(frontend): 同步 API Key concurrent_limit 类型定义

* feat(frontend): 独立 Key 表单支持 concurrent_limit

* feat(frontend): 管理员用户 API Key 表单支持 concurrent_limit

* feat(frontend): 自助 API Key 页面支持 concurrent_limit

* chore(fmt): 统一 runtime 归因相关 Rust 格式

* chore(fmt): 统一 admin API key 路由 Rust 格式

* chore(fmt): 统一 public 路由与相关测试 Rust 格式

* fix(test): 对齐 no-execution usage 归因断言

* test(middleware): 固定 access log tracing 用例线程模型

* fix(frontend): 提取用户 API Key payload 默认并发辅助

* fix(frontend): 保留用户 Key 的 concurrent_limit 默认值

* fix(api-keys): remove hardcoded concurrent limit default

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-17 14:21:43 +08:00
AAEE86
e5d3722adf fix(admin): force manual oauth refresh to bypass local cache (#308)
Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-17 14:12:15 +08:00
RWDai
ff4e853fd3 Fix/usage transfer filter (#307)
* fix(usage): 恢复 usage 列表中的 fallback 路由信号

* fix(admin): 支持 usage 记录展示和筛选 fallback 转移

* fix(usage): 在用户 usage 记录中暴露 fallback 标记

* fix(usage): 共享 usage 页面支持 fallback 筛选

* fix(usage): 对齐 fallback 筛选相关前端类型

* fix(usage): propagate has_fallback through active polling

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-17 13:38:23 +08:00
fawney19
654a41c3b0 Revert "fix(admin): force manual oauth refresh to bypass local cache"
This reverts commit 85a630cfa9.
2026-04-17 13:36:51 +08:00
Entropy.Xu
c6af4791f8 fix(oauth): 对齐 OpenAI 回调 state 解析与提交流程 (#306)
Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-17 13:26:23 +08:00
fawney19
85a630cfa9 fix(admin): force manual oauth refresh to bypass local cache 2026-04-17 13:23:51 +08:00
Entropy.Xu
ac1a126756 fix(kiro,pool,model): 对齐 Kiro 管理链路并修复全局模型删除行为 (#305)
* feat(pool): 号池支持跳过额度耗尽账号

- 新增 pool_advanced.skip_exhausted_accounts 开关及高级设置 UI, 默认关闭并兼容旧配置
- 为 Codex/Kiro 增加额度耗尽判定, 接入请求侧候选跳过并新增 account_quota_exhausted skip reason
- 号池列表将额度耗尽账号标记为 blocked/额度耗尽, 并补充前后端相关测试

* fix(kiro): 对齐账号管理与 provider-query 的 Rust 行为

- 修复 Kiro 单条导入误走 import-refresh-token 的前端分流, 并为误用路径返回明确错误提示
- 为 Kiro 导入与本地请求链补齐 bearer 兼容, 同步放开账号启停等 Key 更新操作的 auth_type 校验
- 实现 Kiro provider-query 本地模型测试与 failover 执行链, 并修复结果弹窗在无 trace 时无法展示 attempts/响应体的问题

* fix(model): 删除全局模型时级联清理关联提供商模型

- 对齐 Python 版本删除逻辑, GlobalModel 删除前先在事务内清理关联的 Provider Model 记录
- 修复已绑定 Provider 的模型在 Rust SQL 仓库下会被外键约束拦住、无法正常删除的问题
- 增加管理端回归测试, 覆盖绑定 Provider Model 的 GlobalModel 删除场景

* fix(kiro,ci): 恢复 Kiro OAuth 持久化并修复 Rust CI

* Fix oauth-managed provider key semantics

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-17 12:57:06 +08:00
RWDai
96a25d058b Fix OpenAI family local auth to use bearer (#302)
* Fix OpenAI family local auth to use bearer

* test(gateway): fix bearer auth assertions for openai local flows

* test(usage): make local usage status wait resilient

* style(gateway): apply rustfmt to usage test helper

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-17 11:10:05 +08:00
Entropy.Xu
6964729cb7 feat(payments): 增加兑换码与支付适配框架 (#299)
* feat(payments): 增加兑换码与支付适配框架

* fix(ci): 对齐 Rust 1.95 lint 与格式要求

* fix(payments): harden redeem code wallet credits

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
2026-04-17 10:07:52 +08:00
fawney19
54d77598ae ci(rust): 将环境变量提升至全局,各 job 添加 toolchain 显示步骤 v0.7.0-rc8 2026-04-17 01:58:12 +08:00
fawney19
0bcfc7d352 fix(ci): 将 rustfmt/clippy 组件安装改为独立 rustup 步骤 2026-04-17 01:53:59 +08:00
fawney19
faaaec28e1 fix(clippy): 修复冗余 into_iter、sort_by 及 match 嵌套 if 等 lint 警告 2026-04-17 01:43:45 +08:00
fawney19
dde02e6111 fix(ci): 恢复 rust-toolchain@stable,版本由 rust-toolchain.toml 控制 2026-04-17 01:17:29 +08:00
fawney19
aadc6b665c chore: 锁定 Rust 版本为 1.95.0,统一本地与 CI 环境 2026-04-17 01:15:16 +08:00