refactor(backend): alihkan manajemen session ke zesdex-iam (SessionRepository/SessionLockRepository)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
asepharyana
2026-07-17 09:08:41 +07:00
co-authored by Claude Sonnet 5
parent 4ab812d93b
commit add6845edf
4 changed files with 31 additions and 17 deletions
@@ -24,6 +24,7 @@ use std::fmt::Write;
use crate::app::harness::Verdict;
use sha2::Digest;
use crate::app::review::{should_trigger_review, trigger_review};
use zesdex_iam::domain::repository::SessionRepository;
use crate::app::state::rest::{AppStateRest, ChatMessageDisplay};
use crate::app::state::runtime::TurnEvent;
use crate::app::state::types::{Origin, Overlay, Toast, ToastKind};
@@ -1637,11 +1638,12 @@ fn maybe_trigger_review(state: &mut AppStateRest) {
/// Why: called on `ForceQuit` so the session can be resumed later.
fn save_current_session(state: &AppStateRest) {
let base = state.store_base_dir();
let session = crate::model::session::Session::new(
let session = zesdex_iam::domain::session::Session::new(
state.session_id.clone(),
"session".to_string(),
);
let _ = session.save(&base);
let session_repo = zesdex_iam::infrastructure::persistence::session_repo::FileSystemSessionRepository::new();
let _ = session_repo.save_session(&base, &session);
if let Some(ref rt) = state.session_runtime {
let conv_path = session.conversation_path(&base);
if let Ok(data) = serde_json::to_string(&rt.messages) {
+1 -1
View File
@@ -57,7 +57,7 @@ pub struct AppStateRest {
pub mention_index: MentionIndex,
pub edit_log: EditLog,
pub session_runtime: Option<SessionRuntime>,
pub sessions: Vec<crate::model::session::Session>,
pub sessions: Vec<zesdex_iam::domain::session::Session>,
pub transcript_cache: TranscriptCache,
pub scroll: ScrollState,
pub input: InputState,