fawney19
c8d7dbd8d6
refactor(gateway): 将 CF 头剥离中间件下移至各 router 构建函数并重构为前缀匹配
2026-04-22 21:10:16 +08:00
fawney19
cf6228f525
feat(stats,rules): api_key 用量统计(total_tokens 字段 + 回填)与 body rules 新增 append/insert/regex_replace/name_style 操作
...
- 新增迁移 20260422120000_add_api_key_usage_stats.sql,为 api_keys 表添加 total_tokens 列
- 新增回填 20260422120000_backfill_api_key_usage_stats.sql,按历史 usage 重建 api_key 维度汇总
- 在 UsageWriteRepository trait 中添加 rebuild_api_key_usage_stats,补齐 SQL/内存实现及上层调用链
- 内存实现中新增 apply_usage_stats_delta,支持增量更新 api_key 统计快照
- dev.sh:改进临时日志目录管理,并在网关异常退出时输出错误提示
- frontend EndpointFormDialog:将 append 操作从 insert 分支拆分,提供独立 path/value 输入 UI
- rules.rs:扩展 body rules 支持,新增 append/insert/regex_replace/name_style 操作及 WildcardSlice 路径段
2026-04-22 20:16:57 +08:00
fawney19
62153d7d36
feat(gateway): 新增 --auto-prepare-database 启动选项并在 docker-compose 默认开启
...
- aether-gateway 启动时可自动执行挂起的 migration 与 backfill
- docker-compose.yml 默认开启 AETHER_GATEWAY_AUTO_PREPARE_DATABASE
- 同步更新 .env.example、README 与 deploy.sh 的部署说明
2026-04-22 18:20:24 +08:00
fawney19
a5e6bd3b62
feat(stats): 新增聚合读路径与回填机制并重构 dashboard/usage 读取链路
...
- 新增 stats_user_summary 及 user_daily_provider/api_format/cost_savings 等聚合表
- 扩展 stats_daily/hourly 有效 token 与响应时间等字段,maintenance runtime 同步写入
- 新增 backfill 模块与 --apply-backfills 命令补齐历史聚合数据
- 重写 dashboard_filters、usage_heatmap、user_rollups 查询改走聚合表
- 同步更新 baseline_v2.sql 与 migration 集,README/dev.sh 补充回填用法
2026-04-22 17:29:39 +08:00
fawney19
063ef02306
fix(oauth): 系统导入时清理失效标记并强制刷新 refresh_token,前端徽章优先使用 account_id
...
- 后端 admin 系统导入 OAuth 凭据时重置 expires_at 与失效标记,并在存在 refresh_token 时触发一次本地刷新
- 前端 OAuth 徽章改为优先展示 account_id,采用去前缀后 5 字符的紧凑格式
2026-04-21 18:06:39 +08:00
fawney19
25a2b417be
refactor: 优化调度候选排序与用量写入链路并改进 Fernet 缓存与前端批量列表
2026-04-21 16:19:07 +08:00
fawney19
c5c56ff92f
feat(oauth): 允许替换已失效的活跃 OAuth 账号并同步 status_snapshot
...
- 活跃但 token 已过期或刷新失败的重复账号视为可替换
- 清除失效标记、刷新配额时同步更新 status_snapshot.oauth
- oauth_invalid 清除接口同时识别 invalid_at 与 invalid_reason 两种标记
- 批量导入任务状态区分 created_count / replaced_count,前端据此展示新增/替换统计
- 补充重复替换场景的集成测试,用量测试等待超时从 10s 提升到 30s 以适应并行压力
2026-04-20 22:59:02 +08:00
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
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
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
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
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
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 以避免环境抖动
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
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
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 >
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
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
faaaec28e1
fix(clippy): 修复冗余 into_iter、sort_by 及 match 嵌套 if 等 lint 警告
2026-04-17 01:43:45 +08:00
fawney19
6730e821b2
fix(clippy): 修复 collapsible_match 和 unnecessary_sort_by 警告
2026-04-17 01:12:43 +08:00
fawney19
1e0bc61526
feat(gateway/data): 新增 usage 关键词搜索、缓存命中摘要、结算成本摘要及 dashboard 聚合查询能力
...
- 新增 UsageAuditKeywordSearchQuery,支持多关键词、用户名、API Key 交叉过滤
- 新增 UsageCacheHitSummaryQuery/StoredUsageCacheHitSummary,统计请求缓存命中率
- 新增 UsageSettledCostSummaryQuery/StoredUsageSettledCostSummary,汇总结算成本
- 新增 UsageDashboardSummaryQuery、UsageBreakdownSummaryQuery 等 dashboard 聚合类型
- SQL 层实现对应查询方法,含 list_by_ids、list_usage_audits_by_keyword_search、count_usage_audits_by_keyword_search
- 将上述能力通过 GatewayDataState / AdminAppState 暴露给 handler 层
- user_me_usage 及 dashboard_filters 切换为新查询接口,移除旧的内存过滤逻辑
- 同步更新 memory 层及测试
2026-04-17 01:00:38 +08:00
github-actions[bot]
6e5af5ef70
chore(proxy): update download links for proxy-v0.3.1
2026-04-16 12:41:35 +00:00
fawney19
d312c397e1
chore: bump aether-proxy version to 0.3.1
2026-04-16 20:34:02 +08:00
fawney19
0dce667019
feat(tunnel/usage): proxy writer 双优先级队列、hub 连接压力感知选择、usage 请求记录级别控制及 trace 页面 proxy timing 增强
2026-04-16 20:14:50 +08:00
fawney19
65cd9dc3e5
fix(admin): 修复 usage 观测全表扫描并下推聚合查询
...
- 收紧 admin usage/stats 默认时间范围和 active 轮询查询
- 将 summary/records/aggregation/time-series/leaderboard 下推到 SQL 侧
- 统一前端时间参数并补齐 admin usage/stats 回归测试
2026-04-16 17:46:19 +08:00