Entropy.Xu
3b4f27f767
Add Codex image progress heartbeat
2026-05-09 01:21:26 +08:00
Entropy.Xu
dd8c2ebec6
fix(admin): repair system maintenance controls
...
Implement server-side searchable user filtering for usage records, including backend search parameters and a shared frontend selector with loading, empty, and pinned-selected states.
Fix announcement deletion by cascading announcement read rows through a Postgres migration and defensive repository cleanup across supported backends.
Wire admin system purge and cleanup endpoints to real data deletion/maintenance flows, improve DataManagement messages, rebuild stats after stats purge, and add runtime OAuth token refresh maintenance when enabled.
Verified with rust-ci equivalent checks: cargo fmt, split clippy, split cargo tests, SQLite/Postgres/MySQL smoke tests, plus frontend npm ci, build, pages build, type-check, and targeted usage selector tests.
2026-05-07 21:26:40 +08:00
fawney19
96f9be26da
polish usage output rate and installer progress
2026-05-07 13:39:25 +08:00
fawney19
10e679bb2f
Add provider key cycle stats reset handling
2026-05-07 03:23:20 +08:00
mayrain
54afe35fcc
feat(usage): show output speed in usage records
...
Display completed request output speed in the usage records table while keeping active requests focused on first-byte latency and live total duration.
The visible table keeps the compact tps label, while the tooltip expands the same value as tokens/s alongside first-byte, total, and generation durations.
Constraint: Synced against aether-rust-pioneer at 77c04749 with no upstream diff
Confidence: high
Scope-risk: narrow
Tested: npm run test:run -- src/features/usage/components/__tests__/UsageRecordsTable.spec.ts src/features/usage/__tests__/performance.spec.ts
Tested: npm run type-check
Tested: npm run build
Not-tested: Full backend test suite
2026-05-06 17:32:23 +08:00
fawney19
77c0474947
Fix usage records table layout
2026-05-06 16:20:09 +08:00
fawney19
887a58d639
Fix usage provider stats and performance analysis UI
2026-05-06 09:29:12 +08:00
fawney19
be580c35bb
chore: resolve pr 377 checks
2026-05-06 02:22:32 +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
mayrain
6b6d32b4a3
feat(usage): 新增输出速度统计与请求详情性能分析
...
- 把 upstream_is_stream 物化到 usage 与 billing facts,避免 Provider 聚合回连 public.usage
- 统一前端标准/流式 TPS 计算与显示,流式按首字后生成耗时计算
- 新增请求详情抽屉展示单请求输出速度与 Provider 聚合 TPS
2026-05-05 17:34:12 +08:00
mayrain
fd8230121c
fix(usage): 修复多天统计 NUMERIC→f64 解码失败导致记录清空
...
- 多天统计从日聚合表 SUM numeric 字段后返回 NUMERIC,代码按 f64 解码失败
- 显式添加 ::DOUBLE PRECISION 类型转换
- 管理员统计加载失败时不再清空已加载的记录列表
2026-05-05 17:32:50 +08:00
fawney19
47ee8b9c13
refactor: fold ai surfaces into formats
2026-05-02 18:19:39 +08:00
fawney19
4fc7cecf30
Fix OAuth token import and table filters
2026-05-01 02:14:49 +08:00
fawney19
33aa70c22b
fix scheduler affinity candidate selection
2026-04-30 16:27:24 +08:00
fawney19
07a319259b
Normalize canonical API formats
2026-04-29 10:20:41 +08:00
fawney19
02ad67fe33
fix(test): update openai format identifier from cli to responses
2026-04-28 21:04:38 +08:00
fawney19
17f09fc8c1
Expose ranking metadata in request trace
2026-04-27 17:24:32 +08:00
fawney19
3b542434a2
Unify candidate ranking pipeline
2026-04-27 17:24:31 +08:00
fawney19
4ec591fbf2
centralize openai responses alias handling
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
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
fawney19
429fdb47e6
fix(usage): 简化本地执行错误提示
2026-04-25 20:46:22 +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
RWDai
b8205b5a09
Fix/usage json entity escaping ( #333 )
...
* fix(usage): 修复 JSON 视图实体转义显示
* fix(usage): 解码 OpenAI 工具参数实体
2026-04-25 16:41:25 +08:00
fawney19
cef7dcac71
refactor(usage): 抽取 JsonContentPanel 通用 JSON 展示组件
...
请求详情抽屉与时间线统一复用工具栏(展开/收缩、复制)和 JSON 视图,时间线的额外信息也由 pre 改为可交互面板
2026-04-25 11:44:01 +08:00
fawney19
1761921670
fix(usage): 移动端缓存 token 拆分为读/写两列展示
...
cache_read 与 cache_creation 原本被合并为单值,现分别显示并补充测试
2026-04-25 09:53:32 +08:00
fawney19
2c6209277f
fix(usage): Claude 流式合并 message_start/delta usage,前端移动端缓存 token 合并展示
...
- Claude provider state 在 message_start 记录基础 usage,message_delta 合并 output_tokens
- 前端 UsageRecordsTable 移动端缓存列改为 cache_creation + cache_read 合计展示
2026-04-24 22:28:04 +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
fawney19
e265475c17
fix(usage): 修正 input_tokens 统计与显示
...
- SQL 查询不再用 settlement snapshot 的 billing_input_tokens 覆盖原始 input_tokens
- usage_mapper 针对 OpenAI 格式在 input_tokens 缺失时从 total_tokens - output_tokens 推导
- 前端轮询合并优先采用最新 record 的 input_tokens / effective_input_tokens
2026-04-24 20:59:12 +08:00
fawney19
657fcd595c
refactor(rust): 拆分 usage sql 仓储为模块并外置 SQL 文件
...
- 将 usage/sql.rs 拆分为 sql/mod.rs 与 sql/tests.rs
- 将内联 SQL 抽离到 sql/queries/ 目录下的独立 .sql 文件
- 前端用量记录表格移除缓存创建 token 展示,保留 cache read 列
2026-04-24 20:22:24 +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
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
fawney19
342d4a268c
feat(stream-bridge): 支持上游 sync 响应转 SSE 流式输出,记录 client/upstream 流模式差异
...
- 新增 sync_to_stream 桥接模块,将非 SSE 上游响应转换为 SSE 格式回传给流式客户端
- stream_pump 检测非 SSE 响应头后缓冲整包并通过桥接逻辑重写为 SSE 帧
- proxy handler 同步支持 sync→stream 聚合与转换(覆盖 openai/claude/gemini 四种格式)
- sync_products 补全 openai:cli 的完整流式事件聚合(text delta、reasoning、tool call 等)
- usage runtime 写入 client_requested_stream / upstream_is_stream 到 request_metadata
- SQL 查询层将两个布尔字段从 request_metadata jsonb 中提取并回传给前端
- 前端 status.ts 新增 resolveUsageStreamLabelSegments,优先读取 client_requested_stream
- RequestDetailDrawer 在流式转换场景下显示"客户端→上游"两段 Badge
2026-04-23 21:53:50 +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
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
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
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
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
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
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
fawney19
9a41b2c0dc
feat: 候选排序引入 API 格式偏好, 追踪页面展示完整格式转换信息
...
- 候选排序优先同 kind (chat/cli) 再同 family, 替代原有固定顺序
- 不再隐藏 format_conversion_disabled 候选, 保留完整追踪链路
- DecisionTrace 新增 provider/endpoint/key 格式转换相关字段
- 前端追踪面板新增 Key 支持端点和转换策略展示
2026-04-16 13:00:44 +08:00
fawney19
c569081340
fix(usage): streaming 状态在首字节到达前显示为 pending
...
新增 resolveDisplayRequestStatus 函数,当记录状态为 streaming 但
first_byte_time_ms 为空时回退显示为 pending,避免误导用户。
2026-04-15 17:50:45 +08:00
fawney19
593640ac19
feat(gateway): 增强候选路由策略与可观测信息
2026-04-14 11:50:52 +08:00
fawney19
53acfbabf6
refactor(gateway): 重构 ai pipeline 规划链路
2026-04-14 01:27:04 +08:00
fawney19
6aa16ec792
feat(data): 废弃 usage 表 HTTP/结算列,迁移至 settlement_snapshots 与 http_audits
...
- 新增迁移 20260413030000:标记 billing_status、finalized_at、request_headers 等列为 DEPRECATED
- 更新 baseline_v2.sql 同步废弃注释,BASELINE_V2_CUTOFF_VERSION 升至 20260413030000
- usage/sql.rs:inline body 阈值归零,强制所有 body 走 blob 存储;upsert 时清空 legacy header/output_price 列
- 查询层优先读 usage_settlement_snapshots 的 billing_status、finalized_at、output_price_per_1m
- runtime.rs:stale usage 处理同步写入 usage_settlement_snapshots;SELECT FOR UPDATE 改为 FOR UPDATE OF usage
- 前端:PerformanceAnalysis 页面重构为实时面板,新增 prometheus 工具函数与 monitoring API
2026-04-13 14:53:46 +08:00
fawney19
3f057628b7
fix: 修正用量失败状态判断与 Codex 会话头
2026-04-10 21:33:34 +08:00
fawney19
46f1507d44
feat: 提前记录 pending 用量、优化流遥测时序与前端活跃请求发现机制
...
- 将 record_pending 调用移至执行开始前(sync/stream 两路),确保请求在执行前即有 pending 记录
- stream_pump 在收到第一个数据块前优先 yield 遥测帧,保证 ttfb 早于 data 帧到达
- stream execution 增加 should_refresh_stream_usage_telemetry,在遥测帧携带新 ttfb/elapsed 时及时更新 record_stream_started
- access_log 对高频轮询路径(usage/active、usage/records 等)降级为 TRACE 日志,减少日志噪音
- 前端新增 reconcileActiveRequestDiscovery 工具函数及 discoverActiveRequests 逻辑,活跃请求发现与全局自动刷新解耦,空闲时降频为 5 秒扫描
- RequestDetailDrawer 调整:进行中请求不再自动开启轮询,由用户手动触发;刷新按钮 title 动态适配状态
2026-04-10 20:58:01 +08:00