fix: 修复守护进程日志中文截取 panic

- daemon.rs: 使用字符索引替代字节索引截取日志文本
- agents.md: 添加踩坑记录
This commit is contained in:
2026-04-25 07:38:26 +08:00
parent 96b3aa4a37
commit ceeb6a3c31
2 changed files with 20 additions and 1 deletions

View File

@@ -330,8 +330,9 @@ async fn process_tts_request(request: DaemonRequest) -> Result<String> {
let format = request.format.unwrap_or_else(|| "wav".to_string());
let style = request.style;
let text_preview: String = text.chars().take(50).collect();
write_log(&format!("处理 TTS: text={}, voice={}, format={}, style={:?}",
&text[..text.len().min(50)], voice, format, style))?;
text_preview, voice, format, style))?;
// 处理风格标签
let mut final_text = text.clone();