Commit Graph

67 Commits

Author SHA1 Message Date
fawney19
afedd90c80 Merge commit 'refs/pull/481/head' of github-fawney19:fawney19/Aether
# Conflicts:
#	apps/aether-gateway/src/ai_serving/api.rs
#	apps/aether-gateway/src/ai_serving/planner/standard/family/request.rs
#	apps/aether-gateway/src/ai_serving/planner/standard/openai/chat/decision/request.rs
#	apps/aether-gateway/src/ai_serving/planner/standard/openai/responses/decision/request.rs
2026-05-19 01:46:41 +08:00
fawney19
92813e6122 feat: add routing profile scheduling policies 2026-05-18 11:03:49 +08:00
mayrain
936e1ae37b feat(grok): add admin oauth and quota support 2026-05-16 21:15:38 +08:00
fawney19
f59cf1090d feat(admin): unify system data management and aggregate import/export 2026-05-16 02:16:53 +08:00
fawney19
e4f427f921 Merge remote-tracking branch 'entropy-xu/payment-billing-plans'
# Conflicts:
#	crates/aether-data/src/lifecycle/bootstrap/postgres.rs
#	crates/aether-data/src/lifecycle/migrate/tests.rs
#	frontend/src/views/admin/Users.vue
2026-05-15 16:37:17 +08:00
fawney19
170218bb26 Merge pull request #458 from RWDai/opencode/sunny-orchid
Add one-click proxy node installation
2026-05-15 12:49:08 +08:00
fawney19
54a8312e46 feat: add adaptive pool metrics and self-check 2026-05-15 02:21:11 +08:00
RWDai
91545cf906 Add admin proxy install session creation 2026-05-14 19:34:09 +08:00
fawney19
509bd30252 Redesign sensitive info protection settings 2026-05-14 11:14:20 +08:00
Entropy.Xu
3fb007a56d Merge remote-tracking branch 'origin/aether-rust-pioneer' into payment-billing-plans
# Conflicts:
#	crates/aether-data/src/lifecycle/bootstrap/postgres.rs
#	crates/aether-data/src/lifecycle/migrate/tests.rs
2026-05-13 01:29:18 +08:00
Entropy.Xu
10285c5eb9 feat: add payment gateway and billing plans 2026-05-13 01:18:38 +08:00
fawney19
d1a47c068e feat: update gateway pool and usage flows 2026-05-12 21:05:11 +08:00
RWDai
a7bab0ebd2 feat: add admin api key install sessions 2026-05-12 15:33:45 +08:00
fawney19
247ea9d1bd Restrict scheduler affinity to cache affinity mode 2026-05-11 14:06:49 +08:00
fawney19
bacb14e5f0 refactor: lazy pool key scheduling 2026-05-11 00:12:05 +08:00
fawney19
a8ac944959 Merge remote-tracking branch 'entropy-xu/codex/user-groups-default-permissions' into aether-rust-pioneer 2026-05-10 11:26:29 +08:00
fawney19
79b3a76dc1 Merge pull request #411 from buniakinazach-dev/feat/codex-spark-quota
新增 Codex Spark 额度展示
2026-05-10 09:25:44 +08:00
fawney19
c2bf17b4dd Fix Codex Spark quota formatting 2026-05-10 09:14:19 +08:00
Entropy.Xu
3a814f3d1f feat: add user groups and inherited access policies 2026-05-09 21:47:33 +08:00
Alice
757c264e3e 新增 Codex Spark 额度展示
解析 GPT-5.3-Codex-Spark 额度窗口,并在号池页面和提供商账号抽屉中展示 Spark 周额度与 5H 额度。Spark 额度仅用于展示,不影响普通 Codex 周额度和 5H 额度的调度与筛选逻辑。
2026-05-09 10:44:45 +08:00
RWDai
a72bf19454 fix(users): buffer API key install session body 2026-05-09 10:29:36 +08:00
fawney19
fa22384f24 Merge remote-tracking branch 'origin/pr/399' into aether-rust-pioneer
# Conflicts:
#	crates/aether-data/src/lifecycle/bootstrap/postgres.rs
#	crates/aether-data/src/lifecycle/migrate/tests.rs
2026-05-08 02:52:13 +08:00
Entropy.Xu
cc5cb3475e feat: add management token permissions 2026-05-07 23:48:29 +08:00
RWDai
94852ce60e feat(users): classify batch admin routes 2026-05-07 19:16:49 +08:00
fawney19
0c03c188f1 fix codex window usage stats 2026-05-07 13:35:25 +08:00
fawney19
64af7b1d8a fix: preserve selected keys for quota refresh 2026-05-07 12:55:39 +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
6c0ac2e8da chore: omit deprecated python quota changes 2026-05-07 01:39:48 +08:00
Codex
41f75a3f19 feat: show chatgpt web image quota 2026-05-06 22:58:47 +08:00
fawney19
fce7e959e5 Add multi-database data layer
Introduce aether-data-schema and driver-specific schema generation for Postgres, MySQL, and SQLite.

