修复: loop_state 懒创建继承+入口早退清理(#10), update_full 剥离列封 lost-update(#11), MidStream 保文不回填半截 reasoning, 标题剥标签 sanitize(#9), ANSI 源头抑制+strip 兜底(#8)
This commit is contained in:
@@ -596,7 +596,13 @@ pub(crate) async fn run_agentic_loop(
|
||||
}
|
||||
// G1.1(2026-08-05):入口早退也落库 user 消息(调用方已 push 内存),防重启/切会话丢末条 user。
|
||||
// resolved_model 此处尚未算出,model 传 None(仅持久化 user 消息,无 assistant 消息可标)。
|
||||
// #10:loop 即将退出,清 loop_state(spawn 已置 running——若本次 save 懒创建继承了
|
||||
// running,残留会让重启扫描误判「可恢复」,实际 loop 已死无任务可续)。
|
||||
save_conversation(&session_arc, &db, &conv_id, None, None, true).await;
|
||||
{
|
||||
let repo = df_storage::crud::AiConversationRepo::new(&db);
|
||||
let _ = repo.set_loop_state(&conv_id, None).await;
|
||||
}
|
||||
// ensure_resolved_key 失败 = key 缺失/钥匙串损坏,归 Auth。
|
||||
// 双写收敛经 emit_ai_chat_event;error_type 两端统一 Auth(原 publish 端漏传 None 属漂移,顺带修)。
|
||||
emit_ai_chat_event(&app_handle, AiChatEvent::AiError {
|
||||
@@ -615,7 +621,12 @@ pub(crate) async fn run_agentic_loop(
|
||||
return;
|
||||
}
|
||||
// G1.1(2026-08-05):入口超时早退也落库 user 消息(同上,model None)。
|
||||
// #10:loop 即将退出,清 loop_state(同 Auth 早退分支)。
|
||||
save_conversation(&session_arc, &db, &conv_id, None, None, true).await;
|
||||
{
|
||||
let repo = df_storage::crud::AiConversationRepo::new(&db);
|
||||
let _ = repo.set_loop_state(&conv_id, None).await;
|
||||
}
|
||||
tracing::error!(conv_id = %conv_id, "[ai] provider 解析超时(30s),可能 DB/keyring 卡死");
|
||||
let err_msg = "Provider 解析超时(30s),请检查数据库/钥匙串状态后重试".to_string();
|
||||
// 双写收敛经 emit_ai_chat_event;error_type 两端统一 Unknown(原 publish 端漏传 None 属漂移,顺带修)。
|
||||
|
||||
Reference in New Issue
Block a user