重构: AI聊天可靠性批次(审批累计计数/write_file diff预览/会话隔离补清/token缓存)
This commit is contained in:
@@ -26,7 +26,10 @@ const DEFAULT_RUN_COMMAND_TIMEOUT_SECS: u64 = 60;
|
||||
/// 生成行级 unified diff(无外部依赖,基于 LCS)。
|
||||
/// 仅标 +/- 前缀,不做 hunk header(足够审批卡/审计留痕可读)。
|
||||
/// 文件改动通常集中在 old_text/new_text 局部,整体行对比可直观呈现。
|
||||
fn generate_diff(old: &str, new: &str) -> String {
|
||||
///
|
||||
/// AE-2025-03(路径 B):audit.rs 挂起审批前预读旧文件复用此函数生成 diff,
|
||||
/// 供前端审批卡即时预览(write_file 审批不再只看裸 content)。故 pub(crate)。
|
||||
pub(crate) fn generate_diff(old: &str, new: &str) -> String {
|
||||
let a: Vec<&str> = old.lines().collect();
|
||||
let b: Vec<&str> = new.lines().collect();
|
||||
let (n, m) = (a.len(), b.len());
|
||||
|
||||
Reference in New Issue
Block a user