fix(session): /new 后新对话被旧对话数据覆盖的问题
问题原因:execute_slash_command 执行 /new 后,错误地将旧 session 的数据 存储到新 session 的 key 下,导致 current_sessions 虽然指向新 session, 但 sessions 里面存的是旧数据。 解决方案:移除错误的 session 映射更新逻辑。create_session 已经正确地将 新 session 存入 sessions 并更新 current_sessions,不需要额外覆盖。
This commit is contained in:
parent
e2fd836794
commit
2f2631e36a
@ -1087,15 +1087,6 @@ impl SessionManager {
|
||||
Some(&unified_id),
|
||||
).await?;
|
||||
|
||||
// If a new session was created (e.g., /new, /delete), update the session binding
|
||||
if let Some(new_id) = new_session_id {
|
||||
// Update the session in the map with the new ID
|
||||
let mut inner = self.inner.lock().await;
|
||||
if let Some(old_session) = inner.sessions.remove(&unified_id.to_string()) {
|
||||
inner.sessions.insert(new_id.to_string(), old_session);
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(HandleResult::CommandOutput(response));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user