修复: 队列发送失败回填不丢消息+池权重revert+lang解析DRY+注释变量名修正

This commit is contained in:
2026-06-17 03:55:30 +08:00
parent 6b2dd8fb5d
commit a622bdca61
9 changed files with 111 additions and 32 deletions

View File

@@ -100,8 +100,8 @@ pub(crate) fn truncate_parts_for_persist(parts: &[df_ai::provider::ContentPart])
ContentPart::Image { url, base64, media_type, alt } => {
// base64 模式:体量大,替换占位 Text 片
if let Some(b) = base64 {
let bytes_approx = b.len(); // base64 字符数 ≈ 字节数 * 4/3,粗估
let placeholder = format!("<image: base64 已省略, 共约 {} 字符>", bytes_approx);
let base64_len = b.len(); // base64 字符串长度(不含 data: 前缀)
let placeholder = format!("<image: base64 已省略, 共约 {} 字符>", base64_len);
out.push(ContentPart::Text { text: placeholder });
changed = true;
} else {