File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## 2026-05-21
4+
5+ - 调整 [ adapter.js] ( adapter.js ) 的 route 字段映射:
6+ - 聚合写库前,` route ` (适配器内部沿用 ` endpoint ` 字段)改为优先取 ` api_key ` ,其次取 ` auth_type ` ,最后才回退到原始 ` endpoint ` 。
7+ - 修复上游队列中 ` endpoint ` 为 ` POST /v1/chat/completions ` 时被原样入库,导致 route 异常的问题。
8+ - 调试摘要日志中新增 ` auth_type ` ,并对 ` api_key ` 做脱敏显示,便于排查字段来源且避免泄露敏感值。
9+
310## 2026-05-10
411
512- 为 ` adapter.js ` 增加 Redis 连接错误后的定时无限重连:
Original file line number Diff line number Diff line change @@ -121,7 +121,9 @@ function normalizeRecord(record) {
121121 if ( ! record || typeof record !== 'object' ) return null ;
122122
123123 const model = typeof record . model === 'string' && record . model . trim ( ) ? record . model . trim ( ) : 'unknown' ;
124- const endpoint = typeof record . endpoint === 'string' && record . endpoint . trim ( ) ? record . endpoint . trim ( ) : 'default' ;
124+ const apiKey = typeof record . api_key === 'string' && record . api_key . trim ( ) ? record . api_key . trim ( ) : '' ;
125+ const authType = typeof record . auth_type === 'string' && record . auth_type . trim ( ) ? record . auth_type . trim ( ) : '' ;
126+ const endpoint = apiKey || authType || ( typeof record . endpoint === 'string' && record . endpoint . trim ( ) ? record . endpoint . trim ( ) : 'default' ) ;
125127 const source = typeof record . source === 'string' ? record . source : '' ;
126128 const timestamp = typeof record . timestamp === 'string' && record . timestamp . trim ( )
127129 ? record . timestamp
@@ -184,6 +186,8 @@ function logUsageRecordDiagnostic(record, rawRecord) {
184186 const summary = {
185187 timestamp : record . timestamp ,
186188 endpoint : record . endpoint ,
189+ auth_type : record . auth_type ,
190+ api_key : record . api_key ? '[redacted]' : record . api_key ,
187191 provider : record . provider ,
188192 model : record . model ,
189193 alias : record . alias ,
You can’t perform that action at this time.
0 commit comments