Corrige sessões duplicadas ao reabrir uma sessão recente

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Sonnet 5.5 committed 2026-10-18 23:09:26 -03:00
1 parent 627eae1b8b
commit b1ac320193
2 files changed
+21 -4

No files matched your search

+11
View File
@@ -721,6 +721,17 @@ impl Engine {
}
pub fn load_session(&self, path: &str) -> Result<String> {
// Clicar de novo numa sessão já aberta reaproveita o job em vez de criar outro igual.
let want = Path::new(path);
if let Some(j) = self
.jobs
.lock()
.unwrap()
.values()
.find(|j| j.session_file.lock().unwrap().as_deref() == Some(want))
{
return Ok(j.id.clone());
}
let bytes = std::fs::read(path).map_err(|e| {
if e.kind() == std::io::ErrorKind::PermissionDenied {
Error::msg(format!(