mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 17:30:23 +08:00
fix(usage): 修复含失败信号的 pending 请求被误判为活跃的问题
- pending/streaming 状态含 status_code >= 400 或 error_message 时视为 failed - 候选状态派生改为 failed 优先于 stale pending/streaming - 活跃请求轮询时保留失败信号字段的更新 - 图片流支持 partial_image 事件转发及从 response.completed 读取最终图片
This commit is contained in:
@@ -764,6 +764,26 @@ async fn gateway_handles_admin_usage_active_locally_with_trusted_admin_principal
|
||||
row.candidate_index = Some(1);
|
||||
row
|
||||
},
|
||||
{
|
||||
let mut row = sample_usage_row(
|
||||
"usage-failed-pending",
|
||||
"req-failed-pending",
|
||||
Some("user-1"),
|
||||
Some("key-1"),
|
||||
Some("primary"),
|
||||
"OpenAI",
|
||||
"gpt-5",
|
||||
"pending",
|
||||
10,
|
||||
0,
|
||||
0.0,
|
||||
0.0,
|
||||
DAY_2_UNIX_SECS + 1,
|
||||
);
|
||||
row.status_code = Some(503);
|
||||
row.error_message = Some("upstream failed".to_string());
|
||||
row
|
||||
},
|
||||
sample_usage_row(
|
||||
"usage-done",
|
||||
"req-done",
|
||||
|
||||
Reference in New Issue
Block a user