优化: sanitize 告警降级
- 修复告警 warn 降 debug,同份畸形历史每请求重复触发成洪水 - 涉 sanitize.rs 四处与 openai_compat 两处,含逐 orphan 单条刷屏点 - view-only 修复语义不变,存量配对清洗已完成
This commit is contained in:
@@ -424,7 +424,7 @@ fn sanitize_openai_triplets(messages: &mut Vec<OpenAiMessage>) {
|
||||
// 无配对头(id 不在任何保留 assistant 头内)→ orphan tool_result,丢弃。
|
||||
// 含两类:(a) assistant 头被 step2 剥后残留的 tool;(b) 全程无配对头的直构造/DB 残留。
|
||||
dropped_orphan_tools += 1;
|
||||
tracing::warn!(
|
||||
tracing::debug!(
|
||||
tool_call_id = %id,
|
||||
"[openai] orphan tool result(无配对 assistant tool_calls),已丢弃(防 'tool must be response to preceding tool_calls' 400)",
|
||||
);
|
||||
@@ -432,7 +432,7 @@ fn sanitize_openai_triplets(messages: &mut Vec<OpenAiMessage>) {
|
||||
});
|
||||
|
||||
if stripped_heads > 0 || dropped_orphan_tools > 0 {
|
||||
tracing::warn!(
|
||||
tracing::debug!(
|
||||
stripped_heads,
|
||||
total_stripped,
|
||||
dropped_orphan_tools,
|
||||
|
||||
Reference in New Issue
Block a user