MMEXA
0b30cc6b0f
feat(openai): unify tier authorization and settlement
2026-07-11 12:27:05 +08:00
MMEXA
dfa121dd5b
feat(openai): align GPT-5.6 and Codex request contracts
2026-07-11 07:40:12 +08:00
elky
4bf5d4c044
Fix cache token accounting and tiered pricing
2026-07-10 15:13:12 +08:00
elky
8edcbdcb29
feat(usage): expose request timing details
2026-06-10 09:16:15 +08:00
elky
905453d62b
revert: remove usage elapsed clock calibration
2026-05-31 20:30:51 +08:00
Novick Yuan
4b2d8cef3c
fix(usage): calibrate active elapsed clock efficiently
2026-05-28 18:45:16 +08:00
fawney19
ffd8d273c4
Revert "Merge remote-tracking branch 'origin/pr/592'"
...
This reverts commit 3504875922 , reversing
changes made to 5c3a1aecbe .
2026-05-28 17:10:27 +08:00
Novick Yuan
6412294262
Use header-only usage server timing
2026-05-28 14:30:15 +08:00
Novick Yuan
8aca1f8b93
Add server time to usage responses
2026-05-28 14:30:15 +08:00
AAEE86
e27ca671fd
feat(usage): show reasoning and fast badges in usage records
...
- extract provider reasoning effort from request body metadata
- extract priority service tier and expose it as service_tier
- show reasoning level and fast badges after model names
- include badges in active request updates and usage list payloads
- add targeted backend and frontend coverage
2026-05-27 00:36:52 +08:00
fawney19
ab048b8a03
fix monitoring trace lookup fallback
2026-05-23 01:22:24 +08:00
RWDai
ca341703bc
feat(usage): infer additional client families
2026-05-22 15:27:39 +08:00
fawney19
0e6d7539ad
Merge remote-tracking branch 'origin/pr/538'
2026-05-21 23:12:42 +08:00
stabey and Claude Opus 4.7
3330b2ac4c
refactor(report-context): extract UPSTREAM_IS_STREAM_KEY constant
...
The "upstream_is_stream" JSON key flows from the AI execution report
context producer (aether-ai-serving::report_context) through several
consumers — usage runtime metadata copy/move, gateway watchdog, sync
execution decision, observability handlers, and the per-driver usage
repositories. Each site spelled the key as a bare string literal, so a
producer-side rename would silently degrade every consumer to its
fallback (typically assuming streaming) with no compile-time signal.
Introduce a single pub const UPSTREAM_IS_STREAM_KEY in
aether-ai-formats (the lowest crate every consumer already depends on),
re-export from the crate root, and route producer + all map-style
consumers through it. The change is purely a string-literal → constant
swap; behaviour is identical.
Sites left as literals (intentional):
- `json!({"upstream_is_stream": ...})` macro keys, which must be string
literals at the macro layer; these are also API-response payload
field names (an external contract that should not silently track
internal report-context renames).
- SQL column accessors (`try_get::<...>("upstream_is_stream")`), which
refer to the database schema column, not the JSON key.
- Test fixtures and assertions, which validate the on-the-wire contract
and should keep verifying the actual string.
Co-Authored-By: Claude Opus 4.7 <[email protected] >
2026-05-21 15:26:42 +08:00
Entropy.Xu
129c7c90c0
fix(provider): 修复 Windsurf 原生工具桥接
2026-05-21 01:02:02 +08:00
fawney19
f76bbaab52
feat: support api key ip restriction rules
2026-05-20 16:11:49 +08:00
RWDai
bdc848b19e
Merge upstream main into feat/500-api-key-ip-whitelist
2026-05-20 10:26:56 +08:00
fawney19
1b570daf72
Revert "Merge PR #504 "
...
This reverts commit d216a9e219 , reversing
changes made to 21e82abd54 .
2026-05-19 17:23:57 +08:00
RWDai
95af482ffe
Update auth snapshot observability fixture
2026-05-19 10:23:54 +08:00
fawney19
d8a9d7eb5e
chore: format merged PR changes
2026-05-19 08:13:56 +08:00
fawney19
d216a9e219
Merge PR #504
2026-05-19 08:10:57 +08:00
fawney19
5eed329916
Rootfix usage counter outbox
2026-05-19 00:44:37 +08:00
MMEXA
4317ff78b1
Expose local scheduling failures in usage UI
2026-05-18 16:28:37 +00:00
RWDai
24129d7f12
Merge upstream/main into feat/356-usage-record-columns
2026-05-18 20:33:05 +08:00
RWDai
ae9d4038b1
Prefer typed admin usage client family
2026-05-18 19:29:36 +08:00
RWDai
96d40dd21d
Infer usage client family from User-Agent
2026-05-17 23:04:31 +08:00
RWDai
981020a5ab
fix(ci): apply rustfmt to usage metadata handlers
2026-05-17 20:28:08 +08:00
RWDai
97cd92a1a2
Expose usage record metadata fields
2026-05-16 15:55:38 +08:00
RWDai
a2649718ea
Expose scheduling failure details in usage payload
2026-05-16 15:42:13 +08:00
AAEE86
bfbf7a4663
fix(usage): 统一用户排行榜 Token 统计口径
...
- 将用户排行榜 Tokens 调整为与仪表盘今日 Token 一致
- 统一 effective input、cache creation fallback、cache read 计算规则
- 补齐 Postgres 聚合、admin 内存构建和内存仓库回退路径
- 增加缓存命中场景的统计口径测试
2026-05-11 22:34:37 +08:00
fawney19
ef4cc55c9a
Record per-candidate upstream error bodies
2026-05-11 02:30:45 +08:00
fawney19
0f42a6ed82
Fix Codex image progress heartbeat merge regressions
2026-05-10 02:10:23 +08:00
fawney19
79d07ac79a
Improve request trace upstream diagnostics
2026-05-09 10:46:04 +08:00
Entropy.Xu
3b4f27f767
Add Codex image progress heartbeat
2026-05-09 01:21:26 +08:00
fawney19
2eb4afbec4
Merge remote-tracking branch 'origin/pr/384' into codex/pr-376-377-383-384-combined
...
# Conflicts:
# frontend/src/views/admin/PerformanceAnalysis.vue
2026-05-06 02:39:53 +08:00
fawney19
cf27773582
feat: improve admin performance analysis
2026-05-06 02:01:32 +08:00
fawney19
3264857e4a
fix(usage): repair aggregate usage statistics
2026-05-06 01:13:23 +08:00
Entropy.Xu
ff1ed8b57d
feat(stats): 添加 Provider 性能统计分析
2026-05-05 11:24:16 +08:00
fawney19
4fc7cecf30
Fix OAuth token import and table filters
2026-05-01 02:14:49 +08:00
fawney19
07a319259b
Normalize canonical API formats
2026-04-29 10:20:41 +08:00
fawney19
17f09fc8c1
Expose ranking metadata in request trace
2026-04-27 17:24:32 +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
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
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
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
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