Split data backends, lifecycle, repositories, and gateway runtime integration across database drivers.

Verified with cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace.
2026-05-05 18:27:36 +08:00
fawney19
099653f732 Cap Codex pool cooldowns and add key circuit breaker 2026-05-04 02:15:32 +08:00
Kayphoon
fe27fb17fb feat: add provider-key concurrent limit (#352)
* feat: add provider-key concurrent limit

* Fix provider key concurrent limit checks

---------

Co-authored-by: fawney19 <elky0401@gmail.com>
2026-05-03 01:55:23 +08:00
fawney19
e3ea2d1451 feat: configure auth channel mismatch formats 2026-05-03 00:49:22 +08:00
jiuwovo-ai
bfd1ea72b3 fix: codex free accounts incorrectly marked as quota exhausted (#366)
* fix: codex free accounts incorrectly marked as quota exhausted when skip_exhausted_accounts enabled

- Cross-validate stored exhausted flag against window used_ratio in snapshot reader
- Guard has_credits:false check with window data presence in upstream_metadata fallback
- Add windows.is_empty() precondition to exhausted_by_credits in snapshot builder

Free codex accounts have has_credits:false (they use window-based quotas, not credits),
but the old logic treated this as credits depleted, skipping actual window usage checks.
This caused all free accounts to be incorrectly marked exhausted.

* test: cover codex free quota windows

---------

Co-authored-by: root <root@ser488556369540.local>
Co-authored-by: fawney19 <elky0401@gmail.com>
2026-05-02 14:11:29 +08:00
fawney19
c130d0e2c9 refactor ai serving modules and crates 2026-05-02 13:23:54 +08:00
fawney19
4fc7cecf30 Fix OAuth token import and table filters 2026-05-01 02:14:49 +08:00
fawney19
e751289dfb Support per-format provider key auth 2026-04-29 15:46:50 +08:00
fawney19
07a319259b Normalize canonical API formats 2026-04-29 10:20:41 +08:00
fawney19
230e7d6259 Normalize management token prefixes 2026-04-28 19:46:38 +08:00
fawney19
65e915fd1d refactor(api-keys): 网关 API Key 改为 32 位字母数字随机串
由 UUID 拼接(48 位 hex)改为 base62 字母数字,缩短长度并提升可读性
2026-04-25 10:04:04 +08:00
AAEE86
a9d10163af fix(oauth): 修复 OAuth 刷新后 Token 有效期不更新问题 (#324)
- 持久化刷新后的 `expires_at` 到 Provider Key SQL 更新链路
- 手动刷新接口优先返回本次刷新得到的过期时间
- 按当前 Key 字段重建 OAuth 状态快照,避免旧快照覆盖
- 前端刷新后防止旧列表数据回退覆盖新有效期
2026-04-24 09:35:25 +08:00
fawney19
fa328e18a1 feat: provider api_formats 可空继承、OpenAI 图片 edit/variation 与用量配额多项补强
- 鉴权: provider_api_keys.api_formats 改为可空,OAuth 托管 key 自动继承 provider endpoints 激活格式,相关 handler/测试同步更新
- 图片 planner: OpenAI 图片路由新增 edit/variation 操作并完善参数校验、响应合并与流式处理
- 用量: user me usage 返回区分 client_requested_stream/upstream_is_stream,前端 usage 列表筛选与展示增强
- 统计: stats_daily_model 新增 cache_creation_ephemeral_5m/1h tokens 字段与回填链路
- 配额/observability: quota repository 新增内存与 SQL 扩展,admin observability usage 字段扩充
- 其它: OAuth 导入/轮询收敛、provider 汇总与 pool admin 读写链路小修、新增 system_config 缓存与 provider template handler

Closes #318

Co-authored-by: Entropy.Xu <53283266+Entropy-Xu@users.noreply.github.com>
2026-04-23 14:42:51 +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
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
3321bb3ccc Implement independent provider pool scheduling runtime 2026-04-17 23:05:49 +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
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