重构: F-09批2 调用方迁移per-conv(双写桥接共存期)

- agentic.rs: GeneratingGuard加conv_id + 三处退出校验改conv存在性(决策e) + stop_flag/notify/messages/iteration per-conv + try_continue加conv_id参数
- commands.rs: IPC写路径双写桥接(per_conv新真相源+顶层双写,批4删) + ai_is_generating读per_conv fallback顶层
- audit/conversation/title/knowledge_inject/lib.rs: per_conv读写迁移
- conv()/conv_read()去allow(批2有调用方)
共存期双写: per_conv主+顶层双写兼容批4前IPC,批4签名改后删顶层
主代兜底: cargo check --workspace 0 + test 96 passed + grep三处退出/GeneratingGuard/双写印证
This commit is contained in:
2026-06-19 02:01:06 +08:00
parent 2c8764abee
commit 2a4d745c5b
9 changed files with 578 additions and 202 deletions

View File

@@ -250,7 +250,15 @@ pub(crate) async fn maybe_spawn_extraction(
return Ok(());
}
// 消息数守卫(总消息数,含 system/assistant/tool)
let msg_count = session_arc.lock().await.messages.len();
// F-260616-09 B 批2:读 per_conv.messages.len()(conv_id 来源:本函数入参)。
// per_conv 未建时 fallback 顶层 messages.len()(同锁内取,避免双锁死锁)。
let msg_count = {
let session = session_arc.lock().await;
match session.conv_read(conv_id) {
Some(c) => c.messages.len(),
None => session.messages.len(),
}
};
if (msg_count as u32) < config.min_messages {
return Ok(());
}